diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index bfb2507..50bea74 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,39 +1,39 @@ 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.hoshomandsazan.rasadyar_app" + namespace = "ir.mnpc.rasadyar" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + ndkVersion = "27.0.12077973" compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + jvmTarget = "21" } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.hoshomandsazan.rasadyar_app" - // You can update the following values to match your application needs. - // For more information, see: https://flutter.dev/to/review-gradle-config. + applicationId = "ir.mnpc.rasadyar" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } + packaging { + resources { + excludes += "META-INF/DEPENDENCIES" + } + } + 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") } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f5c459f..96504e7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,28 +1,47 @@ + + + + + + + + + + + + + + + android:icon="@mipmap/launcher_icon" + android:label="رصــدیـار"> + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" /> - - + + - - + + diff --git a/android/app/src/main/kotlin/com/hoshomandsazan/rasadyar_app/MainActivity.kt b/android/app/src/main/kotlin/com/hoshomandsazan/rasadyar_app/MainActivity.kt deleted file mode 100644 index dd83dfa..0000000 --- a/android/app/src/main/kotlin/com/hoshomandsazan/rasadyar_app/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.hoshomandsazan.rasadyar_app - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity : FlutterActivity() diff --git a/android/app/src/main/kotlin/ir/mnpc/rasadyar/ApkInstaller.kt b/android/app/src/main/kotlin/ir/mnpc/rasadyar/ApkInstaller.kt new file mode 100644 index 0000000..aa64136 --- /dev/null +++ b/android/app/src/main/kotlin/ir/mnpc/rasadyar/ApkInstaller.kt @@ -0,0 +1,274 @@ +package ir.mnpc.rasadyar + +import android.app.Activity +import android.app.PendingIntent +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.pm.PackageInstaller +import android.content.pm.PackageManager +import android.net.Uri +import android.os.Build +import android.provider.Settings +import android.util.Log +import android.widget.Toast +import androidx.core.content.FileProvider +import java.io.File +import androidx.core.net.toUri + + +class ApkInstaller(private val context: Context) { + + var pendingApkFile: File? = null + + companion object { + const val INSTALL_REQUEST_CODE = 1001 + const val INSTALL_PERMISSION_REQUEST_CODE =2001 + + } + + /** + * Install APK with compatibility for Android 5-15 + */ + fun installApk(apkFile: File) { + when { + Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> { + // Android 8+ (API 26+) - Use PackageInstaller API + installWithFileProvider(apkFile) + } + + Build.VERSION.SDK_INT >= Build.VERSION_CODES.N -> { + // Android 7+ (API 24+) - Use FileProvider with Intent + installWithFileProvider(apkFile) + } + + else -> { + // Android 5-6 (API 21-23) - Use file URI with Intent + installWithFileUri(apkFile) + } + } + } + + /** + * Android 8+ (API 26+) - PackageInstaller API + */ + private fun installWithPackageInstaller(apkFile: File) { + try { + val packageInstaller = context.packageManager.packageInstaller + val params = PackageInstaller.SessionParams( + PackageInstaller.SessionParams.MODE_FULL_INSTALL + ) + + // Set installer package name for better tracking + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { + params.setInstallReason(PackageManager.INSTALL_REASON_USER) + } + + val sessionId = packageInstaller.createSession(params) + val session = packageInstaller.openSession(sessionId) + + session.use { activeSession -> + apkFile.inputStream().use { inputStream -> + activeSession.openWrite("package", 0, apkFile.length()).use { outputStream -> + inputStream.copyTo(outputStream) + activeSession.fsync(outputStream) + } + } + + val intent = Intent(context, InstallResultReceiver::class.java).apply { + action = "${context.packageName}.INSTALL_RESULT" + } + + val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE + } else { + PendingIntent.FLAG_UPDATE_CURRENT + } + + val pendingIntent = PendingIntent.getBroadcast( + context, 0, intent, flags + ) + + activeSession.commit(pendingIntent.intentSender) + } + } catch (e: Exception) { + // Fallback to intent method + installWithFileProvider(apkFile) + } + } + + /** + * Android 7+ (API 24+) - FileProvider with Intent + */ + private fun installWithFileProvider(apkFile: File) { + try { + val apkUri = FileProvider.getUriForFile( + context, + "${context.packageName}.fileprovider", + apkFile + ) + + val intent = createInstallIntent(apkUri).apply { + flags = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_ACTIVITY_NEW_TASK + + // Additional flags for better compatibility + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true) + putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, context.packageName) + } + } + + if (context is Activity) { + context.startActivityForResult(intent, INSTALL_REQUEST_CODE) + } else { + context.startActivity(intent) + } + } catch (e: Exception) { + + // Final fallback for Android 7+ + installWithFileUri(apkFile) + } + } + + /** + * Android 5-6 (API 21-23) - File URI with Intent + */ + private fun installWithFileUri(apkFile: File) { + try { + val apkUri = Uri.fromFile(apkFile) + val intent = createInstallIntent(apkUri).apply { + flags = Intent.FLAG_ACTIVITY_NEW_TASK + } + + if (context is Activity) { + context.startActivityForResult(intent, INSTALL_REQUEST_CODE) + } else { + context.startActivity(intent) + } + } catch (e: Exception) { + + } + } + + /** + * Create appropriate install intent based on Android version + */ + private fun createInstallIntent(uri: Uri): Intent { + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + Intent(Intent.ACTION_INSTALL_PACKAGE).apply { + data = uri + } + } else { + Intent(Intent.ACTION_VIEW).apply { + setDataAndType(uri, "application/vnd.android.package-archive") + } + } + } + + /** + * Check if installation from unknown sources is allowed + */ + fun canInstallPackages(): Boolean { + return when { + Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> { + context.packageManager.canRequestPackageInstalls() + } + + Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 -> { + try { + Settings.Secure.getInt( + context.contentResolver, + Settings.Secure.INSTALL_NON_MARKET_APPS + ) == 1 + } catch (e: Settings.SettingNotFoundException) { + false + } + } + + else -> { + // For older versions, assume it's allowed + true + } + } + } + + /** + * Request permission to install packages + */ + fun requestInstallPermission(activity: Activity) { + when { + Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> { + if (!activity.packageManager.canRequestPackageInstalls()) { + val intent = Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).apply { + data = "package:${activity.packageName}".toUri() + } + activity.startActivityForResult(intent, INSTALL_PERMISSION_REQUEST_CODE) + } + } + + Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 -> { + val intent = Intent(Settings.ACTION_SECURITY_SETTINGS) + activity.startActivityForResult(intent, INSTALL_PERMISSION_REQUEST_CODE) + } + } + } + + + +} + +class InstallResultReceiver : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { + when (val status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -1)) { + PackageInstaller.STATUS_SUCCESS -> { + Log.d("InstallResult", "Installation successful") + // Handle successful installation + Toast.makeText(context, "Installation successful", Toast.LENGTH_SHORT).show() + } + + PackageInstaller.STATUS_FAILURE -> { + val message = intent.getStringExtra(PackageInstaller.EXTRA_STATUS_MESSAGE) + Log.e("InstallResult", "Installation failed: $message") + Toast.makeText(context, "Installation failed: $message", Toast.LENGTH_LONG).show() + } + + PackageInstaller.STATUS_FAILURE_BLOCKED -> { + Log.e("InstallResult", "Installation blocked") + Toast.makeText(context, "Installation blocked by system", Toast.LENGTH_LONG).show() + } + + PackageInstaller.STATUS_FAILURE_ABORTED -> { + Log.e("InstallResult", "Installation aborted") + Toast.makeText(context, "Installation was cancelled", Toast.LENGTH_SHORT).show() + } + + PackageInstaller.STATUS_FAILURE_INVALID -> { + Log.e("InstallResult", "Invalid APK") + Toast.makeText(context, "Invalid APK file", Toast.LENGTH_LONG).show() + } + + PackageInstaller.STATUS_FAILURE_CONFLICT -> { + Log.e("InstallResult", "Installation conflict") + Toast.makeText( + context, + "Installation conflict with existing app", + Toast.LENGTH_LONG + ).show() + } + + PackageInstaller.STATUS_FAILURE_STORAGE -> { + Log.e("InstallResult", "Insufficient storage") + Toast.makeText(context, "Insufficient storage space", Toast.LENGTH_LONG).show() + } + + PackageInstaller.STATUS_FAILURE_INCOMPATIBLE -> { + Log.e("InstallResult", "Incompatible app") + Toast.makeText(context, "App is incompatible with device", Toast.LENGTH_LONG).show() + } + + else -> { + Log.w("InstallResult", "Unknown status: $status") + } + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/ir/mnpc/rasadyar/MainActivity.kt b/android/app/src/main/kotlin/ir/mnpc/rasadyar/MainActivity.kt new file mode 100644 index 0000000..dc675dc --- /dev/null +++ b/android/app/src/main/kotlin/ir/mnpc/rasadyar/MainActivity.kt @@ -0,0 +1,58 @@ +package ir.mnpc.rasadyar + +import android.content.Intent +import android.net.Uri +import android.os.Build +import android.provider.Settings +import android.util.Log +import androidx.annotation.RequiresApi +import androidx.core.content.FileProvider +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodChannel +import java.io.File +import androidx.core.net.toUri + +class MainActivity : FlutterActivity() { + + private val CHANNEL = "apk_installer" + private val INSTALL_PACKAGES_REQUEST_CODE = 1001 + private val installer = ApkInstaller(this) + private val TAG = "cj" + + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + + MethodChannel( + flutterEngine.dartExecutor.binaryMessenger, + CHANNEL + ).setMethodCallHandler { call, result -> + if (call.method == "apk_installer") { + val internalFile = File(context.filesDir.parentFile, "app_flutter/rasadyar.apk") + val externalFile = File(context.getExternalFilesDir(null), "rasadyar.apk") + + internalFile.copyTo(externalFile, overwrite = true) + if (!installer.canInstallPackages()) { + installer.pendingApkFile = externalFile + installer.requestInstallPermission(activity) + } else { + installer.installApk(externalFile) + } + result.success(null) + } + } + + + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + + if (requestCode == ApkInstaller.INSTALL_PERMISSION_REQUEST_CODE) { + if (installer.canInstallPackages() && installer.pendingApkFile != null) { + installer.installApk(installer.pendingApkFile!!) + installer.pendingApkFile = null + } + } + } +} diff --git a/android/app/src/main/res/mipmap-hdpi/launcher_icon.png b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png new file mode 100644 index 0000000..8e82f3a Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/launcher_icon.png b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png new file mode 100644 index 0000000..4a71c78 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png new file mode 100644 index 0000000..c2b3df6 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png new file mode 100644 index 0000000..2efdd5c Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png new file mode 100644 index 0000000..d286a0a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/xml/file_paths.xml b/android/app/src/main/res/xml/file_paths.xml new file mode 100644 index 0000000..ad6701e --- /dev/null +++ b/android/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index a439442..a0fa520 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -19,7 +19,7 @@ pluginManagement { 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 + id("org.jetbrains.kotlin.android") version "1.9.25" apply false } include(":app") diff --git a/assets/anim/error.json b/assets/anim/error.json new file mode 100644 index 0000000..6bd95b9 --- /dev/null +++ b/assets/anim/error.json @@ -0,0 +1 @@ +{"nm":"Main Scene","ddd":0,"h":1200,"w":1200,"meta":{"g":"@lottiefiles/creator 1.46.1"},"layers":[{"ty":4,"nm":"Layer 2","sr":1,"st":0,"op":130,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[-274,234,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[314,839,0],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[326,839,0],"t":15},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[326,839,0],"t":20},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[326,839,0],"t":80},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[326,839,0],"t":91},{"s":[314,839,0],"t":100}],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[17],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":1},"s":[-21],"t":15},{"o":{"x":0.167,"y":0},"i":{"x":0.833,"y":1},"s":[-11],"t":20},{"o":{"x":0.167,"y":0},"i":{"x":0.667,"y":1},"s":[-11],"t":80},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[-21],"t":91},{"s":[17],"t":100}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":2,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[4.586,-3.25],[62.789,88.617],[-4.586,3.25],[-62.789,-88.617]],"o":[[-4.586,3.25],[-62.789,-88.617],[4.586,-3.25],[62.789,88.617]],"v":[[169.344,65.194],[8.747,-150.147],[-102.42,-316.472],[20.512,-159.004]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[281.289,45.92],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0.004,0.9372549019607843,0.9568627450980393,1,0.504,0.9568627450980393,0.9686274509803922,1,1,1,1,1,0.004,0.21,0.504,0.52,1,0.27],"ix":9}},"t":2,"a":{"a":0,"k":0,"ix":8},"h":{"a":0,"k":0,"ix":7},"s":{"a":0,"k":[160.851,-124.073],"ix":5},"r":1,"o":{"a":0,"k":50,"ix":10}},{"ty":"tr","a":{"a":0,"k":[33.46199798583979,-125.63899230957031],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[33.46199798583979,-125.63899230957031],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 3","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[133.057,-8.913],[-198.831,95.234],[-197.466,11.653],[84.183,-76.728]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.9686,0.9725,0.9765],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 4","ix":3,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[19.826,-166.017],[-195.662,-98.397],[-194.297,-181.978],[-29.047,-233.833]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.9686,0.9725,0.9765],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 5","ix":4,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[12.717,-17.874],[29.925,-13.292],[48.218,-16.591],[66.945,-14.638],[0,0],[2.743,8.742],[0,0],[-8.742,2.743],[0,0],[-2.743,-8.742],[0,0]],"o":[[0,0],[-25.281,11.229],[-35.02,12.05],[-67.866,14.84],[-14.228,-12.346],[0,0],[-2.743,-8.742],[0,0],[8.742,-2.743],[0,0],[2.743,8.742]],"v":[[271.661,97.892],[173.478,149.96],[48.094,196.401],[-101.344,237.839],[-263.195,269.353],[-281.046,235.631],[-281.046,235.631],[-270.184,214.836],[259.958,48.476],[280.753,59.338],[280.753,59.338]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","c":{"a":0,"k":[0.8706,0.3216,0.298]},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0.2967071533201988,158.53305053710932],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0.2967071533201988,158.53305053710932],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 6","ix":5,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[-7.545,2.367],[0,0],[-4.617,-6.409],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0.127,-7.898],[0,0],[7.545,-2.367],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[190.512,70.795],[-200.445,193.478],[-198.829,95.239],[-197.836,34.101],[-197.464,11.658],[-195.66,-98.392],[-194.295,-181.973],[-192.623,-283.875],[-179.781,-301.07],[-109.003,-323.281],[-88.639,-316.505],[-29.046,-233.829],[19.828,-166.013],[84.185,-76.724],[97.312,-58.517],[133.058,-8.908]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","c":{"a":0,"k":[0.8706,0.3216,0.298]},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[-4.9665069580078125,-65.31124877929693],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-4.9665069580078125,-65.31124877929693],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"mask","sr":1,"st":0,"op":130,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"td":1,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[600,600,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[-36.641,-4.311],[-80,0],[-55.359,7.689]],"o":[[0,0],[0,0],[0,0],[0,0],[25.5,3],[55.891,0],[54,-7.5]],"v":[[272,-188],[282,158],[-282,158],[-281.5,-189],[-177,-155],[17,-145],[184,-158]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[4,442],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":0,"nm":"Creature","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"tt":2,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[600,600,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[600,730,0],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[600,566,0],"t":9},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[600,600,0],"t":20},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[600,600,0],"t":80},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[600,566,0],"t":85},{"s":[600,730,0],"t":100}],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"w":1200,"h":1200,"refId":"comp_0_332d3c06-a209-499e-9dfc-aa05a140aa13","ind":3,"tp":2},{"ty":4,"nm":"Layer 10","sr":1,"st":0,"op":130,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[-1.833,259.407,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[91.095,91.095,100],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":1},"s":[119.095,119.095,100],"t":15},{"o":{"x":0.167,"y":0},"i":{"x":0.833,"y":1},"s":[119.095,119.095,100],"t":20},{"o":{"x":0.167,"y":0},"i":{"x":0.667,"y":1},"s":[119.095,119.095,100],"t":80},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[119.095,119.095,100],"t":91},{"s":[91.095,91.095,100],"t":100}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[598,866,0],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[655,866,0],"t":15},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[655,866,0],"t":20},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[655,866,0],"t":80},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[655,866,0],"t":91},{"s":[598,866,0],"t":100}],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":26,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-17.403],[89.265,-7.376],[44.738,0],[37.326,3.096],[0,17.403],[-89.265,7.376],[-44.738,0],[-37.326,-3.096]],"o":[[0,17.403],[-37.326,3.096],[-44.738,0],[-89.265,-7.376],[0,-17.403],[37.326,-3.096],[44.738,0],[89.265,7.376]],"v":[[274.724,252.177],[124.304,292.037],[0,296.868],[-124.304,292.037],[-274.724,252.177],[-124.304,212.306],[0,207.475],[124.304,212.306]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[0,169.35],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0,0.18823529411764706,0.18823529411764706,0.18823529411764706,0.535,0.38823529411764707,0.38823529411764707,0.38823529411764707,0.996,0.5882352941176471,0.5882352941176471,0.5882352941176471],"ix":9}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[0,305],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":1,"hd":false,"mn":"ADBE Vector Group","nm":"Group 2","ix":2,"cix":2,"it":[{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Layer 5","sr":1,"st":0,"op":130,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[1,258,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[601,858,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-17.403],[89.265,-7.376],[44.738,0],[37.326,3.096],[0,17.403],[-89.265,7.376],[-44.738,0],[-37.326,-3.096]],"o":[[0,17.403],[-37.326,3.096],[-44.738,0],[-89.265,-7.376],[0,-17.403],[37.326,-3.096],[44.738,0],[89.265,7.376]],"v":[[274.724,252.177],[124.304,292.037],[0,296.868],[-124.304,292.037],[-274.724,252.177],[-124.304,212.306],[0,207.475],[124.304,212.306]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[0,169.35],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0.004,0.1411764705882353,0.1607843137254902,0.20392156862745098,0.504,0.16470588235294117,0.1803921568627451,0.22745098039215686,1,0.1843137254901961,0.20392156862745098,0.25098039215686274],"ix":9}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[0,305],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5}],"v":"5.7.0","fr":30,"op":130,"ip":0,"assets":[{"nm":"Scene","id":"comp_0_332d3c06-a209-499e-9dfc-aa05a140aa13","layers":[{"ty":0,"nm":"Eyelids_01","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"td":1,"ao":0,"ks":{"a":{"a":0,"k":[104,51.5,0],"ix":1},"s":{"a":0,"k":[110.68,110.68,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[608,776.25,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"w":208,"h":103,"refId":"comp_1_1948dd07-9d2c-4edc-bd2c-fabe7777f75a","ind":1},{"ty":4,"nm":"Layer 3","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"tt":1,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[600,600,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-4.411],[4.411,0],[0,4.411],[-4.411,0]],"o":[[0,4.411],[-4.411,0],[0,-4.411],[4.411,0]],"v":[[-45.792,186.953],[-53.778,194.939],[-61.764,186.953],[-53.778,178.967]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[-46.028,186],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0.004,0.1411764705882353,0.1607843137254902,0.20392156862745098,0.504,0.16470588235294117,0.1803921568627451,0.22745098039215686,1,0.1843137254901961,0.20392156862745098,0.25098039215686274],"ix":9}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[-62,186],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"EYE_01","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-15.745],[15.745,0],[0,15.745],[-15.745,0]],"o":[[0,15.745],[-15.745,0],[0,-15.745],[15.745,0]],"v":[[-25.27,178.967],[-53.778,207.475],[-82.286,178.967],[-53.778,150.459]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[-9.124,171],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0,0.9215686274509803,0.9215686274509803,0.9215686274509803,0.833,0.7764705882352941,0.7843137254901961,0.8117647058823529,1,0.6352941176470588,0.6509803921568628,0.7019607843137254],"ix":9}},"t":2,"a":{"a":0,"k":0,"ix":8},"h":{"a":0,"k":0,"ix":7},"s":{"a":0,"k":[-51,171],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 3","ix":3,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-4.411],[4.411,0],[0,4.411],[-4.411,0]],"o":[[0,4.411],[-4.411,0],[0,-4.411],[4.411,0]],"v":[[61.764,182.708],[53.778,190.694],[45.792,182.708],[53.778,174.722]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[60.972,182],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0.004,0.1411764705882353,0.1607843137254902,0.20392156862745098,0.504,0.16470588235294117,0.1803921568627451,0.22745098039215686,1,0.1843137254901961,0.20392156862745098,0.25098039215686274],"ix":9}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[45,182],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"EYE_02","ix":4,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-15.745],[15.745,0],[0,15.745],[-15.745,0]],"o":[[0,15.745],[-15.745,0],[0,-15.745],[15.745,0]],"v":[[82.286,178.967],[53.778,207.475],[25.27,178.967],[53.778,150.459]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[97.876,171],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0,0.9215686274509803,0.9215686274509803,0.9215686274509803,0.833,0.7764705882352941,0.7843137254901961,0.8117647058823529,1,0.6352941176470588,0.6509803921568628,0.7019607843137254],"ix":9}},"t":2,"a":{"a":0,"k":0,"ix":8},"h":{"a":0,"k":0,"ix":7},"s":{"a":0,"k":[56,171],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2,"tp":1},{"ty":4,"nm":"Layer 4","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[600,600,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-34.336],[0,0],[44.738,0],[37.327,3.096],[0,0],[-68.649,0],[-22.492,-22.492]],"o":[[0,0],[-37.327,3.096],[-44.738,0],[0,0],[0,-68.66],[34.324,0],[22.504,22.492]],"v":[[124.304,149.333],[120.806,350.947],[0,360.868],[-124.216,352.037],[-124.304,149.333],[0,25.029],[87.892,61.429]]},"ix":2}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":0,"k":[132.072,70.816],"ix":6},"g":{"p":3,"k":{"a":0,"k":[0.004,0.1411764705882353,0.1607843137254902,0.20392156862745098,0.504,0.16470588235294117,0.1803921568627451,0.22745098039215686,1,0.1843137254901961,0.20392156862745098,0.25098039215686274],"ix":9}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[-92,277],"ix":5},"r":1,"o":{"a":0,"k":100,"ix":10}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3}]},{"nm":"Scene_1","id":"comp_1_1948dd07-9d2c-4edc-bd2c-fabe7777f75a","layers":[{"ty":4,"nm":"Shape Layer 2","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[-54.25,180,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100,100],"t":26},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":32.285},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":38.571},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100,100],"t":44.857},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100,100],"t":49},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":55.286},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":61.572},{"s":[100,100,100],"t":67.857421875}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[145.75,54,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[-14.221,0],[0,-14.221],[14.221,0],[0,14.221]],"o":[[14.221,0],[0,14.221],[-14.221,0],[0,-14.221]],"v":[[0,-25.75],[25.75,0],[0,25.75],[-25.75,0]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[114.583,114.583],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-54.25,180],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[-54.25,180,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100,100],"t":26},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":32.285},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":38.571},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100,100],"t":44.857},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100,100],"t":49},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":55.286},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,0,100],"t":61.572},{"s":[100,100,100],"t":67.857421875}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[48.25,54,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[-14.221,0],[0,-14.221],[14.221,0],[0,14.221]],"o":[[14.221,0],[0,14.221],[-14.221,0],[0,-14.221]],"v":[[0,-25.75],[25.75,0],[0,25.75],[-25.75,0]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[114.583,114.583],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-54.25,180],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2}]}]} \ No newline at end of file diff --git a/assets/anim/loading.json b/assets/anim/loading.json new file mode 100644 index 0000000..03f2643 --- /dev/null +++ b/assets/anim/loading.json @@ -0,0 +1,5755 @@ +{ + "v": "5.5.7", + "meta": { + "g": "LottieFiles AE 0.1.20", + "a": "", + "k": "", + "d": "", + "tc": "" + }, + "fr": 25, + "ip": 0, + "op": 50, + "w": 1000, + "h": 1000, + "nm": "Go Up 4", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "Ball", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 2, + "s": [ + 0 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 5, + "s": [ + 100 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 25, + "s": [ + 100 + ] + }, + { + "t": 28, + "s": [ + 0 + ] + } + ], + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 0, + "s": [ + 1134, + -86, + 0 + ], + "to": [ + -78.833, + 112.333, + 0 + ], + "ti": [ + 69, + -554, + 0 + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 10, + "s": [ + 661, + 588, + 0 + ], + "to": [ + -41, + -194, + 0 + ], + "ti": [ + -13, + -191, + 0 + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 20, + "s": [ + 431, + 731, + 0 + ], + "to": [ + -453, + -205, + 0 + ], + "ti": [ + 98.5, + 6.333, + 0 + ] + }, + { + "t": 35, + "s": [ + -160, + 693, + 0 + ] + } + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 206, + -442, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 0, + "k": [ + 68, + 68 + ], + "ix": 2 + }, + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 3 + }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "t": 0, + "s": [ + 0.28, + 0.676, + 1, + 1 + ], + "h": 1 + }, + { + "t": 10, + "s": [ + 0.208, + 0.6392, + 0.992, + 1 + ], + "h": 1 + }, + { + "t": 14, + "s": [ + 0.96, + 0.9813, + 1, + 1 + ], + "h": 1 + }, + { + "t": 20, + "s": [ + 0.208, + 0.6392, + 0.992, + 1 + ], + "h": 1 + }, + { + "t": 35, + "s": [ + 0.28, + 0.676, + 1, + 1 + ], + "h": 1 + } + ], + "ix": 4 + }, + "o": { + "a": 0, + "k": 100, + "ix": 5 + }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 206, + -442 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 3, + "nm": "Ch Female", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + 430.49, + 518.068, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + -353.776, + 54.159, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 60, + 60, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 3, + "ty": 4, + "nm": "Stairs", + "parent": 2, + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + -257.327, + 448.499, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 501.5, + 768.4, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 135.823, + 135.823, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 75, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 340, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 80, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 184, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 100, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 160, + 208 + ], + [ + 4, + 208 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 125, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -16, + 338.4 + ], + [ + -172, + 338.4 + ] + ], + "c": false + } + ] + }, + { + "t": 130, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -162, + 336 + ], + [ + -166, + 336 + ] + ], + "c": false + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.28, + 0.676, + 1, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 75, + "s": [ + 0 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 80, + "s": [ + 50 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 125, + "s": [ + 50 + ] + }, + { + "t": 140, + "s": [ + 0 + ] + } + ], + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 500, + 500 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "5", + "np": 1, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 49, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 340, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 55, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 184, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 75, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 160, + 208 + ], + [ + 4, + 208 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 100, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -16, + 338.4 + ], + [ + -172, + 338.4 + ] + ], + "c": false + } + ] + }, + { + "t": 105, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -162, + 336 + ], + [ + -166, + 336 + ] + ], + "c": false + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.28, + 0.676, + 1, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 49, + "s": [ + 0 + ] + }, + { + "t": 55, + "s": [ + 50 + ] + } + ], + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 500, + 500 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "4", + "np": 1, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 25, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 340, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 30, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 184, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 49, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 160, + 208 + ], + [ + 4, + 208 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 75, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -16, + 338.4 + ], + [ + -172, + 338.4 + ] + ], + "c": false + } + ] + }, + { + "t": 80, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -162, + 336 + ], + [ + -166, + 336 + ] + ], + "c": false + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0 + ], + "y": [ + 1 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + }, + { + "t": 49, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + } + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 25, + "s": [ + 0 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 30, + "s": [ + 50 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 75, + "s": [ + 50 + ] + }, + { + "t": 88, + "s": [ + 0 + ] + } + ], + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 500, + 500 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "3", + "np": 1, + "cix": 2, + "bm": 0, + "ix": 3, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 0, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 340, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 5, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 184, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 25, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 160, + 208 + ], + [ + 4, + 208 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 49, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -16, + 338.4 + ], + [ + -172, + 338.4 + ] + ], + "c": false + } + ] + }, + { + "t": 55, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -162, + 336 + ], + [ + -166, + 336 + ] + ], + "c": false + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0 + ], + "y": [ + 1 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + }, + { + "i": { + "x": [ + 0 + ], + "y": [ + 1 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + }, + { + "t": 49, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + } + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 0, + "s": [ + 2 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 5, + "s": [ + 50 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 49, + "s": [ + 50 + ] + }, + { + "t": 62, + "s": [ + 0 + ] + } + ], + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 500, + 500 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "2", + "np": 1, + "cix": 2, + "bm": 0, + "ix": 4, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": -25, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 340, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": -20, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 340, + 64 + ], + [ + 184, + 64 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 0, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 160, + 208 + ], + [ + 4, + 208 + ] + ], + "c": false + } + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.167, + "y": 0.167 + }, + "t": 25, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -16, + 338.4 + ], + [ + -172, + 338.4 + ] + ], + "c": false + } + ] + }, + { + "t": 30, + "s": [ + { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -162, + 336 + ], + [ + -166, + 336 + ] + ], + "c": false + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0 + ], + "y": [ + 1 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + }, + { + "t": 25, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + } + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 25, + "s": [ + 50 + ] + }, + { + "t": 40, + "s": [ + 0 + ] + } + ], + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 500, + 500 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "1", + "np": 1, + "cix": 2, + "bm": 0, + "ix": 5, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 4, + "ty": 4, + "nm": "Arrow", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + 572.227, + 624.662, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 74, + 74, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 289.773, + -122.662 + ], + [ + 337.773, + -212.662 + ], + [ + 389.773, + -126.662 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.724 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 1.276 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + }, + { + "t": 49, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + } + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 40, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 70 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 2", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + -70, + 0 + ], + [ + 0, + 312 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 210, + 0 + ], + [ + 0, + -312 + ] + ], + "v": [ + [ + -533.515, + 362.835 + ], + [ + 208, + 362 + ], + [ + 385.795, + -103.615 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.724 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 1.276 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + }, + { + "t": 49, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + } + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 20, + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + -40 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 87.603, + 87.603 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 5, + "ty": 4, + "nm": "Plants R", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + 686.095, + 830.468, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + -105.912, + 311.223, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + -50, + 50, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.75, + "y": 1 + }, + "o": { + "x": 0.05, + "y": 0 + }, + "t": 0, + "s": [ + { + "i": [ + [ + 41, + -28 + ], + [ + 10, + 18 + ], + [ + 20, + -32 + ], + [ + 0, + 0 + ], + [ + -28.194, + 10.252 + ], + [ + 12, + 56 + ] + ], + "o": [ + [ + -31.031, + 21.192 + ], + [ + -10, + -18 + ], + [ + -42.36, + 67.776 + ], + [ + 0, + 0 + ], + [ + 22, + -8 + ], + [ + -10.476, + -48.89 + ] + ], + "v": [ + [ + -294, + 64 + ], + [ + -286, + 190 + ], + [ + -358, + 176 + ], + [ + -260, + 332 + ], + [ + -226, + 332 + ], + [ + -225, + 161 + ] + ], + "c": true + } + ] + }, + { + "i": { + "x": 0.75, + "y": 1 + }, + "o": { + "x": 0.05, + "y": 0 + }, + "t": 25, + "s": [ + { + "i": [ + [ + 41, + -28 + ], + [ + 9.634, + 18.198 + ], + [ + 40, + -26 + ], + [ + 0, + 0 + ], + [ + -28.194, + 10.252 + ], + [ + 12, + 56 + ] + ], + "o": [ + [ + -31.031, + 21.192 + ], + [ + -18, + -34 + ], + [ + -58.691, + 38.149 + ], + [ + 0, + 0 + ], + [ + 22, + -8 + ], + [ + -10.476, + -48.89 + ] + ], + "v": [ + [ + -256, + 62 + ], + [ + -276, + 186 + ], + [ + -330, + 132 + ], + [ + -260, + 332 + ], + [ + -226, + 332 + ], + [ + -189, + 159 + ] + ], + "c": true + } + ] + }, + { + "t": 49, + "s": [ + { + "i": [ + [ + 41, + -28 + ], + [ + 10, + 18 + ], + [ + 20, + -32 + ], + [ + 0, + 0 + ], + [ + -28.194, + 10.252 + ], + [ + 12, + 56 + ] + ], + "o": [ + [ + -31.031, + 21.192 + ], + [ + -10, + -18 + ], + [ + -42.36, + 67.776 + ], + [ + 0, + 0 + ], + [ + 22, + -8 + ], + [ + -10.476, + -48.89 + ] + ], + "v": [ + [ + -294, + 64 + ], + [ + -286, + 190 + ], + [ + -358, + 176 + ], + [ + -260, + 332 + ], + [ + -226, + 332 + ], + [ + -225, + 161 + ] + ], + "c": true + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 1.173 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0.28, + 0.676, + 1, + 1 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.827 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0, + 0.8667, + 0.702, + 1 + ] + }, + { + "t": 49, + "s": [ + 0.28, + 0.676, + 1, + 1 + ] + } + ], + "ix": 4 + }, + "o": { + "a": 0, + "k": 100, + "ix": 5 + }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 106.667, + -25.333 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 6, + "ty": 4, + "nm": "Plants L", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + 295.905, + 834.468, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + -105.912, + 311.223, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 80, + 80, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 1, + "k": [ + { + "i": { + "x": 0.75, + "y": 1 + }, + "o": { + "x": 0.05, + "y": 0 + }, + "t": 0, + "s": [ + { + "i": [ + [ + 41, + -28 + ], + [ + 10, + 18 + ], + [ + 20, + -32 + ], + [ + 0, + 0 + ], + [ + -28.194, + 10.252 + ], + [ + 12, + 56 + ] + ], + "o": [ + [ + -31.031, + 21.192 + ], + [ + -10, + -18 + ], + [ + -42.36, + 67.776 + ], + [ + 0, + 0 + ], + [ + 22, + -8 + ], + [ + -10.476, + -48.89 + ] + ], + "v": [ + [ + -294, + 64 + ], + [ + -286, + 190 + ], + [ + -358, + 176 + ], + [ + -260, + 332 + ], + [ + -226, + 332 + ], + [ + -225, + 161 + ] + ], + "c": true + } + ] + }, + { + "i": { + "x": 0.75, + "y": 1 + }, + "o": { + "x": 0.05, + "y": 0 + }, + "t": 25, + "s": [ + { + "i": [ + [ + 41, + -28 + ], + [ + 9.634, + 18.198 + ], + [ + 40, + -26 + ], + [ + 0, + 0 + ], + [ + -28.194, + 10.252 + ], + [ + 12, + 56 + ] + ], + "o": [ + [ + -31.031, + 21.192 + ], + [ + -18, + -34 + ], + [ + -58.691, + 38.149 + ], + [ + 0, + 0 + ], + [ + 22, + -8 + ], + [ + -10.476, + -48.89 + ] + ], + "v": [ + [ + -256, + 62 + ], + [ + -276, + 186 + ], + [ + -330, + 132 + ], + [ + -260, + 332 + ], + [ + -226, + 332 + ], + [ + -189, + 159 + ] + ], + "c": true + } + ] + }, + { + "t": 49, + "s": [ + { + "i": [ + [ + 41, + -28 + ], + [ + 10, + 18 + ], + [ + 20, + -32 + ], + [ + 0, + 0 + ], + [ + -28.194, + 10.252 + ], + [ + 12, + 56 + ] + ], + "o": [ + [ + -31.031, + 21.192 + ], + [ + -10, + -18 + ], + [ + -42.36, + 67.776 + ], + [ + 0, + 0 + ], + [ + 22, + -8 + ], + [ + -10.476, + -48.89 + ] + ], + "v": [ + [ + -294, + 64 + ], + [ + -286, + 190 + ], + [ + -358, + 176 + ], + [ + -260, + 332 + ], + [ + -226, + 332 + ], + [ + -225, + 161 + ] + ], + "c": true + } + ] + } + ], + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.827 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0, + 0.8667, + 0.702, + 1 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 1.173 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0.28, + 0.676, + 1, + 1 + ] + }, + { + "t": 49, + "s": [ + 0, + 0.8667, + 0.702, + 1 + ] + } + ], + "ix": 4 + }, + "o": { + "a": 0, + "k": 100, + "ix": 5 + }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 106.667, + -25.333 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 7, + "ty": 4, + "nm": "Clock", + "parent": 8, + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + 134, + -131.9, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + -2, + -95.9, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -276, + 2 + ], + [ + -236, + 2 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.851, + 0.8784, + 0.902, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 10, + "ix": 5 + }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 508, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 4", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -276, + 2 + ], + [ + -236, + 2 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.851, + 0.8784, + 0.902, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 10, + "ix": 5 + }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 3", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + -2, + 2 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + -2, + 2 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 90, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 3", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -276, + 2 + ], + [ + -236, + 2 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.851, + 0.8784, + 0.902, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 10, + "ix": 5 + }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 508, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 4", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + -276, + 2 + ], + [ + -236, + 2 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.851, + 0.8784, + 0.902, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 10, + "ix": 5 + }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 3", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + -2, + 2 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + -2, + 2 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 2", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 0, + -1 + ], + [ + 0, + -243 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.851, + 0.8784, + 0.902, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 40, + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 0, + "s": [ + 0 + ] + }, + { + "t": 49, + "s": [ + 720 + ] + } + ], + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "o": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "v": [ + [ + 0, + -1 + ], + [ + 0, + -127 + ] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 1, + 1, + 1, + 1 + ], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 60, + "ix": 5 + }, + "lc": 2, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.833 + ] + }, + "o": { + "x": [ + 0.167 + ], + "y": [ + 0.167 + ] + }, + "t": 0, + "s": [ + 0 + ] + }, + { + "t": 49, + "s": [ + 360 + ] + } + ], + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Shape 2", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + -97 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + -122 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 80, + 80 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 3, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 8, + "ty": 4, + "nm": "Ellipse BG", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.05, + "y": 0 + }, + "t": 0, + "s": [ + 364, + 536, + 0 + ], + "to": [ + 0, + -8.833, + 0 + ], + "ti": [ + 0, + 0, + 0 + ] + }, + { + "i": { + "x": 0.833, + "y": 0.833 + }, + "o": { + "x": 0.05, + "y": 0 + }, + "t": 25, + "s": [ + 364, + 483, + 0 + ], + "to": [ + 0, + 0, + 0 + ], + "ti": [ + 0, + -8.833, + 0 + ] + }, + { + "t": 49, + "s": [ + 364, + 536, + 0 + ] + } + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 0, + "k": [ + 712, + 712 + ], + "ix": 2 + }, + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 3 + }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 1.276 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 0, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + }, + { + "i": { + "x": [ + 0.833 + ], + "y": [ + 0.724 + ] + }, + "o": { + "x": [ + 0.05 + ], + "y": [ + 0 + ] + }, + "t": 25, + "s": [ + 0.6314, + 0.6784, + 0.7176, + 1 + ] + }, + { + "t": 49, + "s": [ + 0.2, + 0.64, + 1, + 1 + ] + } + ], + "ix": 4 + }, + "o": { + "a": 0, + "k": 100, + "ix": 5 + }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 136, + -36 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 80.317, + 80.317 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 9, + "ty": 4, + "nm": "Bottom Shadow", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 10, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [ + 524, + 832.149, + 0 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 381.25, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 153.865, + -608.36, + 100 + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { + "a": 0, + "k": [ + 400, + 12.5 + ], + "ix": 2 + }, + "p": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 3 + }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [ + 0.1804, + 0.0118, + 0.898, + 1 + ], + "ix": 4 + }, + "o": { + "a": 0, + "k": 100, + "ix": 5 + }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [ + 0, + 381.25 + ], + "ix": 2 + }, + "a": { + "a": 0, + "k": [ + 0, + 0 + ], + "ix": 1 + }, + "s": { + "a": 0, + "k": [ + 100, + 100 + ], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 50, + "st": 0, + "bm": 0 + } + ], + "markers": [] +} \ No newline at end of file diff --git a/assets/icons/3d_cube_square.svg b/assets/icons/3d_cube_square.svg new file mode 100644 index 0000000..4eb620a --- /dev/null +++ b/assets/icons/3d_cube_square.svg @@ -0,0 +1,4 @@ + + + diff --git a/assets/icons/add.svg b/assets/icons/add.svg new file mode 100644 index 0000000..2d74577 --- /dev/null +++ b/assets/icons/add.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/app_bar_inspection.svg b/assets/icons/app_bar_inspection.svg new file mode 100644 index 0000000..ea72d5f --- /dev/null +++ b/assets/icons/app_bar_inspection.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/arrow_left.svg b/assets/icons/arrow_left.svg new file mode 100644 index 0000000..2db56f6 --- /dev/null +++ b/assets/icons/arrow_left.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/arrow_right.svg b/assets/icons/arrow_right.svg new file mode 100644 index 0000000..dfc8100 --- /dev/null +++ b/assets/icons/arrow_right.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/bg_auth.svg b/assets/icons/bg_auth.svg new file mode 100644 index 0000000..3863899 --- /dev/null +++ b/assets/icons/bg_auth.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/bg_header_user_profile.svg b/assets/icons/bg_header_user_profile.svg new file mode 100644 index 0000000..3fdb2f5 --- /dev/null +++ b/assets/icons/bg_header_user_profile.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/buy.svg b/assets/icons/buy.svg new file mode 100644 index 0000000..ce540e4 --- /dev/null +++ b/assets/icons/buy.svg @@ -0,0 +1,6 @@ + + + + diff --git a/assets/icons/calendar.svg b/assets/icons/calendar.svg new file mode 100644 index 0000000..2b55ed8 --- /dev/null +++ b/assets/icons/calendar.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/assets/icons/calendar_search.svg b/assets/icons/calendar_search.svg new file mode 100644 index 0000000..59ed538 --- /dev/null +++ b/assets/icons/calendar_search.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/calendar_search_outline.svg b/assets/icons/calendar_search_outline.svg new file mode 100644 index 0000000..854cf73 --- /dev/null +++ b/assets/icons/calendar_search_outline.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/assets/icons/call.svg b/assets/icons/call.svg new file mode 100644 index 0000000..e7d1c11 --- /dev/null +++ b/assets/icons/call.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/check.svg b/assets/icons/check.svg new file mode 100644 index 0000000..d314ce4 --- /dev/null +++ b/assets/icons/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/check_square.svg b/assets/icons/check_square.svg new file mode 100644 index 0000000..316aeb2 --- /dev/null +++ b/assets/icons/check_square.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/chicken.svg b/assets/icons/chicken.svg new file mode 100644 index 0000000..dbf0757 --- /dev/null +++ b/assets/icons/chicken.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/chicken_map_marker.svg b/assets/icons/chicken_map_marker.svg new file mode 100644 index 0000000..2099322 --- /dev/null +++ b/assets/icons/chicken_map_marker.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/clipboard_eye.svg b/assets/icons/clipboard_eye.svg new file mode 100644 index 0000000..99bc1ad --- /dev/null +++ b/assets/icons/clipboard_eye.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/assets/icons/clipboard_task.svg b/assets/icons/clipboard_task.svg new file mode 100644 index 0000000..b0d2d3e --- /dev/null +++ b/assets/icons/clipboard_task.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/clock.svg b/assets/icons/clock.svg new file mode 100644 index 0000000..11bff2c --- /dev/null +++ b/assets/icons/clock.svg @@ -0,0 +1,6 @@ + + + + diff --git a/assets/icons/close_circle.svg b/assets/icons/close_circle.svg new file mode 100644 index 0000000..ed5da34 --- /dev/null +++ b/assets/icons/close_circle.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/assets/icons/close_square.svg b/assets/icons/close_square.svg new file mode 100644 index 0000000..3f7c554 --- /dev/null +++ b/assets/icons/close_square.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/convert_cube.svg b/assets/icons/convert_cube.svg new file mode 100644 index 0000000..5ada319 --- /dev/null +++ b/assets/icons/convert_cube.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/cow.svg b/assets/icons/cow.svg new file mode 100644 index 0000000..ad8320d --- /dev/null +++ b/assets/icons/cow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/cube.svg b/assets/icons/cube.svg new file mode 100644 index 0000000..c44cba3 --- /dev/null +++ b/assets/icons/cube.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/cube_bottom_rotation.svg b/assets/icons/cube_bottom_rotation.svg new file mode 100644 index 0000000..94089f8 --- /dev/null +++ b/assets/icons/cube_bottom_rotation.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/assets/icons/cube_card.svg b/assets/icons/cube_card.svg new file mode 100644 index 0000000..d20d965 --- /dev/null +++ b/assets/icons/cube_card.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/cube_rotate.svg b/assets/icons/cube_rotate.svg new file mode 100644 index 0000000..e5280c5 --- /dev/null +++ b/assets/icons/cube_rotate.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/cube_scan.svg b/assets/icons/cube_scan.svg new file mode 100644 index 0000000..5d088f4 --- /dev/null +++ b/assets/icons/cube_scan.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/cube_search.svg b/assets/icons/cube_search.svg new file mode 100644 index 0000000..e9308ea --- /dev/null +++ b/assets/icons/cube_search.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/cube_top_rotation.svg b/assets/icons/cube_top_rotation.svg new file mode 100644 index 0000000..828ec46 --- /dev/null +++ b/assets/icons/cube_top_rotation.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/assets/icons/cube_watting.svg b/assets/icons/cube_watting.svg new file mode 100644 index 0000000..29cbdc8 --- /dev/null +++ b/assets/icons/cube_watting.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/diagram.svg b/assets/icons/diagram.svg new file mode 100644 index 0000000..7e505bd --- /dev/null +++ b/assets/icons/diagram.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/download.svg b/assets/icons/download.svg new file mode 100644 index 0000000..0e8dd4d --- /dev/null +++ b/assets/icons/download.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/edit.svg b/assets/icons/edit.svg new file mode 100644 index 0000000..632a118 --- /dev/null +++ b/assets/icons/edit.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/icons/empty.svg b/assets/icons/empty.svg new file mode 100644 index 0000000..9d67b54 --- /dev/null +++ b/assets/icons/empty.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/excel_download.svg b/assets/icons/excel_download.svg new file mode 100644 index 0000000..b2597c5 --- /dev/null +++ b/assets/icons/excel_download.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/filter.svg b/assets/icons/filter.svg new file mode 100644 index 0000000..25636f2 --- /dev/null +++ b/assets/icons/filter.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/filter_outline.svg b/assets/icons/filter_outline.svg new file mode 100644 index 0000000..cd9d913 --- /dev/null +++ b/assets/icons/filter_outline.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/gps.svg b/assets/icons/gps.svg new file mode 100644 index 0000000..de896a0 --- /dev/null +++ b/assets/icons/gps.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/home.svg b/assets/icons/home.svg new file mode 100644 index 0000000..a2a952c --- /dev/null +++ b/assets/icons/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/hot_chicken.svg b/assets/icons/hot_chicken.svg new file mode 100644 index 0000000..17b35aa --- /dev/null +++ b/assets/icons/hot_chicken.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/information.svg b/assets/icons/information.svg new file mode 100644 index 0000000..1ae3840 --- /dev/null +++ b/assets/icons/information.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/inside.svg b/assets/icons/inside.svg new file mode 100644 index 0000000..88704db --- /dev/null +++ b/assets/icons/inside.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/inspection.svg b/assets/icons/inspection.svg new file mode 100644 index 0000000..3e49ae8 --- /dev/null +++ b/assets/icons/inspection.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/key.svg b/assets/icons/key.svg new file mode 100644 index 0000000..fe524b4 --- /dev/null +++ b/assets/icons/key.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/liveStock.svg b/assets/icons/liveStock.svg new file mode 100644 index 0000000..24b6c5e --- /dev/null +++ b/assets/icons/liveStock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/lock.svg b/assets/icons/lock.svg new file mode 100644 index 0000000..4a64667 --- /dev/null +++ b/assets/icons/lock.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/logout.svg b/assets/icons/logout.svg new file mode 100644 index 0000000..5fdbcf7 --- /dev/null +++ b/assets/icons/logout.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/map.svg b/assets/icons/map.svg new file mode 100644 index 0000000..1d3b6f5 --- /dev/null +++ b/assets/icons/map.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/map_marker.svg b/assets/icons/map_marker.svg new file mode 100644 index 0000000..bc4a843 --- /dev/null +++ b/assets/icons/map_marker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/message_add.svg b/assets/icons/message_add.svg new file mode 100644 index 0000000..9d83a3f --- /dev/null +++ b/assets/icons/message_add.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/outside.svg b/assets/icons/outside.svg new file mode 100644 index 0000000..72b6978 --- /dev/null +++ b/assets/icons/outside.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/pdf_download.svg b/assets/icons/pdf_download.svg new file mode 100644 index 0000000..fb17107 --- /dev/null +++ b/assets/icons/pdf_download.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/people.svg b/assets/icons/people.svg new file mode 100644 index 0000000..9c1edd3 --- /dev/null +++ b/assets/icons/people.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/assets/icons/picture_frame.svg b/assets/icons/picture_frame.svg new file mode 100644 index 0000000..1aa2bc8 --- /dev/null +++ b/assets/icons/picture_frame.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/place_holder.svg b/assets/icons/place_holder.svg new file mode 100644 index 0000000..5a0c1d4 --- /dev/null +++ b/assets/icons/place_holder.svg @@ -0,0 +1,33 @@ +ث + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/profile2.svg b/assets/icons/profile2.svg new file mode 100644 index 0000000..a164e84 --- /dev/null +++ b/assets/icons/profile2.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/assets/icons/profile2_outline.svg b/assets/icons/profile2_outline.svg new file mode 100644 index 0000000..87c10f9 --- /dev/null +++ b/assets/icons/profile2_outline.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/profile_circle.svg b/assets/icons/profile_circle.svg new file mode 100644 index 0000000..0b32445 --- /dev/null +++ b/assets/icons/profile_circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/profile_user.svg b/assets/icons/profile_user.svg new file mode 100644 index 0000000..c9218f9 --- /dev/null +++ b/assets/icons/profile_user.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/receipt_discount.svg b/assets/icons/receipt_discount.svg new file mode 100644 index 0000000..1f41ab6 --- /dev/null +++ b/assets/icons/receipt_discount.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/sale.svg b/assets/icons/sale.svg new file mode 100644 index 0000000..9b2775c --- /dev/null +++ b/assets/icons/sale.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/scan.svg b/assets/icons/scan.svg new file mode 100644 index 0000000..071b59b --- /dev/null +++ b/assets/icons/scan.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/scan_barcode.svg b/assets/icons/scan_barcode.svg new file mode 100644 index 0000000..cd387e0 --- /dev/null +++ b/assets/icons/scan_barcode.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/search.svg b/assets/icons/search.svg new file mode 100644 index 0000000..e12b6da --- /dev/null +++ b/assets/icons/search.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/security_time.svg b/assets/icons/security_time.svg new file mode 100644 index 0000000..1fab0fe --- /dev/null +++ b/assets/icons/security_time.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/setting.svg b/assets/icons/setting.svg new file mode 100644 index 0000000..622cf10 --- /dev/null +++ b/assets/icons/setting.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/shop.svg b/assets/icons/shop.svg new file mode 100644 index 0000000..1c5dde5 --- /dev/null +++ b/assets/icons/shop.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/shopping_basket.svg b/assets/icons/shopping_basket.svg new file mode 100644 index 0000000..76d34a5 --- /dev/null +++ b/assets/icons/shopping_basket.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/assets/icons/tag_label.svg b/assets/icons/tag_label.svg new file mode 100644 index 0000000..7db9b38 --- /dev/null +++ b/assets/icons/tag_label.svg @@ -0,0 +1,4 @@ + + + diff --git a/assets/icons/tag_user.svg b/assets/icons/tag_user.svg new file mode 100644 index 0000000..a7e464a --- /dev/null +++ b/assets/icons/tag_user.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/task.svg b/assets/icons/task.svg new file mode 100644 index 0000000..a9595ba --- /dev/null +++ b/assets/icons/task.svg @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/assets/icons/timer.svg b/assets/icons/timer.svg new file mode 100644 index 0000000..cffe360 --- /dev/null +++ b/assets/icons/timer.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/trash.svg b/assets/icons/trash.svg new file mode 100644 index 0000000..6c9b5a1 --- /dev/null +++ b/assets/icons/trash.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/icons/truck.svg b/assets/icons/truck.svg new file mode 100644 index 0000000..9a40d42 --- /dev/null +++ b/assets/icons/truck.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/truck_fast.svg b/assets/icons/truck_fast.svg new file mode 100644 index 0000000..7c05346 --- /dev/null +++ b/assets/icons/truck_fast.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/truck_fast_outlined.svg b/assets/icons/truck_fast_outlined.svg new file mode 100644 index 0000000..bb3b4c4 --- /dev/null +++ b/assets/icons/truck_fast_outlined.svg @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/assets/icons/user.svg b/assets/icons/user.svg new file mode 100644 index 0000000..b60b7b7 --- /dev/null +++ b/assets/icons/user.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/user_raduis.svg b/assets/icons/user_raduis.svg new file mode 100644 index 0000000..d52d9b2 --- /dev/null +++ b/assets/icons/user_raduis.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/user_square.svg b/assets/icons/user_square.svg new file mode 100644 index 0000000..c2de783 --- /dev/null +++ b/assets/icons/user_square.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/virtual.svg b/assets/icons/virtual.svg new file mode 100644 index 0000000..b3563c1 --- /dev/null +++ b/assets/icons/virtual.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/whare_house.svg b/assets/icons/whare_house.svg new file mode 100644 index 0000000..5033d61 --- /dev/null +++ b/assets/icons/whare_house.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/chicken.png b/assets/images/chicken.png new file mode 100644 index 0000000..20f7ab3 Binary files /dev/null and b/assets/images/chicken.png differ diff --git a/assets/images/inner_splash.webp b/assets/images/inner_splash.webp new file mode 100644 index 0000000..2744801 Binary files /dev/null and b/assets/images/inner_splash.webp differ diff --git a/assets/images/outter_splash.webp b/assets/images/outter_splash.webp new file mode 100644 index 0000000..214227c Binary files /dev/null and b/assets/images/outter_splash.webp differ diff --git a/assets/images/place_holder.png b/assets/images/place_holder.png new file mode 100644 index 0000000..48c509e Binary files /dev/null and b/assets/images/place_holder.png differ diff --git a/assets/logos/final_logo.png b/assets/logos/final_logo.png new file mode 100644 index 0000000..9884195 Binary files /dev/null and b/assets/logos/final_logo.png differ diff --git a/assets/vec/3d_cube_square.svg.vec b/assets/vec/3d_cube_square.svg.vec new file mode 100644 index 0000000..a5b5704 Binary files /dev/null and b/assets/vec/3d_cube_square.svg.vec differ diff --git a/assets/vec/add.svg.vec b/assets/vec/add.svg.vec new file mode 100644 index 0000000..0e0727a Binary files /dev/null and b/assets/vec/add.svg.vec differ diff --git a/assets/vec/app_bar_inspection.svg.vec b/assets/vec/app_bar_inspection.svg.vec new file mode 100644 index 0000000..eaa08e3 Binary files /dev/null and b/assets/vec/app_bar_inspection.svg.vec differ diff --git a/assets/vec/arrow_left.svg.vec b/assets/vec/arrow_left.svg.vec new file mode 100644 index 0000000..010f8fd Binary files /dev/null and b/assets/vec/arrow_left.svg.vec differ diff --git a/assets/vec/arrow_right.svg.vec b/assets/vec/arrow_right.svg.vec new file mode 100644 index 0000000..432f905 Binary files /dev/null and b/assets/vec/arrow_right.svg.vec differ diff --git a/assets/vec/bg_auth.svg.vec b/assets/vec/bg_auth.svg.vec new file mode 100644 index 0000000..a5c1c29 Binary files /dev/null and b/assets/vec/bg_auth.svg.vec differ diff --git a/assets/vec/bg_header_user_profile.svg.vec b/assets/vec/bg_header_user_profile.svg.vec new file mode 100644 index 0000000..c58f58c Binary files /dev/null and b/assets/vec/bg_header_user_profile.svg.vec differ diff --git a/assets/vec/buy.svg.vec b/assets/vec/buy.svg.vec new file mode 100644 index 0000000..9b7f886 Binary files /dev/null and b/assets/vec/buy.svg.vec differ diff --git a/assets/vec/calendar.svg.vec b/assets/vec/calendar.svg.vec new file mode 100644 index 0000000..17a6d46 Binary files /dev/null and b/assets/vec/calendar.svg.vec differ diff --git a/assets/vec/calendar_search.svg.vec b/assets/vec/calendar_search.svg.vec new file mode 100644 index 0000000..199ea1a Binary files /dev/null and b/assets/vec/calendar_search.svg.vec differ diff --git a/assets/vec/calendar_search_outline.svg.vec b/assets/vec/calendar_search_outline.svg.vec new file mode 100644 index 0000000..63a41df Binary files /dev/null and b/assets/vec/calendar_search_outline.svg.vec differ diff --git a/assets/vec/call.svg.vec b/assets/vec/call.svg.vec new file mode 100644 index 0000000..d9b7763 Binary files /dev/null and b/assets/vec/call.svg.vec differ diff --git a/assets/vec/check.svg.vec b/assets/vec/check.svg.vec new file mode 100644 index 0000000..b190008 Binary files /dev/null and b/assets/vec/check.svg.vec differ diff --git a/assets/vec/check_square.svg.vec b/assets/vec/check_square.svg.vec new file mode 100644 index 0000000..fd0c6e7 Binary files /dev/null and b/assets/vec/check_square.svg.vec differ diff --git a/assets/vec/chicken.svg.vec b/assets/vec/chicken.svg.vec new file mode 100644 index 0000000..3424ea7 Binary files /dev/null and b/assets/vec/chicken.svg.vec differ diff --git a/assets/vec/chicken_map_marker.svg.vec b/assets/vec/chicken_map_marker.svg.vec new file mode 100644 index 0000000..4ea6f27 Binary files /dev/null and b/assets/vec/chicken_map_marker.svg.vec differ diff --git a/assets/vec/clipboard_eye.svg.vec b/assets/vec/clipboard_eye.svg.vec new file mode 100644 index 0000000..e0db39f Binary files /dev/null and b/assets/vec/clipboard_eye.svg.vec differ diff --git a/assets/vec/clipboard_task.svg.vec b/assets/vec/clipboard_task.svg.vec new file mode 100644 index 0000000..5b272b6 Binary files /dev/null and b/assets/vec/clipboard_task.svg.vec differ diff --git a/assets/vec/clock.svg.vec b/assets/vec/clock.svg.vec new file mode 100644 index 0000000..a78d0a5 Binary files /dev/null and b/assets/vec/clock.svg.vec differ diff --git a/assets/vec/close_circle.svg.vec b/assets/vec/close_circle.svg.vec new file mode 100644 index 0000000..59e1d5b Binary files /dev/null and b/assets/vec/close_circle.svg.vec differ diff --git a/assets/vec/close_square.svg.vec b/assets/vec/close_square.svg.vec new file mode 100644 index 0000000..57db0a0 Binary files /dev/null and b/assets/vec/close_square.svg.vec differ diff --git a/assets/vec/convert_cube.svg.vec b/assets/vec/convert_cube.svg.vec new file mode 100644 index 0000000..bd3185f Binary files /dev/null and b/assets/vec/convert_cube.svg.vec differ diff --git a/assets/vec/cow.svg.vec b/assets/vec/cow.svg.vec new file mode 100644 index 0000000..a459c94 Binary files /dev/null and b/assets/vec/cow.svg.vec differ diff --git a/assets/vec/cube.svg.vec b/assets/vec/cube.svg.vec new file mode 100644 index 0000000..a5b5704 Binary files /dev/null and b/assets/vec/cube.svg.vec differ diff --git a/assets/vec/cube_bottom_rotation.svg.vec b/assets/vec/cube_bottom_rotation.svg.vec new file mode 100644 index 0000000..17ce852 Binary files /dev/null and b/assets/vec/cube_bottom_rotation.svg.vec differ diff --git a/assets/vec/cube_card.svg.vec b/assets/vec/cube_card.svg.vec new file mode 100644 index 0000000..786a6e3 Binary files /dev/null and b/assets/vec/cube_card.svg.vec differ diff --git a/assets/vec/cube_rotate.svg.vec b/assets/vec/cube_rotate.svg.vec new file mode 100644 index 0000000..7e7db01 Binary files /dev/null and b/assets/vec/cube_rotate.svg.vec differ diff --git a/assets/vec/cube_scan.svg.vec b/assets/vec/cube_scan.svg.vec new file mode 100644 index 0000000..4c5c41d Binary files /dev/null and b/assets/vec/cube_scan.svg.vec differ diff --git a/assets/vec/cube_search.svg.vec b/assets/vec/cube_search.svg.vec new file mode 100644 index 0000000..da0dc56 Binary files /dev/null and b/assets/vec/cube_search.svg.vec differ diff --git a/assets/vec/cube_top_rotation.svg.vec b/assets/vec/cube_top_rotation.svg.vec new file mode 100644 index 0000000..aed0a34 Binary files /dev/null and b/assets/vec/cube_top_rotation.svg.vec differ diff --git a/assets/vec/cube_watting.svg.vec b/assets/vec/cube_watting.svg.vec new file mode 100644 index 0000000..8f06121 Binary files /dev/null and b/assets/vec/cube_watting.svg.vec differ diff --git a/assets/vec/diagram.svg.vec b/assets/vec/diagram.svg.vec new file mode 100644 index 0000000..74ab003 Binary files /dev/null and b/assets/vec/diagram.svg.vec differ diff --git a/assets/vec/download.svg.vec b/assets/vec/download.svg.vec new file mode 100644 index 0000000..cf531fa Binary files /dev/null and b/assets/vec/download.svg.vec differ diff --git a/assets/vec/edit.svg.vec b/assets/vec/edit.svg.vec new file mode 100644 index 0000000..e22f172 Binary files /dev/null and b/assets/vec/edit.svg.vec differ diff --git a/assets/vec/empty.svg.vec b/assets/vec/empty.svg.vec new file mode 100644 index 0000000..b60778f Binary files /dev/null and b/assets/vec/empty.svg.vec differ diff --git a/assets/vec/excel_download.svg.vec b/assets/vec/excel_download.svg.vec new file mode 100644 index 0000000..9d5ec2e Binary files /dev/null and b/assets/vec/excel_download.svg.vec differ diff --git a/assets/vec/filter.svg.vec b/assets/vec/filter.svg.vec new file mode 100644 index 0000000..6d6d5ba Binary files /dev/null and b/assets/vec/filter.svg.vec differ diff --git a/assets/vec/filter_outline.svg.vec b/assets/vec/filter_outline.svg.vec new file mode 100644 index 0000000..0c4ac2d Binary files /dev/null and b/assets/vec/filter_outline.svg.vec differ diff --git a/assets/vec/gps.svg.vec b/assets/vec/gps.svg.vec new file mode 100644 index 0000000..4508f5d Binary files /dev/null and b/assets/vec/gps.svg.vec differ diff --git a/assets/vec/home.svg.vec b/assets/vec/home.svg.vec new file mode 100644 index 0000000..7918796 Binary files /dev/null and b/assets/vec/home.svg.vec differ diff --git a/assets/vec/hot_chicken.svg.vec b/assets/vec/hot_chicken.svg.vec new file mode 100644 index 0000000..71668a9 Binary files /dev/null and b/assets/vec/hot_chicken.svg.vec differ diff --git a/assets/vec/information.svg.vec b/assets/vec/information.svg.vec new file mode 100644 index 0000000..80fe416 Binary files /dev/null and b/assets/vec/information.svg.vec differ diff --git a/assets/vec/inside.svg.vec b/assets/vec/inside.svg.vec new file mode 100644 index 0000000..b43a512 Binary files /dev/null and b/assets/vec/inside.svg.vec differ diff --git a/assets/vec/inspection.svg.vec b/assets/vec/inspection.svg.vec new file mode 100644 index 0000000..ed9d937 Binary files /dev/null and b/assets/vec/inspection.svg.vec differ diff --git a/assets/vec/key.svg.vec b/assets/vec/key.svg.vec new file mode 100644 index 0000000..3252fd9 Binary files /dev/null and b/assets/vec/key.svg.vec differ diff --git a/assets/vec/liveStock.svg.vec b/assets/vec/liveStock.svg.vec new file mode 100644 index 0000000..469f5a1 Binary files /dev/null and b/assets/vec/liveStock.svg.vec differ diff --git a/assets/vec/lock.svg.vec b/assets/vec/lock.svg.vec new file mode 100644 index 0000000..f257a46 Binary files /dev/null and b/assets/vec/lock.svg.vec differ diff --git a/assets/vec/logout.svg.vec b/assets/vec/logout.svg.vec new file mode 100644 index 0000000..a8a9e2b Binary files /dev/null and b/assets/vec/logout.svg.vec differ diff --git a/assets/vec/map.svg.vec b/assets/vec/map.svg.vec new file mode 100644 index 0000000..adc2bc2 Binary files /dev/null and b/assets/vec/map.svg.vec differ diff --git a/assets/vec/map_marker.svg.vec b/assets/vec/map_marker.svg.vec new file mode 100644 index 0000000..218eba7 Binary files /dev/null and b/assets/vec/map_marker.svg.vec differ diff --git a/assets/vec/message_add.svg.vec b/assets/vec/message_add.svg.vec new file mode 100644 index 0000000..f740dd5 Binary files /dev/null and b/assets/vec/message_add.svg.vec differ diff --git a/assets/vec/outside.svg.vec b/assets/vec/outside.svg.vec new file mode 100644 index 0000000..b38f61d Binary files /dev/null and b/assets/vec/outside.svg.vec differ diff --git a/assets/vec/pdf_download.svg.vec b/assets/vec/pdf_download.svg.vec new file mode 100644 index 0000000..50636b5 Binary files /dev/null and b/assets/vec/pdf_download.svg.vec differ diff --git a/assets/vec/people.svg.vec b/assets/vec/people.svg.vec new file mode 100644 index 0000000..acf8c0b Binary files /dev/null and b/assets/vec/people.svg.vec differ diff --git a/assets/vec/picture_frame.svg.vec b/assets/vec/picture_frame.svg.vec new file mode 100644 index 0000000..1a0551d Binary files /dev/null and b/assets/vec/picture_frame.svg.vec differ diff --git a/assets/vec/place_holder.svg.vec b/assets/vec/place_holder.svg.vec new file mode 100644 index 0000000..caefba3 Binary files /dev/null and b/assets/vec/place_holder.svg.vec differ diff --git a/assets/vec/profile2.svg.vec b/assets/vec/profile2.svg.vec new file mode 100644 index 0000000..d9f7baa Binary files /dev/null and b/assets/vec/profile2.svg.vec differ diff --git a/assets/vec/profile2_outline.svg.vec b/assets/vec/profile2_outline.svg.vec new file mode 100644 index 0000000..47e117e Binary files /dev/null and b/assets/vec/profile2_outline.svg.vec differ diff --git a/assets/vec/profile_circle.svg.vec b/assets/vec/profile_circle.svg.vec new file mode 100644 index 0000000..7abbf35 Binary files /dev/null and b/assets/vec/profile_circle.svg.vec differ diff --git a/assets/vec/profile_user.svg.vec b/assets/vec/profile_user.svg.vec new file mode 100644 index 0000000..4d9a07d Binary files /dev/null and b/assets/vec/profile_user.svg.vec differ diff --git a/assets/vec/receipt_discount.svg.vec b/assets/vec/receipt_discount.svg.vec new file mode 100644 index 0000000..851be37 Binary files /dev/null and b/assets/vec/receipt_discount.svg.vec differ diff --git a/assets/vec/sale.svg.vec b/assets/vec/sale.svg.vec new file mode 100644 index 0000000..4935a7d Binary files /dev/null and b/assets/vec/sale.svg.vec differ diff --git a/assets/vec/scan.svg.vec b/assets/vec/scan.svg.vec new file mode 100644 index 0000000..e8a6953 Binary files /dev/null and b/assets/vec/scan.svg.vec differ diff --git a/assets/vec/scan_barcode.svg.vec b/assets/vec/scan_barcode.svg.vec new file mode 100644 index 0000000..2456035 Binary files /dev/null and b/assets/vec/scan_barcode.svg.vec differ diff --git a/assets/vec/search.svg.vec b/assets/vec/search.svg.vec new file mode 100644 index 0000000..2e7b5e0 Binary files /dev/null and b/assets/vec/search.svg.vec differ diff --git a/assets/vec/security_time.svg.vec b/assets/vec/security_time.svg.vec new file mode 100644 index 0000000..72e5dee Binary files /dev/null and b/assets/vec/security_time.svg.vec differ diff --git a/assets/vec/setting.svg.vec b/assets/vec/setting.svg.vec new file mode 100644 index 0000000..5b88635 Binary files /dev/null and b/assets/vec/setting.svg.vec differ diff --git a/assets/vec/shop.svg.vec b/assets/vec/shop.svg.vec new file mode 100644 index 0000000..f02a218 Binary files /dev/null and b/assets/vec/shop.svg.vec differ diff --git a/assets/vec/shopping_basket.svg.vec b/assets/vec/shopping_basket.svg.vec new file mode 100644 index 0000000..c19c21e Binary files /dev/null and b/assets/vec/shopping_basket.svg.vec differ diff --git a/assets/vec/tag_label.svg.vec b/assets/vec/tag_label.svg.vec new file mode 100644 index 0000000..7afb4cd Binary files /dev/null and b/assets/vec/tag_label.svg.vec differ diff --git a/assets/vec/tag_user.svg.vec b/assets/vec/tag_user.svg.vec new file mode 100644 index 0000000..e90f06b Binary files /dev/null and b/assets/vec/tag_user.svg.vec differ diff --git a/assets/vec/task.svg.vec b/assets/vec/task.svg.vec new file mode 100644 index 0000000..b364eb1 Binary files /dev/null and b/assets/vec/task.svg.vec differ diff --git a/assets/vec/timer.svg.vec b/assets/vec/timer.svg.vec new file mode 100644 index 0000000..9f849a0 Binary files /dev/null and b/assets/vec/timer.svg.vec differ diff --git a/assets/vec/trash.svg.vec b/assets/vec/trash.svg.vec new file mode 100644 index 0000000..7d8c954 Binary files /dev/null and b/assets/vec/trash.svg.vec differ diff --git a/assets/vec/truck.svg.vec b/assets/vec/truck.svg.vec new file mode 100644 index 0000000..6cd1b6f Binary files /dev/null and b/assets/vec/truck.svg.vec differ diff --git a/assets/vec/truck_fast.svg.vec b/assets/vec/truck_fast.svg.vec new file mode 100644 index 0000000..f8a24c1 Binary files /dev/null and b/assets/vec/truck_fast.svg.vec differ diff --git a/assets/vec/truck_fast_outlined.svg.vec b/assets/vec/truck_fast_outlined.svg.vec new file mode 100644 index 0000000..996ae7c Binary files /dev/null and b/assets/vec/truck_fast_outlined.svg.vec differ diff --git a/assets/vec/user.svg.vec b/assets/vec/user.svg.vec new file mode 100644 index 0000000..cdbe8af Binary files /dev/null and b/assets/vec/user.svg.vec differ diff --git a/assets/vec/user_raduis.svg.vec b/assets/vec/user_raduis.svg.vec new file mode 100644 index 0000000..06d5bda Binary files /dev/null and b/assets/vec/user_raduis.svg.vec differ diff --git a/assets/vec/user_square.svg.vec b/assets/vec/user_square.svg.vec new file mode 100644 index 0000000..85abcce Binary files /dev/null and b/assets/vec/user_square.svg.vec differ diff --git a/assets/vec/virtual.svg.vec b/assets/vec/virtual.svg.vec new file mode 100644 index 0000000..13b9ec3 Binary files /dev/null and b/assets/vec/virtual.svg.vec differ diff --git a/assets/vec/whare_house.svg.vec b/assets/vec/whare_house.svg.vec new file mode 100644 index 0000000..1f58987 Binary files /dev/null and b/assets/vec/whare_house.svg.vec 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/flutter_launcher_icons.yaml b/flutter_launcher_icons.yaml new file mode 100644 index 0000000..add0a56 --- /dev/null +++ b/flutter_launcher_icons.yaml @@ -0,0 +1,16 @@ +# flutter pub run flutter_launcher_icons +flutter_launcher_icons: + image_path: "assets/logos/final_logo.png" + + android: "launcher_icon" + min_sdk_android: 21 # android min sdk min:16, default 21 + # adaptive_icon_background: "assets/icon/background.png" + # adaptive_icon_foreground: "assets/icon/foreground.png" + # adaptive_icon_monochrome: "assets/icon/monochrome.png" + + ios: true + remove_alpha_channel_ios: true + # image_path_ios_dark_transparent: "assets/icon/icon_dark.png" + # image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png" + # desaturate_tinted_to_grayscale_ios: true + diff --git a/fonts/iranyekanregularfanum.ttf b/fonts/iranyekanregularfanum.ttf new file mode 100644 index 0000000..72d5808 Binary files /dev/null and b/fonts/iranyekanregularfanum.ttf differ diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +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 index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +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..e549ee2 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# 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! + + 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/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 504fdc3..b4221fe 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hoshomandsazan.rasadyarApp; + PRODUCT_BUNDLE_IDENTIFIER = ir.mnpc.rasadyar; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -384,7 +384,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.hoshomandsazan.rasadyarApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = ir.mnpc.rasadyar.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -401,7 +401,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.hoshomandsazan.rasadyarApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = ir.mnpc.rasadyar.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -416,7 +416,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.hoshomandsazan.rasadyarApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = ir.mnpc.rasadyar.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -427,7 +427,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -484,7 +484,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -547,7 +547,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hoshomandsazan.rasadyarApp; + PRODUCT_BUNDLE_IDENTIFIER = ir.mnpc.rasadyar; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -569,7 +569,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hoshomandsazan.rasadyarApp; + PRODUCT_BUNDLE_IDENTIFIER = ir.mnpc.rasadyar; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fa..d0d98aa 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "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" - } -} +{"images":[{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@3x.png","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@3x.png","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@3x.png","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@3x.png","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@1x.png","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@1x.png","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@2x.png","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@1x.png","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@2x.png","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"Icon-App-83.5x83.5@2x.png","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"Icon-App-1024x1024@1x.png","scale":"1x"}],"info":{"version":1,"author":"xcode"}} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index dc9ada4..923275e 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png 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 index 7353c41..af58e3c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png 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 index 797d452..88b21ad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png 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 index 6ed2d93..7a965d1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png 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 index 4cd7b00..0f491ad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png 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 index fe73094..236a95d 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png 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 index 321773c..990c5bc 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png 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 index 797d452..88b21ad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png 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 index 502f463..36e9bad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png 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 index 0ec3034..8447632 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..e3a1019 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..c40c83f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..9d100ec Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..5fed9a2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index 0ec3034..8447632 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png 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 index e9f5fea..c6fe7ad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..8e82f3a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..2efdd5c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index 84ac32a..dc49aba 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png 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 index 8953cba..ac4802e 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png 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 index 0467bf1..22e98d6 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8479f72..14e47df 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -45,5 +45,7 @@ UIApplicationSupportsIndirectInputEvents +NSLocationWhenInUseUsageDescription +This app needs access to your location. diff --git a/lib/data/model/app_info_model.dart b/lib/data/model/app_info_model.dart new file mode 100644 index 0000000..e6eb9f9 --- /dev/null +++ b/lib/data/model/app_info_model.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'app_info_model.freezed.dart'; +part 'app_info_model.g.dart'; + +@freezed +abstract class AppInfoModel with _$AppInfoModel { + const factory AppInfoModel({String? key, String? download_link, Info? info}) = _AppInfoModel; + + factory AppInfoModel.fromJson(Map json) => _$AppInfoModelFromJson(json); +} + +@freezed +abstract class Info with _$Info { + const factory Info({String? version, String? module, bool? required}) = _Info; + + factory Info.fromJson(Map json) => _$InfoFromJson(json); +} diff --git a/lib/data/model/app_info_model.freezed.dart b/lib/data/model/app_info_model.freezed.dart new file mode 100644 index 0000000..dc05818 --- /dev/null +++ b/lib/data/model/app_info_model.freezed.dart @@ -0,0 +1,576 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'app_info_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$AppInfoModel { + + String? get key; String? get download_link; Info? get info; +/// Create a copy of AppInfoModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AppInfoModelCopyWith get copyWith => _$AppInfoModelCopyWithImpl(this as AppInfoModel, _$identity); + + /// Serializes this AppInfoModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AppInfoModel&&(identical(other.key, key) || other.key == key)&&(identical(other.download_link, download_link) || other.download_link == download_link)&&(identical(other.info, info) || other.info == info)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,download_link,info); + +@override +String toString() { + return 'AppInfoModel(key: $key, download_link: $download_link, info: $info)'; +} + + +} + +/// @nodoc +abstract mixin class $AppInfoModelCopyWith<$Res> { + factory $AppInfoModelCopyWith(AppInfoModel value, $Res Function(AppInfoModel) _then) = _$AppInfoModelCopyWithImpl; +@useResult +$Res call({ + String? key, String? download_link, Info? info +}); + + +$InfoCopyWith<$Res>? get info; + +} +/// @nodoc +class _$AppInfoModelCopyWithImpl<$Res> + implements $AppInfoModelCopyWith<$Res> { + _$AppInfoModelCopyWithImpl(this._self, this._then); + + final AppInfoModel _self; + final $Res Function(AppInfoModel) _then; + +/// Create a copy of AppInfoModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? download_link = freezed,Object? info = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,download_link: freezed == download_link ? _self.download_link : download_link // ignore: cast_nullable_to_non_nullable +as String?,info: freezed == info ? _self.info : info // ignore: cast_nullable_to_non_nullable +as Info?, + )); +} +/// Create a copy of AppInfoModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$InfoCopyWith<$Res>? get info { + if (_self.info == null) { + return null; + } + + return $InfoCopyWith<$Res>(_self.info!, (value) { + return _then(_self.copyWith(info: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [AppInfoModel]. +extension AppInfoModelPatterns on AppInfoModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AppInfoModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AppInfoModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AppInfoModel value) $default,){ +final _that = this; +switch (_that) { +case _AppInfoModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AppInfoModel value)? $default,){ +final _that = this; +switch (_that) { +case _AppInfoModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? download_link, Info? info)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AppInfoModel() when $default != null: +return $default(_that.key,_that.download_link,_that.info);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? download_link, Info? info) $default,) {final _that = this; +switch (_that) { +case _AppInfoModel(): +return $default(_that.key,_that.download_link,_that.info);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? download_link, Info? info)? $default,) {final _that = this; +switch (_that) { +case _AppInfoModel() when $default != null: +return $default(_that.key,_that.download_link,_that.info);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _AppInfoModel implements AppInfoModel { + const _AppInfoModel({this.key, this.download_link, this.info}); + factory _AppInfoModel.fromJson(Map json) => _$AppInfoModelFromJson(json); + +@override final String? key; +@override final String? download_link; +@override final Info? info; + +/// Create a copy of AppInfoModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AppInfoModelCopyWith<_AppInfoModel> get copyWith => __$AppInfoModelCopyWithImpl<_AppInfoModel>(this, _$identity); + +@override +Map toJson() { + return _$AppInfoModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppInfoModel&&(identical(other.key, key) || other.key == key)&&(identical(other.download_link, download_link) || other.download_link == download_link)&&(identical(other.info, info) || other.info == info)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,download_link,info); + +@override +String toString() { + return 'AppInfoModel(key: $key, download_link: $download_link, info: $info)'; +} + + +} + +/// @nodoc +abstract mixin class _$AppInfoModelCopyWith<$Res> implements $AppInfoModelCopyWith<$Res> { + factory _$AppInfoModelCopyWith(_AppInfoModel value, $Res Function(_AppInfoModel) _then) = __$AppInfoModelCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? download_link, Info? info +}); + + +@override $InfoCopyWith<$Res>? get info; + +} +/// @nodoc +class __$AppInfoModelCopyWithImpl<$Res> + implements _$AppInfoModelCopyWith<$Res> { + __$AppInfoModelCopyWithImpl(this._self, this._then); + + final _AppInfoModel _self; + final $Res Function(_AppInfoModel) _then; + +/// Create a copy of AppInfoModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? download_link = freezed,Object? info = freezed,}) { + return _then(_AppInfoModel( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,download_link: freezed == download_link ? _self.download_link : download_link // ignore: cast_nullable_to_non_nullable +as String?,info: freezed == info ? _self.info : info // ignore: cast_nullable_to_non_nullable +as Info?, + )); +} + +/// Create a copy of AppInfoModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$InfoCopyWith<$Res>? get info { + if (_self.info == null) { + return null; + } + + return $InfoCopyWith<$Res>(_self.info!, (value) { + return _then(_self.copyWith(info: value)); + }); +} +} + + +/// @nodoc +mixin _$Info { + + String? get version; String? get module; bool? get required; +/// Create a copy of Info +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$InfoCopyWith get copyWith => _$InfoCopyWithImpl(this as Info, _$identity); + + /// Serializes this Info to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Info&&(identical(other.version, version) || other.version == version)&&(identical(other.module, module) || other.module == module)&&(identical(other.required, required) || other.required == required)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,version,module,required); + +@override +String toString() { + return 'Info(version: $version, module: $module, required: $required)'; +} + + +} + +/// @nodoc +abstract mixin class $InfoCopyWith<$Res> { + factory $InfoCopyWith(Info value, $Res Function(Info) _then) = _$InfoCopyWithImpl; +@useResult +$Res call({ + String? version, String? module, bool? required +}); + + + + +} +/// @nodoc +class _$InfoCopyWithImpl<$Res> + implements $InfoCopyWith<$Res> { + _$InfoCopyWithImpl(this._self, this._then); + + final Info _self; + final $Res Function(Info) _then; + +/// Create a copy of Info +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? version = freezed,Object? module = freezed,Object? required = freezed,}) { + return _then(_self.copyWith( +version: freezed == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as String?,module: freezed == module ? _self.module : module // ignore: cast_nullable_to_non_nullable +as String?,required: freezed == required ? _self.required : required // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Info]. +extension InfoPatterns on Info { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Info value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Info() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Info value) $default,){ +final _that = this; +switch (_that) { +case _Info(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Info value)? $default,){ +final _that = this; +switch (_that) { +case _Info() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? version, String? module, bool? required)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Info() when $default != null: +return $default(_that.version,_that.module,_that.required);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? version, String? module, bool? required) $default,) {final _that = this; +switch (_that) { +case _Info(): +return $default(_that.version,_that.module,_that.required);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? version, String? module, bool? required)? $default,) {final _that = this; +switch (_that) { +case _Info() when $default != null: +return $default(_that.version,_that.module,_that.required);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Info implements Info { + const _Info({this.version, this.module, this.required}); + factory _Info.fromJson(Map json) => _$InfoFromJson(json); + +@override final String? version; +@override final String? module; +@override final bool? required; + +/// Create a copy of Info +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$InfoCopyWith<_Info> get copyWith => __$InfoCopyWithImpl<_Info>(this, _$identity); + +@override +Map toJson() { + return _$InfoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Info&&(identical(other.version, version) || other.version == version)&&(identical(other.module, module) || other.module == module)&&(identical(other.required, required) || other.required == required)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,version,module,required); + +@override +String toString() { + return 'Info(version: $version, module: $module, required: $required)'; +} + + +} + +/// @nodoc +abstract mixin class _$InfoCopyWith<$Res> implements $InfoCopyWith<$Res> { + factory _$InfoCopyWith(_Info value, $Res Function(_Info) _then) = __$InfoCopyWithImpl; +@override @useResult +$Res call({ + String? version, String? module, bool? required +}); + + + + +} +/// @nodoc +class __$InfoCopyWithImpl<$Res> + implements _$InfoCopyWith<$Res> { + __$InfoCopyWithImpl(this._self, this._then); + + final _Info _self; + final $Res Function(_Info) _then; + +/// Create a copy of Info +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? version = freezed,Object? module = freezed,Object? required = freezed,}) { + return _then(_Info( +version: freezed == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as String?,module: freezed == module ? _self.module : module // ignore: cast_nullable_to_non_nullable +as String?,required: freezed == required ? _self.required : required // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/lib/data/model/app_info_model.g.dart b/lib/data/model/app_info_model.g.dart new file mode 100644 index 0000000..90cd6a5 --- /dev/null +++ b/lib/data/model/app_info_model.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'app_info_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_AppInfoModel _$AppInfoModelFromJson(Map json) => + _AppInfoModel( + key: json['key'] as String?, + download_link: json['download_link'] as String?, + info: json['info'] == null + ? null + : Info.fromJson(json['info'] as Map), + ); + +Map _$AppInfoModelToJson(_AppInfoModel instance) => + { + 'key': instance.key, + 'download_link': instance.download_link, + 'info': instance.info, + }; + +_Info _$InfoFromJson(Map json) => _Info( + version: json['version'] as String?, + module: json['module'] as String?, + required: json['required'] as bool?, +); + +Map _$InfoToJson(_Info instance) => { + 'version': instance.version, + 'module': instance.module, + 'required': instance.required, +}; diff --git a/lib/infrastructure/di/di.dart b/lib/infrastructure/di/di.dart new file mode 100644 index 0000000..9a5a287 --- /dev/null +++ b/lib/infrastructure/di/di.dart @@ -0,0 +1,7 @@ +import 'package:rasadyar_core/core.dart'; + +final di = GetIt.instance; + +Future setupPreInjection() async { + await setupAllCoreProvider(); +} diff --git a/lib/infrastructure/service/app_navigation_observer.dart b/lib/infrastructure/service/app_navigation_observer.dart new file mode 100644 index 0000000..6438add --- /dev/null +++ b/lib/infrastructure/service/app_navigation_observer.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/di/chicken_di.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; +import 'package:rasadyar_inspection/inspection.dart'; + +class CustomNavigationObserver extends NavigatorObserver { + bool _isWorkDone = false; + + void setInjectionDone() { + _isWorkDone = true; + } + + @override + void didPush(Route route, Route? previousRoute) async { + super.didPush(route, previousRoute); + final routeName = route.settings.name; + if (!_isWorkDone &&( routeName == ChickenRoutes.init || routeName == ChickenRoutes.auth)) { + _isWorkDone = true; + await setupChickenDI(); + } else if (!_isWorkDone && + (routeName == InspectionRoutes.init || routeName == InspectionRoutes.auth)) { + _isWorkDone = true; + + await setupInspectionDI(); + } + tLog('CustomNavigationObserver: didPush - $routeName'); + } + + @override + void didReplace({Route? newRoute, Route? oldRoute}) { + super.didReplace(newRoute: newRoute, oldRoute: oldRoute); + tLog('CustomNavigationObserver: didReplace - ${newRoute?.settings.name}'); + } + + @override + void didPop(Route route, Route? previousRoute) { + super.didPop(route, previousRoute); + tLog('CustomNavigationObserver: didPop - ${route.settings.name}'); + } + + @override + void didRemove(Route route, Route? previousRoute) { + super.didRemove(route, previousRoute); + tLog('CustomNavigationObserver: didRemove - ${route.settings.name}'); + } +} diff --git a/lib/infrastructure/service/token_storage_service.dart b/lib/infrastructure/service/token_storage_service.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/main.dart b/lib/main.dart index 7b7f5b6..09db360 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,122 +1,73 @@ import 'package:flutter/material.dart'; +import 'package:rasadyar_app/infrastructure/service/app_navigation_observer.dart'; +import 'package:rasadyar_app/presentation/routes/app_pages.dart'; +import 'package:rasadyar_core/core.dart'; +import 'infrastructure/di/di.dart'; +import 'presentation/routes/auth_route_resolver_impl.dart'; -void main() { - runApp(const MyApp()); + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + + await setupPreInjection(); + Get.put(TokenStorageService()); + await Get.find().init(); + Get.put(AppAuthRouteResolver()); + Get.put(AuthMiddleware()); + + runApp(MyApp()); + + // runApp(DevicePreview(builder: (context) => ForDevicePreview(),)); } +/*class ForDevicePreview extends StatelessWidget { + const ForDevicePreview({super.key}); + + @override + Widget build(BuildContext context) { + return GetMaterialApp( + useInheritedMediaQuery: true, + locale: DevicePreview.locale(context), + builder: DevicePreview.appBuilder, + title: 'رصدیار', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: AppColor.blueNormal), + ), + initialRoute: AppPages.initRoutes, + initialBinding: BindingsBuilder.put(() => UserService()), + getPages: AppPages.pages, + ); + } +}*/ + class MyApp extends StatelessWidget { const MyApp({super.key}); - // This widget is the root of your application. @override Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - // This is the theme of your application. - // - // TRY THIS: Try running your application with "flutter run". You'll see - // the application has a purple toolbar. Then, without quitting the app, - // try changing the seedColor in the colorScheme below to Colors.green - // and then invoke "hot reload" (save your changes or press the "hot - // reload" button in a Flutter-supported IDE, or press "r" if you used - // the command line to start the app). - // - // Notice that the counter didn't reset back to zero; the application - // state is not lost during the reload. To reset the state, use hot - // restart instead. - // - // This works for code too, not just values: Most code changes can be - // tested with just a hot reload. - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), - ); - } -} - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // TRY THIS: Try changing the color here to a specific color (to - // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar - // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - // - // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" - // action in the IDE, or press "p" in the console), to see the - // wireframe for each widget. - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text('You have pushed the button this many times:'), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], + return ScreenUtilInit( + designSize: const Size(412, 917), + minTextAdapt: true, + splitScreenMode: true, + child: GetMaterialApp( + title: 'رصدیار', + theme: ThemeData( + fontFamily: 'yekan', + colorScheme: ColorScheme.fromSeed(seedColor: AppColor.blueNormal), ), + initialRoute: AppPages.initRoutes, + getPages: AppPages.pages, + locale: const Locale("fa", "IR"), + supportedLocales: const [Locale("fa", "IR")], + navigatorObservers: [CustomNavigationObserver()], + localizationsDelegates: [ + PersianMaterialLocalizations.delegate, + PersianCupertinoLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. ); } } diff --git a/lib/presentation/pages/modules/logic.dart b/lib/presentation/pages/modules/logic.dart new file mode 100644 index 0000000..e73eefe --- /dev/null +++ b/lib/presentation/pages/modules/logic.dart @@ -0,0 +1,28 @@ +import 'package:rasadyar_core/core.dart'; + +class ModulesLogic extends GetxController { + TokenStorageService tokenService = Get.find(); + + List moduleList = [ + ModuleModel(title: 'بازرسی', icon: Assets.icons.inspection.path, module: Module.inspection), +// ModuleModel(title: 'دام', icon: Assets.icons.liveStock.path, module: Module.liveStocks), + ModuleModel(title: 'مرغ', icon: Assets.icons.liveStock.path, module: Module.chicken), + ]; + + RxnInt selectedIndex = RxnInt(null); + + @override + void onReady() { + super.onReady(); + } + + @override + void onClose() { + super.onClose(); + } + + void saveModule(Module module) { + tokenService.saveModule(module); + tokenService.appModule.value = module; + } +} diff --git a/lib/presentation/pages/modules/view.dart b/lib/presentation/pages/modules/view.dart new file mode 100644 index 0000000..880050a --- /dev/null +++ b/lib/presentation/pages/modules/view.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/inspection.dart'; + +import 'logic.dart'; + +class ModulesPage extends GetView { + const ModulesPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('انتخاب سامانه', style: AppFonts.yekan18.copyWith(color: Colors.white)), + centerTitle: true, + backgroundColor: AppColor.blueNormal, + ), + body: GridView.builder( + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 20), + + itemBuilder: (context, index) { + final module = controller.moduleList[index]; + return CardIcon( + title: module.title, + icon: module.icon, + onTap: () { + controller.selectedIndex.value = index; + controller.saveModule(module.module); + + // Navigate to the appropriate route based on the selected module + switch (module.module) { + case Module.inspection: + Get.toNamed(InspectionRoutes.init); + break; + case Module.liveStocks: + //TODO: Implement liveStocks module navigation + case Module.chicken: + Get.toNamed(ChickenRoutes.init); + break; + } + }, + ); + }, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + mainAxisSpacing: 10, + crossAxisSpacing: 10, + ), + physics: BouncingScrollPhysics(), + itemCount: controller.moduleList.length, + ), + ); + } +} diff --git a/lib/presentation/pages/splash/logic.dart b/lib/presentation/pages/splash/logic.dart new file mode 100644 index 0000000..a9f1a8d --- /dev/null +++ b/lib/presentation/pages/splash/logic.dart @@ -0,0 +1,242 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_app/data/model/app_info_model.dart'; +import 'package:rasadyar_app/presentation/routes/app_pages.dart'; +import 'package:rasadyar_core/core.dart'; + +class SplashLogic extends GetxController with GetTickerProviderStateMixin { + late final AnimationController scaleController; + late final AnimationController rotateController; + Rxn> scaleAnimation = Rxn(); + Rxn> rotationAnimation = Rxn(); + RxBool hasUpdated = false.obs; + RxBool onUpdateDownload = false.obs; + RxDouble percent = 0.0.obs; + final RxnString _updateFilePath = RxnString(); + final platform = MethodChannel('apk_installer'); + final Dio _dio = Dio(); + var tokenService = Get.find(); + AppInfoModel? appInfoModel; + + @override + void onInit() { + super.onInit(); + scaleController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 1500), + ); + + rotateController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 8000), + ); + + scaleAnimation.value = Tween(begin: 0.8, end: 1.2).animate(scaleController); + + rotationAnimation.value = Tween(begin: 0.0, end: 1).animate(rotateController); + + rotateController.forward(); + rotateController.addStatusListener((status) { + if (status == AnimationStatus.completed) { + rotateController.repeat(); + } else if (status == AnimationStatus.dismissed) { + rotateController.forward(); + } + }); + + scaleController.forward(); + scaleController.addStatusListener((status) { + if (status == AnimationStatus.completed) { + scaleController.reverse(); + } else if (status == AnimationStatus.dismissed) { + scaleController.forward(); + } + }); + + hasUpdated.listen((data) { + if (data) { + requiredUpdateDialog( + onConfirm: () async { + await fileDownload(); + }, + ); + } else if (!data && Get.isDialogOpen == true) { + Get.back(); + } + }); + onUpdateDownload.listen((data) { + hasUpdated.value = false; + if (data) { + Get.bottomSheet( + isDismissible: false, + isScrollControlled: true, + backgroundColor: Colors.transparent, + Container( + height: 170, + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.vertical(top: Radius.circular(16.0)), + ), + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + spacing: 8, + children: [ + const Text('در حال دانلود بروزرسانی برنامه...'), + Obx( + () => Row( + spacing: 8, + children: [ + Expanded( + child: LinearProgressIndicator( + value: percent.value, + color: AppColor.greenNormal, + minHeight: 4, + ), + ), + SizedBox( + width: 55.w, + child: Text( + '${(percent.value * 100).toStringAsFixed(2)}%', + textAlign: TextAlign.center, + ), + ), + ], + ), + ), + + Row( + spacing: 8, + children: [ + Expanded( + child: ObxValue((data) { + return RElevated( + backgroundColor: AppColor.greenNormal, + height: 40.h, + onPressed: data.value != null + ? () { + installApk(); + Get.back(); + } + : null, + text: 'نصب', + ); + }, _updateFilePath), + ), + Expanded( + child: ROutlinedElevated( + borderColor: AppColor.error, + text: 'خروج', + onPressed: () async { + exit(0); + }, + ), + ), + ], + ), + ], + ), + ), + ); + } + }); + } + + @override + void onReady() { + super.onReady(); + + Future.delayed(const Duration(milliseconds: 250), () async { + try { + final isUpdateNeeded = await checkVersion(); + if (isUpdateNeeded) return; + tokenService.getModule(); + final module = tokenService.appModule.value; + final target = getTargetPage(module); + Get.offAndToNamed(target); + } catch (e, st) { + debugPrint("onReady error: $e\n$st"); + } + }); + } + + @override + void onClose() { + rotateController.dispose(); + scaleController.dispose(); + super.onClose(); + } + + Future checkVersion() async { + try { + final info = await PackageInfo.fromPlatform(); + int version = info.version.versionNumber; + var res = await _dio.get("https://rsibackend.rasadyaar.ir/app/apk-info/"); + + appInfoModel = AppInfoModel.fromJson(res.data); + + if ((appInfoModel?.info?.version?.versionNumber ?? 0) > version) { + hasUpdated.value = !hasUpdated.value; + return true; + } + return false; + } catch (e) { + return false; + } + } + + Future fileDownload() async { + onUpdateDownload.value = true; + final dir = await getApplicationDocumentsDirectory(); + final filePath = "${dir.path}/rasadyar.apk"; + final file = File(filePath); + if (await file.exists()) { + await file.delete(); + } + int attempts = 0; + int retryCount = 4; + bool success = false; + + while (attempts < retryCount && !success) { + try { + await _dio.download( + appInfoModel?.download_link ?? '', + filePath, + onReceiveProgress: (count, total) { + if (total != -1 && total > 0) { + percent.value = count / total; + } + }, + ); + success = true; + } on DioException catch (e) { + attempts++; + percent.value = 0.0; + if (attempts >= retryCount) { + eLog("Download failed after $attempts attempts: ${e.message}"); + } else { + await Future.delayed(const Duration(milliseconds: 1200)); + } + } + } + + if (success) { + _updateFilePath.value = filePath; + } + + onUpdateDownload.value = false; + } + + Future installApk() async { + try { + eLog(_updateFilePath.value); + + final dir = await getApplicationDocumentsDirectory(); + await platform.invokeMethod('apk_installer', {'appPath': _updateFilePath.value}); + } catch (e) { + print("خطا در نصب: $e"); + } + } +} diff --git a/lib/presentation/pages/splash/view.dart b/lib/presentation/pages/splash/view.dart new file mode 100644 index 0000000..140ed32 --- /dev/null +++ b/lib/presentation/pages/splash/view.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + + +import 'logic.dart'; + +class SplashPage extends GetView { + const SplashPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.blueDarker, + body: Center( + child: Stack( + alignment: Alignment.center, + children: [ + + ObxValue((data) { + return ScaleTransition( + scale: data.value!, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 1), + child: Assets.images.innerSplash.image( + width: 190, + height: 190, + ) + ), + ); + }, controller.scaleAnimation), + + ObxValue((data) { + return RotationTransition( + turns: data.value!, + + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 1), + child: Assets.images.outterSplash.image() + ), + ); + }, controller.rotationAnimation), + ], + ), + ), + ); + } +} diff --git a/lib/presentation/pages/system_design/system_design.dart b/lib/presentation/pages/system_design/system_design.dart new file mode 100644 index 0000000..bacf390 --- /dev/null +++ b/lib/presentation/pages/system_design/system_design.dart @@ -0,0 +1,257 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + + +class SystemDesignPage extends StatefulWidget { + const SystemDesignPage({super.key}); + + @override + State createState() => _SystemDesignPageState(); +} + +class _SystemDesignPageState extends State { + List _isOpen = [false, false, false, false, false, false]; + + void _handleAdd() { + print("Add FAB pressed"); + } + + void _handleEdit() { + print("Edit FAB pressed"); + } + + void _handleDelete() { + print("Delete FAB pressed"); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text("System design"), centerTitle: true), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: ExpansionPanelList( + expansionCallback: (panelIndex, isExpanded) { + setState(() { + _isOpen[panelIndex] = isExpanded; + }); + }, + children: [ + buttonWidget(), + fabWidget(), + outlinedFabWidget(), + paginationWidget(), + tabWidget(), + inputsWidget(), + ], + ), + ), + ), + ); + } + + ExpansionPanel inputsWidget() { + return ExpansionPanel( + isExpanded: _isOpen[5], + headerBuilder: (context, isExpanded) { + return ListTile( + title: Text( + "inputs", + style: AppFonts.yekan20.copyWith(color: Colors.red), + ), + ); + }, + body: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + spacing: 14, + children: [ + RTextField( + controller: TextEditingController(), + hintText: 'حجم کشتار را در روز به قطعه وارد کنید', + hintStyle: AppFonts.yekan13, + ), + RTextField( + controller: TextEditingController(), + label: 'تلفن مرغداری', + labelStyle: AppFonts.yekan10, + ), + ], + ), + ), + ); + } + + ExpansionPanel tabWidget() { + return ExpansionPanel( + isExpanded: _isOpen[4], + headerBuilder: (context, isExpanded) { + return ListTile( + title: Text( + "tab", + style: AppFonts.yekan20.copyWith(color: Colors.red), + ), + ); + }, + body: Column( + spacing: 14, + children: [ + CupertinoSegmentedControlDemo(), + CupertinoSegmentedControlDemo2(), + ], + ), + ); + } + + ExpansionPanel paginationWidget() { + return ExpansionPanel( + isExpanded: _isOpen[3], + headerBuilder: (context, isExpanded) { + return ListTile( + title: Text( + "پیجینیشن", + style: AppFonts.yekan20.copyWith(color: Colors.red), + ), + ); + }, + body: Column(spacing: 14, children: [RShowMore(), PaginationFromUntil()]), + ); + } + + ExpansionPanel outlinedFabWidget() { + return ExpansionPanel( + isExpanded: _isOpen[2], + headerBuilder: (context, isExpanded) { + return ListTile( + title: Text( + "Outlined Fab ", + style: AppFonts.yekan20.copyWith(color: Colors.green), + ), + ); + }, + body: Column( + spacing: 14, + children: [ + Row(), +/* + RFabOutlined.smallAdd(onPressed: () {}), + RFabOutlined.smallAdd(onPressed: null), + + RFabOutlined.smallAddNoBorder(onPressed: () {}), + RFabOutlined.smallAddNoBorder(onPressed: null), + + RFabOutlined.add(onPressed: () {}), + RFabOutlined.add(onPressed: null), + + RFabOutlined.addNoBorder(onPressed: () {}), + RFabOutlined.addNoBorder(onPressed: null),*/ + ], + ), + ); + } + + ExpansionPanel fabWidget() { + return ExpansionPanel( + isExpanded: _isOpen[1], + headerBuilder: (context, isExpanded) { + return ListTile( + title: Text( + "Fab", + style: AppFonts.yekan20.copyWith(color: Colors.green), + ), + ); + }, + body: Column( + spacing: 14, + children: [ + Row(), + + /* RFab.smallAdd(onPressed: () {}), + RFab.smallAdd(onPressed: null), + + RFab.add(onPressed: () {}), + RFab.add(onPressed: null), + + RFab.smallEdit(onPressed: null), + RFab.smallEdit(onPressed: () {}), + + RFab.edit(onPressed: () {}), + RFab.edit(onPressed: null), + + RFab.smallDelete(onPressed: () {}), + RFab.smallDelete(onPressed: null), + + RFab.delete(onPressed: () {}), + RFab.delete(onPressed: null), + + RFab.smallAction(onPressed: () {}), + RFab.smallAction(onPressed: null), + + RFab.action(onPressed: () {}), + RFab.action(onPressed: null), + + RFab.smallFilter(onPressed: () {}), + RFab.smallFilter(onPressed: null), + + RFab.filter(onPressed: () {}), + RFab.filter(onPressed: null), + + RFab.smallDownload(onPressed: () {}), + RFab.smallDownload(onPressed: null), + + RFab.download(onPressed: () {}), + RFab.download(onPressed: null), + + RFab.smallExcel(onPressed: () {}), + RFab.smallExcel(onPressed: null), + + RFab.excel(onPressed: () {}), + RFab.excel(onPressed: null), + + RFab.smallBack(onPressed: () {}), + RFab.smallBack(onPressed: null), + + RFab.back(onPressed: () {}), + RFab.back(onPressed: null),*/ + ], + ), + ); + } + + ExpansionPanel buttonWidget() { + return ExpansionPanel( + isExpanded: _isOpen[0], + headerBuilder: (context, isExpanded) { + return ListTile( + title: Text( + "دکمه ها", + style: AppFonts.yekan20.copyWith(color: Colors.green), + ), + ); + }, + body: Column( + spacing: 14, + children: [ + Row(), + + RElevated(text: 'ثبت', onPressed: () {}), + + RElevated(text: 'ثبت', onPressed: null), + + ROutlinedElevated(text: 'ثبت', onPressed: () {}), + ROutlinedElevated( + text: 'ثبتwwww', + onPressed: () {}, + backgroundColor: AppColor.blueNormal.disabledColor, + pressedBackgroundColor: AppColor.blueNormal, + ), + ROutlinedElevated(text: 'ثبت', onPressed: null), + + RTextButton(text: 'ثبت', onPressed: () {}), + RTextButton(text: 'ثبت', onPressed: null), + ], + ), + ); + } +} diff --git a/lib/presentation/routes/app_pages.dart b/lib/presentation/routes/app_pages.dart new file mode 100644 index 0000000..44675f4 --- /dev/null +++ b/lib/presentation/routes/app_pages.dart @@ -0,0 +1,52 @@ +import 'package:rasadyar_app/presentation/pages/modules/logic.dart'; +import 'package:rasadyar_app/presentation/pages/modules/view.dart'; +import 'package:rasadyar_app/presentation/pages/splash/logic.dart'; +import 'package:rasadyar_app/presentation/pages/splash/view.dart'; +import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/inspection.dart'; +import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; + +part 'app_paths.dart'; + +sealed class AppPages { + AppPages._(); + + static const String initRoutes = AppPaths.splash; + static const String initDesignSystem = AppPaths.systemDesignPage; + + static List pages = [ + GetPage(name: AppPaths.systemDesignPage, page: () => SystemDesignPage()), + + GetPage( + name: AppPaths.moduleList, + page: () => ModulesPage(), + binding: BindingsBuilder.put(() => ModulesLogic()), + ), + + GetPage( + name: AppPaths.splash, + page: () => SplashPage(), + binding: BindingsBuilder.put(() => SplashLogic()), + ), + + ...InspectionPages.pages, + + ...LiveStockPages.pages, + ...ChickenPages.pages, + ]; +} + +String getTargetPage(Module? value) { + switch (value) { + case Module.inspection: + return InspectionRoutes.init; + case Module.liveStocks: + return LiveStockRoutes.init; + case Module.chicken: + return ChickenRoutes.init; + default: + return AppPaths.moduleList; + } +} diff --git a/lib/presentation/routes/app_paths.dart b/lib/presentation/routes/app_paths.dart new file mode 100644 index 0000000..2003dcd --- /dev/null +++ b/lib/presentation/routes/app_paths.dart @@ -0,0 +1,9 @@ +part of 'app_pages.dart'; + +sealed class AppPaths { + AppPaths._(); + + static const String splash = '/splash'; + static const String moduleList = '/moduleList'; + static const String systemDesignPage = '/systemDesignPage'; +} diff --git a/lib/presentation/routes/auth_route_resolver_impl.dart b/lib/presentation/routes/auth_route_resolver_impl.dart new file mode 100644 index 0000000..c932919 --- /dev/null +++ b/lib/presentation/routes/auth_route_resolver_impl.dart @@ -0,0 +1,24 @@ +import 'package:rasadyar_app/presentation/routes/app_pages.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/inspection.dart'; +import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; + +class AppAuthRouteResolver implements AuthRouteResolver { + @override + String getAuthRouteForModule(Module module) { + switch (module) { + case Module.inspection: + return InspectionRoutes.auth; + case Module.liveStocks: + return LiveStockRoutes.auth; + case Module.chicken: + return ChickenRoutes.auth; + default: + throw UnimplementedError('No auth route for module: $module'); + } + } + + @override + String getFallbackRoute() => AppPaths.moduleList; +} diff --git a/packages/chicken/.gitignore b/packages/chicken/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/packages/chicken/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/chicken/CHANGELOG.md b/packages/chicken/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/packages/chicken/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/packages/chicken/README.md b/packages/chicken/README.md new file mode 100644 index 0000000..8831761 --- /dev/null +++ b/packages/chicken/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/chicken/analysis_options.yaml b/packages/chicken/analysis_options.yaml new file mode 100644 index 0000000..dee8927 --- /dev/null +++ b/packages/chicken/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/packages/chicken/build.yaml b/packages/chicken/build.yaml new file mode 100644 index 0000000..840029b --- /dev/null +++ b/packages/chicken/build.yaml @@ -0,0 +1,6 @@ +targets: + $default: + builders: + json_serializable: + options: + field_rename: snake \ No newline at end of file diff --git a/packages/chicken/lib/chicken.dart b/packages/chicken/lib/chicken.dart new file mode 100644 index 0000000..7f7bfe9 --- /dev/null +++ b/packages/chicken/lib/chicken.dart @@ -0,0 +1,9 @@ +/// Support for doing something awesome. +/// +/// More dartdocs go here. +library; + +export 'presentation/routes/pages.dart'; +export 'presentation/routes/routes.dart'; +export 'presentation/pages/root/view.dart'; +export 'presentation/pages/root/logic.dart'; diff --git a/packages/chicken/lib/data/common/constant.dart b/packages/chicken/lib/data/common/constant.dart new file mode 100644 index 0000000..c0b0982 --- /dev/null +++ b/packages/chicken/lib/data/common/constant.dart @@ -0,0 +1,14 @@ +enum ApiEnvironment { + dam(url: 'https://api.dam.rasadyar.net/'); + + const ApiEnvironment({required this.url}); + + final String url; + + String get baseUrl { + switch (this) { + case ApiEnvironment.dam: + return url; + } + } +} diff --git a/packages/chicken/lib/data/common/dio_error_handler.dart b/packages/chicken/lib/data/common/dio_error_handler.dart new file mode 100644 index 0000000..57f29bc --- /dev/null +++ b/packages/chicken/lib/data/common/dio_error_handler.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class DioErrorHandler { + void handle(DioException error) { + switch (error.response?.statusCode) { + case 401: + _handleGeneric(error); + break; + case 403: + _handleGeneric(error); + break; + + case 410: + _handle410(); + break; + default: + _handleGeneric(error); + } + } + + //wrong password/user name => "detail": "No active account found with the given credentials" - 401 + void _handle410() { + Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است')); + } + + //wrong captcha => "detail": "Captcha code is incorrect" - 403 + void _handle403() {} + + void _handleGeneric(DioException error) { + Get.showSnackbar( + _errorSnackBar( + error.response?.data.keys.first == 'is_user' + ? 'کاربر با این شماره تلفن وجود ندارد' + : error.response?.data[error.response?.data.keys.first] ?? + 'خطا در برقراری ارتباط با سرور', + ), + ); + } + + GetSnackBar _errorSnackBar(String message) { + return GetSnackBar( + titleText: Text( + 'خطا', + style: AppFonts.yekan14.copyWith(color: Colors.white), + ), + messageText: Text( + message, + style: AppFonts.yekan12.copyWith(color: Colors.white), + ), + backgroundColor: AppColor.error, + margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8), + borderRadius: 12, + duration: Duration(milliseconds: 3500), + snackPosition: SnackPosition.TOP, + ); + } +} diff --git a/packages/chicken/lib/data/data_source/local/chicken_local.dart b/packages/chicken/lib/data/data_source/local/chicken_local.dart new file mode 100644 index 0000000..e02478a --- /dev/null +++ b/packages/chicken/lib/data/data_source/local/chicken_local.dart @@ -0,0 +1,8 @@ +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; + +abstract class ChickenLocalDataSource { + Future openBox(); + Future initWidleyUsed(); + + WidelyUsedLocalModel? getAllWidely(); +} diff --git a/packages/chicken/lib/data/data_source/local/chicken_local_imp.dart b/packages/chicken/lib/data/data_source/local/chicken_local_imp.dart new file mode 100644 index 0000000..a8f2055 --- /dev/null +++ b/packages/chicken/lib/data/data_source/local/chicken_local_imp.dart @@ -0,0 +1,58 @@ +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'chicken_local.dart'; + +class ChickenLocalDataSourceImp implements ChickenLocalDataSource { + HiveLocalStorage local = diCore.get(); + final String boxName = 'Chicken_Widley_Box'; + + @override + Future openBox() async { + await local.openBox(boxName); + } + + @override + Future initWidleyUsed() async { + List tmpList = [ + WidelyUsedLocalItem( + index: 0, + pathId: 0, + title: 'خرید داخل استان', + color: AppColor.greenLightActive.toARGB32(), + iconColor: AppColor.greenNormal.toARGB32(), + iconPath: Assets.vec.cubeSearchSvg.path, + path: ChickenRoutes.buysInProvince, + ), + WidelyUsedLocalItem( + index: 1, + pathId: 1, + title: 'فروش داخل استان', + color: AppColor.blueLightActive.toARGB32(), + iconColor: AppColor.blueNormal.toARGB32(), + iconPath: Assets.vec.cubeSvg.path, + path: ChickenRoutes.salesInProvince, + ), + + WidelyUsedLocalItem( + index: 2, + title: 'قطعه‌بندی', + color: AppColor.blueLightActive.toARGB32(), + iconColor: AppColor.blueNormal.toARGB32(), + iconPath: Assets.vec.cubeRotateSvg.path, + path: ChickenRoutes.buysInProvince, + ), + ]; + await local.add( + boxName: boxName, + value: WidelyUsedLocalModel(hasInit: true, items: tmpList), + ); + } + + @override + WidelyUsedLocalModel? getAllWidely() { + var res = local.readBox(boxName: boxName); + return res?.first; + } +} diff --git a/packages/chicken/lib/data/data_source/remote/auth/auth_remote.dart b/packages/chicken/lib/data/data_source/remote/auth/auth_remote.dart new file mode 100644 index 0000000..1705dcf --- /dev/null +++ b/packages/chicken/lib/data/data_source/remote/auth/auth_remote.dart @@ -0,0 +1,13 @@ +import 'package:rasadyar_chicken/data/models/response/captcha/captcha_response_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; + +abstract class AuthRemoteDataSource { + Future login({required Map authRequest}); + + Future logout(); + + Future hasAuthenticated(); + + Future getUserInfo(String phoneNumber); +} diff --git a/packages/chicken/lib/data/data_source/remote/auth/auth_remote_imp.dart b/packages/chicken/lib/data/data_source/remote/auth/auth_remote_imp.dart new file mode 100644 index 0000000..f25e8c2 --- /dev/null +++ b/packages/chicken/lib/data/data_source/remote/auth/auth_remote_imp.dart @@ -0,0 +1,50 @@ +import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'auth_remote.dart'; + +class AuthRemoteDataSourceImp extends AuthRemoteDataSource { + final DioRemote _httpClient; + final String _BASE_URL = 'auth/api/v1/'; + + AuthRemoteDataSourceImp(this._httpClient); + + @override + Future login({required Map authRequest}) async { + var res = await _httpClient.post( + '/api/login/', + data: authRequest, + fromJson: UserProfileModel.fromJson, + headers: {'Content-Type': 'application/json'}, + ); + return res.data; + } + + @override + Future logout() { + // TODO: implement logout + throw UnimplementedError(); + } + + @override + Future hasAuthenticated() async { + final response = await _httpClient.get( + '$_BASE_URL/login/', + headers: {'Content-Type': 'application/json'}, + ); + + return response.data ?? false; + } + + @override + Future getUserInfo(String phoneNumber) async { + var res = await _httpClient.post( + 'https://userbackend.rasadyaar.ir/api/send_otp/', + data: {"mobile": phoneNumber, "state": ""}, + fromJson: UserInfoModel.fromJson, + headers: {'Content-Type': 'application/json'}, + ); + return res.data; + } +} diff --git a/packages/chicken/lib/data/data_source/remote/chicken/chicken_remote.dart b/packages/chicken/lib/data/data_source/remote/chicken/chicken_remote.dart new file mode 100644 index 0000000..e6f04b8 --- /dev/null +++ b/packages/chicken/lib/data/data_source/remote/chicken/chicken_remote.dart @@ -0,0 +1,155 @@ +import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart'; +import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart'; +import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart'; +import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; +import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; +import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' + hide ProductModel; +import 'package:rasadyar_core/core.dart'; + +abstract class ChickenRemoteDatasource { + Future?> getInventory({required String token, CancelToken? cancelToken}); + + Future getKillHouseDistributionInfo({required String token}); + + Future getGeneralBarInformation({ + required String token, + Map? queryParameters, + }); + + Future?> getWaitingArrivals({ + required String token, + Map? queryParameters, + }); + + Future setSateForArrivals({required String token, required Map request}); + + Future?> getImportedLoadsModel({ + required String token, + Map? queryParameters, + }); + + Future?> getAllocatedMade({ + required String token, + Map? queryParameters, + }); + + Future confirmAllocation({required String token, required Map allocation}); + + Future denyAllocation({required String token, required String allocationToken}); + + Future confirmAllAllocation({ + required String token, + required List allocationTokens, + }); + + Future?> getRolesProducts({required String token}); + + Future?> getGuilds({ + required String token, + Map? queryParameters, + }); + + Future getProfile({required String token}); + + Future postSubmitStewardAllocation({ + required String token, + required SubmitStewardAllocation request, + }); + + Future deleteStewardAllocation({ + required String token, + Map? queryParameters, + }); + + Future updateStewardAllocation({required String token, required ConformAllocation request}); + + Future getStewardDashboard({ + required String token, + required String stratDate, + required String endDate, + }); + + Future getDashboardKillHouseFreeBar({ + required String token, + required String stratDate, + required String endDate, + }); + + Future?> getStewardPurchasesOutSideOfTheProvince({ + required String token, + Map? queryParameters, + }); + + Future createStewardPurchasesOutSideOfTheProvince({ + required String token, + required CreateStewardFreeBar body, + }); + + Future deleteStewardPurchasesOutSideOfTheProvince({ + required String token, + required String stewardFreeBarKey, + }); + + Future?> getOutProvinceCarcassesBuyer({ + required String token, + Map? queryParameters, + }); + + Future createOutProvinceCarcassesBuyer({ + required String token, + required OutProvinceCarcassesBuyer body, + }); + + Future?> getProvince({CancelToken? cancelToken}); + + Future?> getCity({required String provinceName}); + + Future?> getStewardFreeSaleBar({ + required String token, + Map? queryParameters, + }); + + Future createOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }); + + Future updateOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }); + + Future getUserProfile({required String token}); + + Future updateUserProfile({required String token, required UserProfile userProfile}); + + Future updatePassword({required String token, required ChangePasswordRequestModel model}); + + Future?> getSegmentation({ + required String token, + Map? queryParameters, + }); + + Future createSegmentation({required String token, required SegmentationModel model}); + + Future editSegmentation({required String token, required SegmentationModel model}); + + Future deleteSegmentation({required String token, required String key}); +} diff --git a/packages/chicken/lib/data/data_source/remote/chicken/chicken_remote_imp.dart b/packages/chicken/lib/data/data_source/remote/chicken/chicken_remote_imp.dart new file mode 100644 index 0000000..57df1fa --- /dev/null +++ b/packages/chicken/lib/data/data_source/remote/chicken/chicken_remote_imp.dart @@ -0,0 +1,486 @@ + +import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart'; +import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart'; +import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart'; +import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; +import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; +import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' + hide ProductModel; +import 'package:rasadyar_core/core.dart'; + +import 'chicken_remote.dart'; + +class ChickenRemoteDatasourceImp implements ChickenRemoteDatasource { + final DioRemote _httpClient; + + ChickenRemoteDatasourceImp(this._httpClient); + + @override + Future?> getInventory({ + required String token, + CancelToken? cancelToken, + }) async { + eLog(_httpClient.baseUrl); + var res = await _httpClient.get( + '/roles-products/?role=Steward', + headers: {'Authorization': 'Bearer $token'}, + + fromJsonList: (json) => + (json).map((item) => InventoryModel.fromJson(item as Map)).toList(), + ); + + return res.data; + } + + @override + Future getKillHouseDistributionInfo({required String token}) async { + var res = await _httpClient.get( + '/kill-house-distribution-info/?role=Steward', + headers: {'Authorization': 'Bearer $token'}, + fromJson: KillHouseDistributionInfo.fromJson, + ); + + return res.data; + } + + @override + Future getGeneralBarInformation({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/bars_for_kill_house_dashboard/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: BarInformation.fromJson, + ); + return res.data; + } + + @override + Future?> getWaitingArrivals({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/steward-allocation/', + headers: {'Authorization': 'Bearer $token'}, + queryParameters: queryParameters, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => WaitingArrivalModel.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future setSateForArrivals({ + required String token, + required Map request, + }) async { + await _httpClient.put( + '/steward-allocation/0/', + headers: {'Authorization': 'Bearer $token'}, + data: request, + ); + } + + @override + Future?> getImportedLoadsModel({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/steward-allocation/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (data) => ImportedLoadsModel.fromJson(data as Map), + ), + ); + return res.data; + } + + @override + Future?> getAllocatedMade({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/steward-allocation/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => AllocatedMadeModel.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future confirmAllocation({ + required String token, + required Map allocation, + }) async { + var res = await _httpClient.put( + '/steward-allocation/0/', + headers: {'Authorization': 'Bearer $token'}, + data: allocation, + ); + } + + @override + Future denyAllocation({required String token, required String allocationToken}) async { + await _httpClient.delete( + '/steward-allocation/0/?steward_allocation_key=$allocationToken', + headers: {'Authorization': 'Bearer $token'}, + ); + } + + @override + Future confirmAllAllocation({ + required String token, + required List allocationTokens, + }) async { + await _httpClient.put( + '/steward-allocation/0/', + headers: {'Authorization': 'Bearer $token'}, + data: {'steward_allocation_list': allocationTokens}, + ); + } + + @override + Future?> getRolesProducts({required String token}) async { + var res = await _httpClient.get( + '/roles-products/?role=Steward', + headers: {'Authorization': 'Bearer $token'}, + fromJsonList: (json) => + json.map((item) => ProductModel.fromJson(item as Map)).toList(), + ); + return res.data; + } + + @override + Future?> getGuilds({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/guilds/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJsonList: (json) => + json.map((item) => GuildModel.fromJson(item as Map)).toList(), + ); + return res.data; + } + + @override + Future getProfile({required String token}) async { + var res = await _httpClient.get( + '/guilds/0/?profile', + headers: {'Authorization': 'Bearer $token'}, + fromJson: GuildProfile.fromJson, + ); + return res.data; + } + + @override + Future postSubmitStewardAllocation({ + required String token, + required SubmitStewardAllocation request, + }) async { + await _httpClient.post( + '/steward-allocation/', + headers: {'Authorization': 'Bearer $token'}, + data: request.toJson(), + ); + } + + @override + Future deleteStewardAllocation({ + required String token, + Map? queryParameters, + }) async { + await _httpClient.delete( + '/steward-allocation/0/', + headers: {'Authorization': 'Bearer $token'}, + queryParameters: queryParameters, + ); + } + + @override + Future updateStewardAllocation({ + required String token, + required ConformAllocation request, + }) async { + await _httpClient.put( + '/steward-allocation/0/', + headers: {'Authorization': 'Bearer $token'}, + queryParameters: request.toJson(), + ); + } + + @override + Future getStewardDashboard({ + required String token, + required String stratDate, + required String endDate, + }) async { + var res = await _httpClient.get( + '/steward_free_bar_dashboard/?date1=$stratDate&date2=$endDate&search=filter', + headers: {'Authorization': 'Bearer $token'}, + fromJson: StewardFreeBarDashboard.fromJson, + ); + return res.data; + } + + @override + Future getDashboardKillHouseFreeBar({ + required String token, + required String stratDate, + required String endDate, + }) async { + var res = await _httpClient.get( + '/dashboard_kill_house_free_bar/?date1=$stratDate&date2=$endDate&search=filter', + headers: {'Authorization': 'Bearer $token'}, + fromJson: DashboardKillHouseFreeBar.fromJson, + ); + return res.data; + } + + @override + Future?> getStewardPurchasesOutSideOfTheProvince({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/steward_free_bar/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => StewardFreeBar.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future?> getCity({required String provinceName}) async { + var res = await _httpClient.get( + '/iran_city/', + queryParameters: {'name': provinceName}, + fromJsonList: (json) => + json.map((item) => IranProvinceCityModel.fromJson(item as Map)).toList(), + ); + return res.data; + } + + @override + Future?> getProvince({CancelToken? cancelToken}) async { + var res = await _httpClient.get( + '/iran_province/', + fromJsonList: (json) => + json.map((item) => IranProvinceCityModel.fromJson(item as Map)).toList(), + ); + return res.data; + } + + @override + Future createStewardPurchasesOutSideOfTheProvince({ + required String token, + required CreateStewardFreeBar body, + }) async { + var res = await _httpClient.post( + '/steward_free_bar/', + headers: {'Authorization': 'Bearer $token'}, + data: body.toJson(), + ); + } + + @override + Future deleteStewardPurchasesOutSideOfTheProvince({ + required String token, + required String stewardFreeBarKey, + }) async { + await _httpClient.delete( + '/steward_free_bar/0/', + headers: {'Authorization': 'Bearer $token'}, + queryParameters: {'key': stewardFreeBarKey}, + ); + } + + @override + Future?> getOutProvinceCarcassesBuyer({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/out-province-carcasses-buyer/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => OutProvinceCarcassesBuyer.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future createOutProvinceCarcassesBuyer({ + required String token, + required OutProvinceCarcassesBuyer body, + }) async { + await _httpClient.post( + '/out-province-carcasses-buyer/', + data: body.toJson()..removeWhere((key, value) => value == null), + headers: {'Authorization': 'Bearer $token'}, + ); + } + + @override + Future?> getStewardFreeSaleBar({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/steward_free_sale_bar/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => StewardFreeSaleBar.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future createOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }) async { + await _httpClient.post( + '/steward_free_sale_bar/', + data: body.toJson()..removeWhere((key, value) => value == null), + headers: {'Authorization': 'Bearer $token'}, + ); + } + + @override + Future updateOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }) async { + await _httpClient.put( + '/steward_free_sale_bar/0/', + data: body.toJson() + ..removeWhere((key, value) => value == null) + ..addAll({'carcassWeight': body.weightOfCarcasses, 'carcassCount': body.numberOfCarcasses}), + headers: {'Authorization': 'Bearer $token'}, + ); + } + + @override + Future getUserProfile({required String token}) async { + var res = await _httpClient.get( + '/system_user_profile/?self-profile', + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => UserProfile.fromJson(json), + ); + + return res.data; + } + + @override + Future updateUserProfile({required String token, required UserProfile userProfile}) async { + await _httpClient.put( + '/system_user_profile/0/', + headers: {'Authorization': 'Bearer $token'}, + data: userProfile.toJson()..removeWhere((key, value) => value == null), + ); + } + + @override + Future updatePassword({ + required String token, + required ChangePasswordRequestModel model, + }) async { + await _httpClient.post( + '/api/change_password/', + headers: {'Authorization': 'Bearer $token'}, + data: model.toJson()..removeWhere((key, value) => value == null), + ); + } + + @override + Future?> getSegmentation({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/app-segmentation/', + queryParameters: queryParameters, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => PaginationModel.fromJson( + json, + (json) => SegmentationModel.fromJson(json as Map), + ), + ); + return res.data; + } + + @override + Future createSegmentation({required String token, required SegmentationModel model}) async { + await _httpClient.post( + '/app-segmentation/', + data: model.toJson()..removeWhere((key, value) => value == null), + headers: {'Authorization': 'Bearer $token'}, + ); + } + + @override + Future editSegmentation({required String token, required SegmentationModel model}) async { + await _httpClient.put( + '/app-segmentation/0/', + data: model.toJson()..removeWhere((key, value) => value == null), + headers: {'Authorization': 'Bearer $token'}, + ); + } + + @override + Future deleteSegmentation({ + required String token, + required String key, + }) async { + var res = await _httpClient.delete( + '/app-segmentation/0/', + queryParameters: {'key': key}, + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) => SegmentationModel.fromJson(json), + ); + + return res.data; + } +} diff --git a/packages/chicken/lib/data/di/chicken_di.dart b/packages/chicken/lib/data/di/chicken_di.dart new file mode 100644 index 0000000..d85f410 --- /dev/null +++ b/packages/chicken/lib/data/di/chicken_di.dart @@ -0,0 +1,74 @@ +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/common/dio_error_handler.dart'; +import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart'; +import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.dart'; +import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart'; +import 'package:rasadyar_core/core.dart'; + +GetIt diChicken = GetIt.instance; + +Future setupChickenDI() async { + diChicken.registerSingleton(DioErrorHandler()); + var tokenService = Get.find(); + + diChicken.registerLazySingleton( + () => AppInterceptor( + //فعلا سامانه مرغ برای رفرش توکن چیزی ندارد + refreshTokenCallback: () async => null, + saveTokenCallback: (String newToken) async { + await tokenService.saveAccessToken(newToken); + }, + clearTokenCallback: () async { + await tokenService.deleteTokens(); + Get.offAllNamed(ChickenRoutes.auth, arguments: Module.chicken); + }, + ), + instanceName: 'chickenInterceptor', + ); + + diChicken.registerLazySingleton( + () => + DioRemote(interceptors: diChicken.get(instanceName: 'chickenInterceptor')), + ); + + final dioRemote = diChicken.get(); + await dioRemote.init(); + + diChicken.registerLazySingleton( + () => AuthRemoteDataSourceImp(diChicken.get()), + ); + + diChicken.registerLazySingleton( + () => AuthRepositoryImpl(diChicken.get()), + ); +} + +Future newSetupAuthDI(String newUrl) async { + var tokenService = Get.find(); + if (tokenService.baseurl.value == null) { + await tokenService.saveBaseUrl(newUrl); + } + + if (diChicken.isRegistered()) { + await diChicken.unregister(); + diChicken.registerLazySingleton( + () => DioRemote(baseUrl: newUrl, interceptors: diChicken.get()), + ); + final dioRemote = diChicken.get(); + await dioRemote.init(); + } + + if (diChicken.isRegistered()) { + await diChicken.unregister(); + diChicken.registerLazySingleton( + () => AuthRemoteDataSourceImp(diChicken.get()), + ); + } + + if (diChicken.isRegistered()) { + await diChicken.unregister(); + diChicken.registerLazySingleton( + () => AuthRepositoryImpl(diChicken.get()), + ); + } +} diff --git a/packages/chicken/lib/data/models/local/widely_used_local_model.dart b/packages/chicken/lib/data/models/local/widely_used_local_model.dart new file mode 100644 index 0000000..02d89c7 --- /dev/null +++ b/packages/chicken/lib/data/models/local/widely_used_local_model.dart @@ -0,0 +1,73 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/utils/utils.dart'; + +part 'widely_used_local_model.g.dart'; + +@HiveType(typeId: chickenWidelyUsedLocalModelTypeId) +class WidelyUsedLocalModel extends HiveObject { + @HiveField(0) + bool? hasInit; + + @HiveField(1) + List? items; + + WidelyUsedLocalModel({this.hasInit, this.items}); + + WidelyUsedLocalModel copyWith({bool? hasInit, List? items}) { + return WidelyUsedLocalModel(hasInit: hasInit ?? this.hasInit, items: items ?? this.items); + } +} + +@HiveType(typeId: chickenWidelyUsedLocalItemTypeId) +class WidelyUsedLocalItem extends HiveObject { + @HiveField(0) + String? title; + + @HiveField(1) + String? iconPath; + + @HiveField(2) + int? iconColor; + + @HiveField(3) + int? color; + + @HiveField(4) + String? path; + + @HiveField(5) + int? pathId; + + @HiveField(6) + int? index; + + WidelyUsedLocalItem({ + this.title, + this.iconPath, + this.iconColor, + this.color, + this.path, + this.pathId, + this.index, + }); + + WidelyUsedLocalItem copyWith({ + String? title, + String? iconPath, + int? iconColor, + int? color, + int? pathId, + int? index, + String? path, + }) { + return WidelyUsedLocalItem( + title: title ?? this.title, + iconPath: iconPath ?? this.iconPath, + iconColor: iconColor ?? this.iconColor, + color: color ?? this.color, + path: path ?? this.path, + pathId: pathId ?? this.pathId, + index: index ?? this.index, + ); + } +} diff --git a/packages/chicken/lib/data/models/local/widely_used_local_model.g.dart b/packages/chicken/lib/data/models/local/widely_used_local_model.g.dart new file mode 100644 index 0000000..271c009 --- /dev/null +++ b/packages/chicken/lib/data/models/local/widely_used_local_model.g.dart @@ -0,0 +1,96 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'widely_used_local_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class WidelyUsedLocalModelAdapter extends TypeAdapter { + @override + final typeId = 2; + + @override + WidelyUsedLocalModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return WidelyUsedLocalModel( + hasInit: fields[0] as bool?, + items: (fields[1] as List?)?.cast(), + ); + } + + @override + void write(BinaryWriter writer, WidelyUsedLocalModel obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.hasInit) + ..writeByte(1) + ..write(obj.items); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is WidelyUsedLocalModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class WidelyUsedLocalItemAdapter extends TypeAdapter { + @override + final typeId = 3; + + @override + WidelyUsedLocalItem read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return WidelyUsedLocalItem( + title: fields[0] as String?, + iconPath: fields[1] as String?, + iconColor: (fields[2] as num?)?.toInt(), + color: (fields[3] as num?)?.toInt(), + path: fields[4] as String?, + pathId: (fields[5] as num?)?.toInt(), + index: (fields[6] as num?)?.toInt(), + ); + } + + @override + void write(BinaryWriter writer, WidelyUsedLocalItem obj) { + writer + ..writeByte(7) + ..writeByte(0) + ..write(obj.title) + ..writeByte(1) + ..write(obj.iconPath) + ..writeByte(2) + ..write(obj.iconColor) + ..writeByte(3) + ..write(obj.color) + ..writeByte(4) + ..write(obj.path) + ..writeByte(5) + ..write(obj.pathId) + ..writeByte(6) + ..write(obj.index); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is WidelyUsedLocalItemAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/packages/chicken/lib/data/models/request/change_password/change_password_request_model.dart b/packages/chicken/lib/data/models/request/change_password/change_password_request_model.dart new file mode 100644 index 0000000..b5a94a2 --- /dev/null +++ b/packages/chicken/lib/data/models/request/change_password/change_password_request_model.dart @@ -0,0 +1,18 @@ + +import 'package:rasadyar_core/core.dart'; + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'change_password_request_model.freezed.dart'; +part 'change_password_request_model.g.dart'; + +@freezed +abstract class ChangePasswordRequestModel with _$ChangePasswordRequestModel { + const factory ChangePasswordRequestModel({ + String? username, + String? password, + }) = _ChangePasswordRequestModel; + + factory ChangePasswordRequestModel.fromJson(Map json) => + _$ChangePasswordRequestModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/request/change_password/change_password_request_model.freezed.dart b/packages/chicken/lib/data/models/request/change_password/change_password_request_model.freezed.dart new file mode 100644 index 0000000..b9f8687 --- /dev/null +++ b/packages/chicken/lib/data/models/request/change_password/change_password_request_model.freezed.dart @@ -0,0 +1,280 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'change_password_request_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$ChangePasswordRequestModel { + + String? get username; String? get password; +/// Create a copy of ChangePasswordRequestModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ChangePasswordRequestModelCopyWith get copyWith => _$ChangePasswordRequestModelCopyWithImpl(this as ChangePasswordRequestModel, _$identity); + + /// Serializes this ChangePasswordRequestModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,username,password); + +@override +String toString() { + return 'ChangePasswordRequestModel(username: $username, password: $password)'; +} + + +} + +/// @nodoc +abstract mixin class $ChangePasswordRequestModelCopyWith<$Res> { + factory $ChangePasswordRequestModelCopyWith(ChangePasswordRequestModel value, $Res Function(ChangePasswordRequestModel) _then) = _$ChangePasswordRequestModelCopyWithImpl; +@useResult +$Res call({ + String? username, String? password +}); + + + + +} +/// @nodoc +class _$ChangePasswordRequestModelCopyWithImpl<$Res> + implements $ChangePasswordRequestModelCopyWith<$Res> { + _$ChangePasswordRequestModelCopyWithImpl(this._self, this._then); + + final ChangePasswordRequestModel _self; + final $Res Function(ChangePasswordRequestModel) _then; + +/// Create a copy of ChangePasswordRequestModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,}) { + return _then(_self.copyWith( +username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ChangePasswordRequestModel]. +extension ChangePasswordRequestModelPatterns on ChangePasswordRequestModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ChangePasswordRequestModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ChangePasswordRequestModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ChangePasswordRequestModel value) $default,){ +final _that = this; +switch (_that) { +case _ChangePasswordRequestModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ChangePasswordRequestModel value)? $default,){ +final _that = this; +switch (_that) { +case _ChangePasswordRequestModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? username, String? password)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ChangePasswordRequestModel() when $default != null: +return $default(_that.username,_that.password);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? username, String? password) $default,) {final _that = this; +switch (_that) { +case _ChangePasswordRequestModel(): +return $default(_that.username,_that.password);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? username, String? password)? $default,) {final _that = this; +switch (_that) { +case _ChangePasswordRequestModel() when $default != null: +return $default(_that.username,_that.password);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ChangePasswordRequestModel implements ChangePasswordRequestModel { + const _ChangePasswordRequestModel({this.username, this.password}); + factory _ChangePasswordRequestModel.fromJson(Map json) => _$ChangePasswordRequestModelFromJson(json); + +@override final String? username; +@override final String? password; + +/// Create a copy of ChangePasswordRequestModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ChangePasswordRequestModelCopyWith<_ChangePasswordRequestModel> get copyWith => __$ChangePasswordRequestModelCopyWithImpl<_ChangePasswordRequestModel>(this, _$identity); + +@override +Map toJson() { + return _$ChangePasswordRequestModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,username,password); + +@override +String toString() { + return 'ChangePasswordRequestModel(username: $username, password: $password)'; +} + + +} + +/// @nodoc +abstract mixin class _$ChangePasswordRequestModelCopyWith<$Res> implements $ChangePasswordRequestModelCopyWith<$Res> { + factory _$ChangePasswordRequestModelCopyWith(_ChangePasswordRequestModel value, $Res Function(_ChangePasswordRequestModel) _then) = __$ChangePasswordRequestModelCopyWithImpl; +@override @useResult +$Res call({ + String? username, String? password +}); + + + + +} +/// @nodoc +class __$ChangePasswordRequestModelCopyWithImpl<$Res> + implements _$ChangePasswordRequestModelCopyWith<$Res> { + __$ChangePasswordRequestModelCopyWithImpl(this._self, this._then); + + final _ChangePasswordRequestModel _self; + final $Res Function(_ChangePasswordRequestModel) _then; + +/// Create a copy of ChangePasswordRequestModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,}) { + return _then(_ChangePasswordRequestModel( +username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/change_password/change_password_request_model.g.dart b/packages/chicken/lib/data/models/request/change_password/change_password_request_model.g.dart new file mode 100644 index 0000000..ca0cf6b --- /dev/null +++ b/packages/chicken/lib/data/models/request/change_password/change_password_request_model.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'change_password_request_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_ChangePasswordRequestModel _$ChangePasswordRequestModelFromJson( + Map json, +) => _ChangePasswordRequestModel( + username: json['username'] as String?, + password: json['password'] as String?, +); + +Map _$ChangePasswordRequestModelToJson( + _ChangePasswordRequestModel instance, +) => { + 'username': instance.username, + 'password': instance.password, +}; diff --git a/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.dart b/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.dart new file mode 100644 index 0000000..34cb139 --- /dev/null +++ b/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'conform_allocation.freezed.dart'; +part 'conform_allocation.g.dart'; + +@freezed +abstract class ConformAllocation with _$ConformAllocation { + factory ConformAllocation({ + String? allocation_key, + int? number_of_carcasses, + int? weight_of_carcasses, + int? amount, + int? total_amount, + }) = _ConformAllocation; + + factory ConformAllocation.fromJson(Map json) => + _$ConformAllocationFromJson(json); +} diff --git a/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.freezed.dart b/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.freezed.dart new file mode 100644 index 0000000..bfa3fe6 --- /dev/null +++ b/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.freezed.dart @@ -0,0 +1,289 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'conform_allocation.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$ConformAllocation { + + String? get allocation_key; int? get number_of_carcasses; int? get weight_of_carcasses; int? get amount; int? get total_amount; +/// Create a copy of ConformAllocation +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConformAllocationCopyWith get copyWith => _$ConformAllocationCopyWithImpl(this as ConformAllocation, _$identity); + + /// Serializes this ConformAllocation to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount); + +@override +String toString() { + return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)'; +} + + +} + +/// @nodoc +abstract mixin class $ConformAllocationCopyWith<$Res> { + factory $ConformAllocationCopyWith(ConformAllocation value, $Res Function(ConformAllocation) _then) = _$ConformAllocationCopyWithImpl; +@useResult +$Res call({ + String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount +}); + + + + +} +/// @nodoc +class _$ConformAllocationCopyWithImpl<$Res> + implements $ConformAllocationCopyWith<$Res> { + _$ConformAllocationCopyWithImpl(this._self, this._then); + + final ConformAllocation _self; + final $Res Function(ConformAllocation) _then; + +/// Create a copy of ConformAllocation +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) { + return _then(_self.copyWith( +allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable +as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable +as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConformAllocation]. +extension ConformAllocationPatterns on ConformAllocation { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConformAllocation value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConformAllocation() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConformAllocation value) $default,){ +final _that = this; +switch (_that) { +case _ConformAllocation(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConformAllocation value)? $default,){ +final _that = this; +switch (_that) { +case _ConformAllocation() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConformAllocation() when $default != null: +return $default(_that.allocation_key,_that.number_of_carcasses,_that.weight_of_carcasses,_that.amount,_that.total_amount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount) $default,) {final _that = this; +switch (_that) { +case _ConformAllocation(): +return $default(_that.allocation_key,_that.number_of_carcasses,_that.weight_of_carcasses,_that.amount,_that.total_amount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount)? $default,) {final _that = this; +switch (_that) { +case _ConformAllocation() when $default != null: +return $default(_that.allocation_key,_that.number_of_carcasses,_that.weight_of_carcasses,_that.amount,_that.total_amount);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ConformAllocation implements ConformAllocation { + _ConformAllocation({this.allocation_key, this.number_of_carcasses, this.weight_of_carcasses, this.amount, this.total_amount}); + factory _ConformAllocation.fromJson(Map json) => _$ConformAllocationFromJson(json); + +@override final String? allocation_key; +@override final int? number_of_carcasses; +@override final int? weight_of_carcasses; +@override final int? amount; +@override final int? total_amount; + +/// Create a copy of ConformAllocation +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConformAllocationCopyWith<_ConformAllocation> get copyWith => __$ConformAllocationCopyWithImpl<_ConformAllocation>(this, _$identity); + +@override +Map toJson() { + return _$ConformAllocationToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount); + +@override +String toString() { + return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConformAllocationCopyWith<$Res> implements $ConformAllocationCopyWith<$Res> { + factory _$ConformAllocationCopyWith(_ConformAllocation value, $Res Function(_ConformAllocation) _then) = __$ConformAllocationCopyWithImpl; +@override @useResult +$Res call({ + String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount +}); + + + + +} +/// @nodoc +class __$ConformAllocationCopyWithImpl<$Res> + implements _$ConformAllocationCopyWith<$Res> { + __$ConformAllocationCopyWithImpl(this._self, this._then); + + final _ConformAllocation _self; + final $Res Function(_ConformAllocation) _then; + +/// Create a copy of ConformAllocation +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) { + return _then(_ConformAllocation( +allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable +as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable +as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.g.dart b/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.g.dart new file mode 100644 index 0000000..a4a1b45 --- /dev/null +++ b/packages/chicken/lib/data/models/request/conform_allocation/conform_allocation.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'conform_allocation.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_ConformAllocation _$ConformAllocationFromJson(Map json) => + _ConformAllocation( + allocation_key: json['allocation_key'] as String?, + number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(), + amount: (json['amount'] as num?)?.toInt(), + total_amount: (json['total_amount'] as num?)?.toInt(), + ); + +Map _$ConformAllocationToJson(_ConformAllocation instance) => + { + 'allocation_key': instance.allocation_key, + 'number_of_carcasses': instance.number_of_carcasses, + 'weight_of_carcasses': instance.weight_of_carcasses, + 'amount': instance.amount, + 'total_amount': instance.total_amount, + }; diff --git a/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.dart b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.dart new file mode 100644 index 0000000..85a32aa --- /dev/null +++ b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.dart @@ -0,0 +1,21 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'create_steward_free_bar.freezed.dart'; +part 'create_steward_free_bar.g.dart'; + +@freezed +abstract class CreateStewardFreeBar with _$CreateStewardFreeBar { + const factory CreateStewardFreeBar({ + String? productKey, + String? killHouseName, + String? killHouseMobile, + String? province, + String? city, + int? weightOfCarcasses, + String? date, + String? barImage, + }) = _CreateStewardFreeBar; + + factory CreateStewardFreeBar.fromJson(Map json) => + _$CreateStewardFreeBarFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.freezed.dart b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.freezed.dart new file mode 100644 index 0000000..19ddf79 --- /dev/null +++ b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.freezed.dart @@ -0,0 +1,298 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'create_steward_free_bar.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$CreateStewardFreeBar { + + String? get productKey; String? get killHouseName; String? get killHouseMobile; String? get province; String? get city; int? get weightOfCarcasses; String? get date; String? get barImage; +/// Create a copy of CreateStewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CreateStewardFreeBarCopyWith get copyWith => _$CreateStewardFreeBarCopyWithImpl(this as CreateStewardFreeBar, _$identity); + + /// Serializes this CreateStewardFreeBar to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateStewardFreeBar&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.barImage, barImage) || other.barImage == barImage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,productKey,killHouseName,killHouseMobile,province,city,weightOfCarcasses,date,barImage); + +@override +String toString() { + return 'CreateStewardFreeBar(productKey: $productKey, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, province: $province, city: $city, weightOfCarcasses: $weightOfCarcasses, date: $date, barImage: $barImage)'; +} + + +} + +/// @nodoc +abstract mixin class $CreateStewardFreeBarCopyWith<$Res> { + factory $CreateStewardFreeBarCopyWith(CreateStewardFreeBar value, $Res Function(CreateStewardFreeBar) _then) = _$CreateStewardFreeBarCopyWithImpl; +@useResult +$Res call({ + String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage +}); + + + + +} +/// @nodoc +class _$CreateStewardFreeBarCopyWithImpl<$Res> + implements $CreateStewardFreeBarCopyWith<$Res> { + _$CreateStewardFreeBarCopyWithImpl(this._self, this._then); + + final CreateStewardFreeBar _self; + final $Res Function(CreateStewardFreeBar) _then; + +/// Create a copy of CreateStewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? productKey = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? province = freezed,Object? city = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? barImage = freezed,}) { + return _then(_self.copyWith( +productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,killHouseName: freezed == killHouseName ? _self.killHouseName : killHouseName // ignore: cast_nullable_to_non_nullable +as String?,killHouseMobile: freezed == killHouseMobile ? _self.killHouseMobile : killHouseMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CreateStewardFreeBar]. +extension CreateStewardFreeBarPatterns on CreateStewardFreeBar { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreateStewardFreeBar value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreateStewardFreeBar() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreateStewardFreeBar value) $default,){ +final _that = this; +switch (_that) { +case _CreateStewardFreeBar(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreateStewardFreeBar value)? $default,){ +final _that = this; +switch (_that) { +case _CreateStewardFreeBar() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreateStewardFreeBar() when $default != null: +return $default(_that.productKey,_that.killHouseName,_that.killHouseMobile,_that.province,_that.city,_that.weightOfCarcasses,_that.date,_that.barImage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage) $default,) {final _that = this; +switch (_that) { +case _CreateStewardFreeBar(): +return $default(_that.productKey,_that.killHouseName,_that.killHouseMobile,_that.province,_that.city,_that.weightOfCarcasses,_that.date,_that.barImage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage)? $default,) {final _that = this; +switch (_that) { +case _CreateStewardFreeBar() when $default != null: +return $default(_that.productKey,_that.killHouseName,_that.killHouseMobile,_that.province,_that.city,_that.weightOfCarcasses,_that.date,_that.barImage);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CreateStewardFreeBar implements CreateStewardFreeBar { + const _CreateStewardFreeBar({this.productKey, this.killHouseName, this.killHouseMobile, this.province, this.city, this.weightOfCarcasses, this.date, this.barImage}); + factory _CreateStewardFreeBar.fromJson(Map json) => _$CreateStewardFreeBarFromJson(json); + +@override final String? productKey; +@override final String? killHouseName; +@override final String? killHouseMobile; +@override final String? province; +@override final String? city; +@override final int? weightOfCarcasses; +@override final String? date; +@override final String? barImage; + +/// Create a copy of CreateStewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateStewardFreeBarCopyWith<_CreateStewardFreeBar> get copyWith => __$CreateStewardFreeBarCopyWithImpl<_CreateStewardFreeBar>(this, _$identity); + +@override +Map toJson() { + return _$CreateStewardFreeBarToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateStewardFreeBar&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.barImage, barImage) || other.barImage == barImage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,productKey,killHouseName,killHouseMobile,province,city,weightOfCarcasses,date,barImage); + +@override +String toString() { + return 'CreateStewardFreeBar(productKey: $productKey, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, province: $province, city: $city, weightOfCarcasses: $weightOfCarcasses, date: $date, barImage: $barImage)'; +} + + +} + +/// @nodoc +abstract mixin class _$CreateStewardFreeBarCopyWith<$Res> implements $CreateStewardFreeBarCopyWith<$Res> { + factory _$CreateStewardFreeBarCopyWith(_CreateStewardFreeBar value, $Res Function(_CreateStewardFreeBar) _then) = __$CreateStewardFreeBarCopyWithImpl; +@override @useResult +$Res call({ + String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage +}); + + + + +} +/// @nodoc +class __$CreateStewardFreeBarCopyWithImpl<$Res> + implements _$CreateStewardFreeBarCopyWith<$Res> { + __$CreateStewardFreeBarCopyWithImpl(this._self, this._then); + + final _CreateStewardFreeBar _self; + final $Res Function(_CreateStewardFreeBar) _then; + +/// Create a copy of CreateStewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? productKey = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? province = freezed,Object? city = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? barImage = freezed,}) { + return _then(_CreateStewardFreeBar( +productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,killHouseName: freezed == killHouseName ? _self.killHouseName : killHouseName // ignore: cast_nullable_to_non_nullable +as String?,killHouseMobile: freezed == killHouseMobile ? _self.killHouseMobile : killHouseMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.g.dart b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.g.dart new file mode 100644 index 0000000..50b4a74 --- /dev/null +++ b/packages/chicken/lib/data/models/request/create_steward_free_bar/create_steward_free_bar.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'create_steward_free_bar.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_CreateStewardFreeBar _$CreateStewardFreeBarFromJson( + Map json, +) => _CreateStewardFreeBar( + productKey: json['product_key'] as String?, + killHouseName: json['kill_house_name'] as String?, + killHouseMobile: json['kill_house_mobile'] as String?, + province: json['province'] as String?, + city: json['city'] as String?, + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(), + date: json['date'] as String?, + barImage: json['bar_image'] as String?, +); + +Map _$CreateStewardFreeBarToJson( + _CreateStewardFreeBar instance, +) => { + 'product_key': instance.productKey, + 'kill_house_name': instance.killHouseName, + 'kill_house_mobile': instance.killHouseMobile, + 'province': instance.province, + 'city': instance.city, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'date': instance.date, + 'bar_image': instance.barImage, +}; diff --git a/packages/chicken/lib/data/models/request/login_request/login_request_model.dart b/packages/chicken/lib/data/models/request/login_request/login_request_model.dart new file mode 100644 index 0000000..0e76bc2 --- /dev/null +++ b/packages/chicken/lib/data/models/request/login_request/login_request_model.dart @@ -0,0 +1,34 @@ +import 'package:rasadyar_core/core.dart'; + +part 'login_request_model.freezed.dart'; +part 'login_request_model.g.dart'; + +@freezed +abstract class LoginRequestModel with _$LoginRequestModel { + const factory LoginRequestModel({ + String? username, + String? password, + String? captchaCode, + String? captchaKey, + }) = _LoginRequestModel; + + factory LoginRequestModel.createWithCaptcha({ + required String username, + required String password, + required String captchaCode, + required String captchaKey, + }) { + return LoginRequestModel( + username: username, + password: password, + captchaCode: captchaCode, + captchaKey: 'rest_captcha_$captchaKey.0', + ); + } + + factory LoginRequestModel.fromJson(Map json) => + _$LoginRequestModelFromJson(json); + + const LoginRequestModel._(); + +} diff --git a/packages/chicken/lib/data/models/request/login_request/login_request_model.freezed.dart b/packages/chicken/lib/data/models/request/login_request/login_request_model.freezed.dart new file mode 100644 index 0000000..9b91ad6 --- /dev/null +++ b/packages/chicken/lib/data/models/request/login_request/login_request_model.freezed.dart @@ -0,0 +1,286 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'login_request_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$LoginRequestModel { + + String? get username; String? get password; String? get captchaCode; String? get captchaKey; +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LoginRequestModelCopyWith get copyWith => _$LoginRequestModelCopyWithImpl(this as LoginRequestModel, _$identity); + + /// Serializes this LoginRequestModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LoginRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.captchaCode, captchaCode) || other.captchaCode == captchaCode)&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,username,password,captchaCode,captchaKey); + +@override +String toString() { + return 'LoginRequestModel(username: $username, password: $password, captchaCode: $captchaCode, captchaKey: $captchaKey)'; +} + + +} + +/// @nodoc +abstract mixin class $LoginRequestModelCopyWith<$Res> { + factory $LoginRequestModelCopyWith(LoginRequestModel value, $Res Function(LoginRequestModel) _then) = _$LoginRequestModelCopyWithImpl; +@useResult +$Res call({ + String? username, String? password, String? captchaCode, String? captchaKey +}); + + + + +} +/// @nodoc +class _$LoginRequestModelCopyWithImpl<$Res> + implements $LoginRequestModelCopyWith<$Res> { + _$LoginRequestModelCopyWithImpl(this._self, this._then); + + final LoginRequestModel _self; + final $Res Function(LoginRequestModel) _then; + +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,Object? captchaCode = freezed,Object? captchaKey = freezed,}) { + return _then(_self.copyWith( +username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?,captchaCode: freezed == captchaCode ? _self.captchaCode : captchaCode // ignore: cast_nullable_to_non_nullable +as String?,captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [LoginRequestModel]. +extension LoginRequestModelPatterns on LoginRequestModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LoginRequestModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LoginRequestModel value) $default,){ +final _that = this; +switch (_that) { +case _LoginRequestModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LoginRequestModel value)? $default,){ +final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? username, String? password, String? captchaCode, String? captchaKey)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? username, String? password, String? captchaCode, String? captchaKey) $default,) {final _that = this; +switch (_that) { +case _LoginRequestModel(): +return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? username, String? password, String? captchaCode, String? captchaKey)? $default,) {final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _LoginRequestModel extends LoginRequestModel { + const _LoginRequestModel({this.username, this.password, this.captchaCode, this.captchaKey}): super._(); + factory _LoginRequestModel.fromJson(Map json) => _$LoginRequestModelFromJson(json); + +@override final String? username; +@override final String? password; +@override final String? captchaCode; +@override final String? captchaKey; + +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LoginRequestModelCopyWith<_LoginRequestModel> get copyWith => __$LoginRequestModelCopyWithImpl<_LoginRequestModel>(this, _$identity); + +@override +Map toJson() { + return _$LoginRequestModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoginRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.captchaCode, captchaCode) || other.captchaCode == captchaCode)&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,username,password,captchaCode,captchaKey); + +@override +String toString() { + return 'LoginRequestModel(username: $username, password: $password, captchaCode: $captchaCode, captchaKey: $captchaKey)'; +} + + +} + +/// @nodoc +abstract mixin class _$LoginRequestModelCopyWith<$Res> implements $LoginRequestModelCopyWith<$Res> { + factory _$LoginRequestModelCopyWith(_LoginRequestModel value, $Res Function(_LoginRequestModel) _then) = __$LoginRequestModelCopyWithImpl; +@override @useResult +$Res call({ + String? username, String? password, String? captchaCode, String? captchaKey +}); + + + + +} +/// @nodoc +class __$LoginRequestModelCopyWithImpl<$Res> + implements _$LoginRequestModelCopyWith<$Res> { + __$LoginRequestModelCopyWithImpl(this._self, this._then); + + final _LoginRequestModel _self; + final $Res Function(_LoginRequestModel) _then; + +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,Object? captchaCode = freezed,Object? captchaKey = freezed,}) { + return _then(_LoginRequestModel( +username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?,captchaCode: freezed == captchaCode ? _self.captchaCode : captchaCode // ignore: cast_nullable_to_non_nullable +as String?,captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/login_request/login_request_model.g.dart b/packages/chicken/lib/data/models/request/login_request/login_request_model.g.dart new file mode 100644 index 0000000..4504142 --- /dev/null +++ b/packages/chicken/lib/data/models/request/login_request/login_request_model.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'login_request_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_LoginRequestModel _$LoginRequestModelFromJson(Map json) => + _LoginRequestModel( + username: json['username'] as String?, + password: json['password'] as String?, + captchaCode: json['captcha_code'] as String?, + captchaKey: json['captcha_key'] as String?, + ); + +Map _$LoginRequestModelToJson(_LoginRequestModel instance) => + { + 'username': instance.username, + 'password': instance.password, + 'captcha_code': instance.captchaCode, + 'captcha_key': instance.captchaKey, + }; diff --git a/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.dart b/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.dart new file mode 100644 index 0000000..d041ddf --- /dev/null +++ b/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.dart @@ -0,0 +1,20 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'steward_allocation_request.freezed.dart'; +part 'steward_allocation_request.g.dart'; + +@freezed +abstract class StewardAllocationRequest with _$StewardAllocationRequest { + const factory StewardAllocationRequest({ + bool? checkAllocation, + String? allocationKey, + String? state, + int? registrationCode, + int? receiverRealNumberOfCarcasses, + int? receiverRealWeightOfCarcasses, + int? weightLossOfCarcasses, + }) = _StewardAllocationRequest; + + factory StewardAllocationRequest.fromJson(Map json) => + _$StewardAllocationRequestFromJson(json); +} diff --git a/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.freezed.dart b/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.freezed.dart new file mode 100644 index 0000000..1ac5810 --- /dev/null +++ b/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.freezed.dart @@ -0,0 +1,295 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'steward_allocation_request.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$StewardAllocationRequest { + + bool? get checkAllocation; String? get allocationKey; String? get state; int? get registrationCode; int? get receiverRealNumberOfCarcasses; int? get receiverRealWeightOfCarcasses; int? get weightLossOfCarcasses; +/// Create a copy of StewardAllocationRequest +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardAllocationRequestCopyWith get copyWith => _$StewardAllocationRequestCopyWithImpl(this as StewardAllocationRequest, _$identity); + + /// Serializes this StewardAllocationRequest to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses); + +@override +String toString() { + return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardAllocationRequestCopyWith<$Res> { + factory $StewardAllocationRequestCopyWith(StewardAllocationRequest value, $Res Function(StewardAllocationRequest) _then) = _$StewardAllocationRequestCopyWithImpl; +@useResult +$Res call({ + bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses +}); + + + + +} +/// @nodoc +class _$StewardAllocationRequestCopyWithImpl<$Res> + implements $StewardAllocationRequestCopyWith<$Res> { + _$StewardAllocationRequestCopyWithImpl(this._self, this._then); + + final StewardAllocationRequest _self; + final $Res Function(StewardAllocationRequest) _then; + +/// Create a copy of StewardAllocationRequest +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) { + return _then(_self.copyWith( +checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable +as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [StewardAllocationRequest]. +extension StewardAllocationRequestPatterns on StewardAllocationRequest { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardAllocationRequest value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardAllocationRequest() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardAllocationRequest value) $default,){ +final _that = this; +switch (_that) { +case _StewardAllocationRequest(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardAllocationRequest value)? $default,){ +final _that = this; +switch (_that) { +case _StewardAllocationRequest() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardAllocationRequest() when $default != null: +return $default(_that.checkAllocation,_that.allocationKey,_that.state,_that.registrationCode,_that.receiverRealNumberOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses) $default,) {final _that = this; +switch (_that) { +case _StewardAllocationRequest(): +return $default(_that.checkAllocation,_that.allocationKey,_that.state,_that.registrationCode,_that.receiverRealNumberOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses)? $default,) {final _that = this; +switch (_that) { +case _StewardAllocationRequest() when $default != null: +return $default(_that.checkAllocation,_that.allocationKey,_that.state,_that.registrationCode,_that.receiverRealNumberOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardAllocationRequest implements StewardAllocationRequest { + const _StewardAllocationRequest({this.checkAllocation, this.allocationKey, this.state, this.registrationCode, this.receiverRealNumberOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses}); + factory _StewardAllocationRequest.fromJson(Map json) => _$StewardAllocationRequestFromJson(json); + +@override final bool? checkAllocation; +@override final String? allocationKey; +@override final String? state; +@override final int? registrationCode; +@override final int? receiverRealNumberOfCarcasses; +@override final int? receiverRealWeightOfCarcasses; +@override final int? weightLossOfCarcasses; + +/// Create a copy of StewardAllocationRequest +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardAllocationRequestCopyWith<_StewardAllocationRequest> get copyWith => __$StewardAllocationRequestCopyWithImpl<_StewardAllocationRequest>(this, _$identity); + +@override +Map toJson() { + return _$StewardAllocationRequestToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses); + +@override +String toString() { + return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardAllocationRequestCopyWith<$Res> implements $StewardAllocationRequestCopyWith<$Res> { + factory _$StewardAllocationRequestCopyWith(_StewardAllocationRequest value, $Res Function(_StewardAllocationRequest) _then) = __$StewardAllocationRequestCopyWithImpl; +@override @useResult +$Res call({ + bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses +}); + + + + +} +/// @nodoc +class __$StewardAllocationRequestCopyWithImpl<$Res> + implements _$StewardAllocationRequestCopyWith<$Res> { + __$StewardAllocationRequestCopyWithImpl(this._self, this._then); + + final _StewardAllocationRequest _self; + final $Res Function(_StewardAllocationRequest) _then; + +/// Create a copy of StewardAllocationRequest +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) { + return _then(_StewardAllocationRequest( +checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable +as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.g.dart b/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.g.dart new file mode 100644 index 0000000..d463989 --- /dev/null +++ b/packages/chicken/lib/data/models/request/steward_allocation/steward_allocation_request.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'steward_allocation_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_StewardAllocationRequest _$StewardAllocationRequestFromJson( + Map json, +) => _StewardAllocationRequest( + checkAllocation: json['check_allocation'] as bool?, + allocationKey: json['allocation_key'] as String?, + state: json['state'] as String?, + registrationCode: (json['registration_code'] as num?)?.toInt(), + receiverRealNumberOfCarcasses: + (json['receiver_real_number_of_carcasses'] as num?)?.toInt(), + receiverRealWeightOfCarcasses: + (json['receiver_real_weight_of_carcasses'] as num?)?.toInt(), + weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(), +); + +Map _$StewardAllocationRequestToJson( + _StewardAllocationRequest instance, +) => { + 'check_allocation': instance.checkAllocation, + 'allocation_key': instance.allocationKey, + 'state': instance.state, + 'registration_code': instance.registrationCode, + 'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses, + 'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses, + 'weight_loss_of_carcasses': instance.weightLossOfCarcasses, +}; diff --git a/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart b/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart new file mode 100644 index 0000000..dd99fab --- /dev/null +++ b/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart @@ -0,0 +1,20 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'steward_free_sale_bar_request.freezed.dart'; +part 'steward_free_sale_bar_request.g.dart'; + +@freezed +abstract class StewardFreeSaleBarRequest with _$StewardFreeSaleBarRequest { + const factory StewardFreeSaleBarRequest({ + String? buyerKey, + int? numberOfCarcasses, + int? weightOfCarcasses, + String? date, + String? clearanceCode, + String? productKey, + String? key, + }) = _StewardFreeSaleBarRequest; + + factory StewardFreeSaleBarRequest.fromJson(Map json) => + _$StewardFreeSaleBarRequestFromJson(json); +} diff --git a/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.freezed.dart b/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.freezed.dart new file mode 100644 index 0000000..20c21ba --- /dev/null +++ b/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.freezed.dart @@ -0,0 +1,295 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'steward_free_sale_bar_request.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$StewardFreeSaleBarRequest { + + String? get buyerKey; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get date; String? get clearanceCode; String? get productKey; String? get key; +/// Create a copy of StewardFreeSaleBarRequest +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardFreeSaleBarRequestCopyWith get copyWith => _$StewardFreeSaleBarRequestCopyWithImpl(this as StewardFreeSaleBarRequest, _$identity); + + /// Serializes this StewardFreeSaleBarRequest to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeSaleBarRequest&&(identical(other.buyerKey, buyerKey) || other.buyerKey == buyerKey)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.key, key) || other.key == key)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,buyerKey,numberOfCarcasses,weightOfCarcasses,date,clearanceCode,productKey,key); + +@override +String toString() { + return 'StewardFreeSaleBarRequest(buyerKey: $buyerKey, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, date: $date, clearanceCode: $clearanceCode, productKey: $productKey, key: $key)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardFreeSaleBarRequestCopyWith<$Res> { + factory $StewardFreeSaleBarRequestCopyWith(StewardFreeSaleBarRequest value, $Res Function(StewardFreeSaleBarRequest) _then) = _$StewardFreeSaleBarRequestCopyWithImpl; +@useResult +$Res call({ + String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key +}); + + + + +} +/// @nodoc +class _$StewardFreeSaleBarRequestCopyWithImpl<$Res> + implements $StewardFreeSaleBarRequestCopyWith<$Res> { + _$StewardFreeSaleBarRequestCopyWithImpl(this._self, this._then); + + final StewardFreeSaleBarRequest _self; + final $Res Function(StewardFreeSaleBarRequest) _then; + +/// Create a copy of StewardFreeSaleBarRequest +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? buyerKey = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? clearanceCode = freezed,Object? productKey = freezed,Object? key = freezed,}) { + return _then(_self.copyWith( +buyerKey: freezed == buyerKey ? _self.buyerKey : buyerKey // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [StewardFreeSaleBarRequest]. +extension StewardFreeSaleBarRequestPatterns on StewardFreeSaleBarRequest { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardFreeSaleBarRequest value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardFreeSaleBarRequest() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardFreeSaleBarRequest value) $default,){ +final _that = this; +switch (_that) { +case _StewardFreeSaleBarRequest(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardFreeSaleBarRequest value)? $default,){ +final _that = this; +switch (_that) { +case _StewardFreeSaleBarRequest() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardFreeSaleBarRequest() when $default != null: +return $default(_that.buyerKey,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.clearanceCode,_that.productKey,_that.key);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key) $default,) {final _that = this; +switch (_that) { +case _StewardFreeSaleBarRequest(): +return $default(_that.buyerKey,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.clearanceCode,_that.productKey,_that.key);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key)? $default,) {final _that = this; +switch (_that) { +case _StewardFreeSaleBarRequest() when $default != null: +return $default(_that.buyerKey,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.clearanceCode,_that.productKey,_that.key);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardFreeSaleBarRequest implements StewardFreeSaleBarRequest { + const _StewardFreeSaleBarRequest({this.buyerKey, this.numberOfCarcasses, this.weightOfCarcasses, this.date, this.clearanceCode, this.productKey, this.key}); + factory _StewardFreeSaleBarRequest.fromJson(Map json) => _$StewardFreeSaleBarRequestFromJson(json); + +@override final String? buyerKey; +@override final int? numberOfCarcasses; +@override final int? weightOfCarcasses; +@override final String? date; +@override final String? clearanceCode; +@override final String? productKey; +@override final String? key; + +/// Create a copy of StewardFreeSaleBarRequest +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardFreeSaleBarRequestCopyWith<_StewardFreeSaleBarRequest> get copyWith => __$StewardFreeSaleBarRequestCopyWithImpl<_StewardFreeSaleBarRequest>(this, _$identity); + +@override +Map toJson() { + return _$StewardFreeSaleBarRequestToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeSaleBarRequest&&(identical(other.buyerKey, buyerKey) || other.buyerKey == buyerKey)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.key, key) || other.key == key)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,buyerKey,numberOfCarcasses,weightOfCarcasses,date,clearanceCode,productKey,key); + +@override +String toString() { + return 'StewardFreeSaleBarRequest(buyerKey: $buyerKey, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, date: $date, clearanceCode: $clearanceCode, productKey: $productKey, key: $key)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardFreeSaleBarRequestCopyWith<$Res> implements $StewardFreeSaleBarRequestCopyWith<$Res> { + factory _$StewardFreeSaleBarRequestCopyWith(_StewardFreeSaleBarRequest value, $Res Function(_StewardFreeSaleBarRequest) _then) = __$StewardFreeSaleBarRequestCopyWithImpl; +@override @useResult +$Res call({ + String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key +}); + + + + +} +/// @nodoc +class __$StewardFreeSaleBarRequestCopyWithImpl<$Res> + implements _$StewardFreeSaleBarRequestCopyWith<$Res> { + __$StewardFreeSaleBarRequestCopyWithImpl(this._self, this._then); + + final _StewardFreeSaleBarRequest _self; + final $Res Function(_StewardFreeSaleBarRequest) _then; + +/// Create a copy of StewardFreeSaleBarRequest +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? buyerKey = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? clearanceCode = freezed,Object? productKey = freezed,Object? key = freezed,}) { + return _then(_StewardFreeSaleBarRequest( +buyerKey: freezed == buyerKey ? _self.buyerKey : buyerKey // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.g.dart b/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.g.dart new file mode 100644 index 0000000..51b2faf --- /dev/null +++ b/packages/chicken/lib/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'steward_free_sale_bar_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_StewardFreeSaleBarRequest _$StewardFreeSaleBarRequestFromJson( + Map json, +) => _StewardFreeSaleBarRequest( + buyerKey: json['buyer_key'] as String?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(), + date: json['date'] as String?, + clearanceCode: json['clearance_code'] as String?, + productKey: json['product_key'] as String?, + key: json['key'] as String?, +); + +Map _$StewardFreeSaleBarRequestToJson( + _StewardFreeSaleBarRequest instance, +) => { + 'buyer_key': instance.buyerKey, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'date': instance.date, + 'clearance_code': instance.clearanceCode, + 'product_key': instance.productKey, + 'key': instance.key, +}; diff --git a/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.dart b/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.dart new file mode 100644 index 0000000..d3f43cd --- /dev/null +++ b/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.dart @@ -0,0 +1,29 @@ + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'submit_kill_house_free_bar.freezed.dart'; +part 'submit_kill_house_free_bar.g.dart'; + +@freezed +abstract class SubmitKillHouseFreeBar with _$SubmitKillHouseFreeBar { + const factory SubmitKillHouseFreeBar({ + String? driverName, + String? driverMobile, + String? poultryName, + String? poultryMobile, + String? province, + String? city, + String? barClearanceCode, + String? barImage, + String? killerKey, + String? date, + String? buyType, + String? productKey, + String? car, + String? numberOfCarcasses, + String? weightOfCarcasses, + }) = _SubmitKillHouseFreeBar; + + factory SubmitKillHouseFreeBar.fromJson(Map json) => + _$SubmitKillHouseFreeBarFromJson(json); +} diff --git a/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.freezed.dart b/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.freezed.dart new file mode 100644 index 0000000..7807425 --- /dev/null +++ b/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.freezed.dart @@ -0,0 +1,319 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'submit_kill_house_free_bar.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$SubmitKillHouseFreeBar { + + String? get driverName; String? get driverMobile; String? get poultryName; String? get poultryMobile; String? get province; String? get city; String? get barClearanceCode; String? get barImage; String? get killerKey; String? get date; String? get buyType; String? get productKey; String? get car; String? get numberOfCarcasses; String? get weightOfCarcasses; +/// Create a copy of SubmitKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SubmitKillHouseFreeBarCopyWith get copyWith => _$SubmitKillHouseFreeBarCopyWithImpl(this as SubmitKillHouseFreeBar, _$identity); + + /// Serializes this SubmitKillHouseFreeBar to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitKillHouseFreeBar&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.killerKey, killerKey) || other.killerKey == killerKey)&&(identical(other.date, date) || other.date == date)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.car, car) || other.car == car)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,driverName,driverMobile,poultryName,poultryMobile,province,city,barClearanceCode,barImage,killerKey,date,buyType,productKey,car,numberOfCarcasses,weightOfCarcasses); + +@override +String toString() { + return 'SubmitKillHouseFreeBar(driverName: $driverName, driverMobile: $driverMobile, poultryName: $poultryName, poultryMobile: $poultryMobile, province: $province, city: $city, barClearanceCode: $barClearanceCode, barImage: $barImage, killerKey: $killerKey, date: $date, buyType: $buyType, productKey: $productKey, car: $car, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses)'; +} + + +} + +/// @nodoc +abstract mixin class $SubmitKillHouseFreeBarCopyWith<$Res> { + factory $SubmitKillHouseFreeBarCopyWith(SubmitKillHouseFreeBar value, $Res Function(SubmitKillHouseFreeBar) _then) = _$SubmitKillHouseFreeBarCopyWithImpl; +@useResult +$Res call({ + String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses +}); + + + + +} +/// @nodoc +class _$SubmitKillHouseFreeBarCopyWithImpl<$Res> + implements $SubmitKillHouseFreeBarCopyWith<$Res> { + _$SubmitKillHouseFreeBarCopyWithImpl(this._self, this._then); + + final SubmitKillHouseFreeBar _self; + final $Res Function(SubmitKillHouseFreeBar) _then; + +/// Create a copy of SubmitKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? driverName = freezed,Object? driverMobile = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? province = freezed,Object? city = freezed,Object? barClearanceCode = freezed,Object? barImage = freezed,Object? killerKey = freezed,Object? date = freezed,Object? buyType = freezed,Object? productKey = freezed,Object? car = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,}) { + return _then(_self.copyWith( +driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable +as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable +as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?,killerKey: freezed == killerKey ? _self.killerKey : killerKey // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [SubmitKillHouseFreeBar]. +extension SubmitKillHouseFreeBarPatterns on SubmitKillHouseFreeBar { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SubmitKillHouseFreeBar value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SubmitKillHouseFreeBar() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SubmitKillHouseFreeBar value) $default,){ +final _that = this; +switch (_that) { +case _SubmitKillHouseFreeBar(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SubmitKillHouseFreeBar value)? $default,){ +final _that = this; +switch (_that) { +case _SubmitKillHouseFreeBar() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SubmitKillHouseFreeBar() when $default != null: +return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses) $default,) {final _that = this; +switch (_that) { +case _SubmitKillHouseFreeBar(): +return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses)? $default,) {final _that = this; +switch (_that) { +case _SubmitKillHouseFreeBar() when $default != null: +return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _SubmitKillHouseFreeBar implements SubmitKillHouseFreeBar { + const _SubmitKillHouseFreeBar({this.driverName, this.driverMobile, this.poultryName, this.poultryMobile, this.province, this.city, this.barClearanceCode, this.barImage, this.killerKey, this.date, this.buyType, this.productKey, this.car, this.numberOfCarcasses, this.weightOfCarcasses}); + factory _SubmitKillHouseFreeBar.fromJson(Map json) => _$SubmitKillHouseFreeBarFromJson(json); + +@override final String? driverName; +@override final String? driverMobile; +@override final String? poultryName; +@override final String? poultryMobile; +@override final String? province; +@override final String? city; +@override final String? barClearanceCode; +@override final String? barImage; +@override final String? killerKey; +@override final String? date; +@override final String? buyType; +@override final String? productKey; +@override final String? car; +@override final String? numberOfCarcasses; +@override final String? weightOfCarcasses; + +/// Create a copy of SubmitKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SubmitKillHouseFreeBarCopyWith<_SubmitKillHouseFreeBar> get copyWith => __$SubmitKillHouseFreeBarCopyWithImpl<_SubmitKillHouseFreeBar>(this, _$identity); + +@override +Map toJson() { + return _$SubmitKillHouseFreeBarToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitKillHouseFreeBar&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.killerKey, killerKey) || other.killerKey == killerKey)&&(identical(other.date, date) || other.date == date)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.car, car) || other.car == car)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,driverName,driverMobile,poultryName,poultryMobile,province,city,barClearanceCode,barImage,killerKey,date,buyType,productKey,car,numberOfCarcasses,weightOfCarcasses); + +@override +String toString() { + return 'SubmitKillHouseFreeBar(driverName: $driverName, driverMobile: $driverMobile, poultryName: $poultryName, poultryMobile: $poultryMobile, province: $province, city: $city, barClearanceCode: $barClearanceCode, barImage: $barImage, killerKey: $killerKey, date: $date, buyType: $buyType, productKey: $productKey, car: $car, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses)'; +} + + +} + +/// @nodoc +abstract mixin class _$SubmitKillHouseFreeBarCopyWith<$Res> implements $SubmitKillHouseFreeBarCopyWith<$Res> { + factory _$SubmitKillHouseFreeBarCopyWith(_SubmitKillHouseFreeBar value, $Res Function(_SubmitKillHouseFreeBar) _then) = __$SubmitKillHouseFreeBarCopyWithImpl; +@override @useResult +$Res call({ + String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses +}); + + + + +} +/// @nodoc +class __$SubmitKillHouseFreeBarCopyWithImpl<$Res> + implements _$SubmitKillHouseFreeBarCopyWith<$Res> { + __$SubmitKillHouseFreeBarCopyWithImpl(this._self, this._then); + + final _SubmitKillHouseFreeBar _self; + final $Res Function(_SubmitKillHouseFreeBar) _then; + +/// Create a copy of SubmitKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? driverName = freezed,Object? driverMobile = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? province = freezed,Object? city = freezed,Object? barClearanceCode = freezed,Object? barImage = freezed,Object? killerKey = freezed,Object? date = freezed,Object? buyType = freezed,Object? productKey = freezed,Object? car = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,}) { + return _then(_SubmitKillHouseFreeBar( +driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable +as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable +as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?,killerKey: freezed == killerKey ? _self.killerKey : killerKey // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.g.dart b/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.g.dart new file mode 100644 index 0000000..1f3b912 --- /dev/null +++ b/packages/chicken/lib/data/models/request/submit_kill_house_free_bar/submit_kill_house_free_bar.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'submit_kill_house_free_bar.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_SubmitKillHouseFreeBar _$SubmitKillHouseFreeBarFromJson( + Map json, +) => _SubmitKillHouseFreeBar( + driverName: json['driver_name'] as String?, + driverMobile: json['driver_mobile'] as String?, + poultryName: json['poultry_name'] as String?, + poultryMobile: json['poultry_mobile'] as String?, + province: json['province'] as String?, + city: json['city'] as String?, + barClearanceCode: json['bar_clearance_code'] as String?, + barImage: json['bar_image'] as String?, + killerKey: json['killer_key'] as String?, + date: json['date'] as String?, + buyType: json['buy_type'] as String?, + productKey: json['product_key'] as String?, + car: json['car'] as String?, + numberOfCarcasses: json['number_of_carcasses'] as String?, + weightOfCarcasses: json['weight_of_carcasses'] as String?, +); + +Map _$SubmitKillHouseFreeBarToJson( + _SubmitKillHouseFreeBar instance, +) => { + 'driver_name': instance.driverName, + 'driver_mobile': instance.driverMobile, + 'poultry_name': instance.poultryName, + 'poultry_mobile': instance.poultryMobile, + 'province': instance.province, + 'city': instance.city, + 'bar_clearance_code': instance.barClearanceCode, + 'bar_image': instance.barImage, + 'killer_key': instance.killerKey, + 'date': instance.date, + 'buy_type': instance.buyType, + 'product_key': instance.productKey, + 'car': instance.car, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, +}; diff --git a/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.dart b/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.dart new file mode 100644 index 0000000..8833933 --- /dev/null +++ b/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.dart @@ -0,0 +1,26 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'submit_steward_allocation.freezed.dart'; +part 'submit_steward_allocation.g.dart'; + +@freezed +abstract class SubmitStewardAllocation with _$SubmitStewardAllocation { + const factory SubmitStewardAllocation({ + String? sellerType, + String? buyerType, + String? guildKey, + String? productKey, + String? type, + String? allocationType, + int? numberOfCarcasses, + int? weightOfCarcasses, + String? sellType, + int? amount, + int? totalAmount, + bool? approvedPriceStatus, + String? date, + }) = _SubmitStewardAllocation; + + factory SubmitStewardAllocation.fromJson(Map json) => + _$SubmitStewardAllocationFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.freezed.dart b/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.freezed.dart new file mode 100644 index 0000000..0ff2933 --- /dev/null +++ b/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.freezed.dart @@ -0,0 +1,313 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'submit_steward_allocation.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$SubmitStewardAllocation { + + String? get sellerType; String? get buyerType; String? get guildKey; String? get productKey; String? get type; String? get allocationType; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get sellType; int? get amount; int? get totalAmount; bool? get approvedPriceStatus; String? get date; +/// Create a copy of SubmitStewardAllocation +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SubmitStewardAllocationCopyWith get copyWith => _$SubmitStewardAllocationCopyWithImpl(this as SubmitStewardAllocation, _$identity); + + /// Serializes this SubmitStewardAllocation to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date); + +@override +String toString() { + return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)'; +} + + +} + +/// @nodoc +abstract mixin class $SubmitStewardAllocationCopyWith<$Res> { + factory $SubmitStewardAllocationCopyWith(SubmitStewardAllocation value, $Res Function(SubmitStewardAllocation) _then) = _$SubmitStewardAllocationCopyWithImpl; +@useResult +$Res call({ + String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date +}); + + + + +} +/// @nodoc +class _$SubmitStewardAllocationCopyWithImpl<$Res> + implements $SubmitStewardAllocationCopyWith<$Res> { + _$SubmitStewardAllocationCopyWithImpl(this._self, this._then); + + final SubmitStewardAllocation _self; + final $Res Function(SubmitStewardAllocation) _then; + +/// Create a copy of SubmitStewardAllocation +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) { + return _then(_self.copyWith( +sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable +as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [SubmitStewardAllocation]. +extension SubmitStewardAllocationPatterns on SubmitStewardAllocation { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SubmitStewardAllocation value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SubmitStewardAllocation() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SubmitStewardAllocation value) $default,){ +final _that = this; +switch (_that) { +case _SubmitStewardAllocation(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SubmitStewardAllocation value)? $default,){ +final _that = this; +switch (_that) { +case _SubmitStewardAllocation() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SubmitStewardAllocation() when $default != null: +return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date) $default,) {final _that = this; +switch (_that) { +case _SubmitStewardAllocation(): +return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,) {final _that = this; +switch (_that) { +case _SubmitStewardAllocation() when $default != null: +return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _SubmitStewardAllocation implements SubmitStewardAllocation { + const _SubmitStewardAllocation({this.sellerType, this.buyerType, this.guildKey, this.productKey, this.type, this.allocationType, this.numberOfCarcasses, this.weightOfCarcasses, this.sellType, this.amount, this.totalAmount, this.approvedPriceStatus, this.date}); + factory _SubmitStewardAllocation.fromJson(Map json) => _$SubmitStewardAllocationFromJson(json); + +@override final String? sellerType; +@override final String? buyerType; +@override final String? guildKey; +@override final String? productKey; +@override final String? type; +@override final String? allocationType; +@override final int? numberOfCarcasses; +@override final int? weightOfCarcasses; +@override final String? sellType; +@override final int? amount; +@override final int? totalAmount; +@override final bool? approvedPriceStatus; +@override final String? date; + +/// Create a copy of SubmitStewardAllocation +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SubmitStewardAllocationCopyWith<_SubmitStewardAllocation> get copyWith => __$SubmitStewardAllocationCopyWithImpl<_SubmitStewardAllocation>(this, _$identity); + +@override +Map toJson() { + return _$SubmitStewardAllocationToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date); + +@override +String toString() { + return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)'; +} + + +} + +/// @nodoc +abstract mixin class _$SubmitStewardAllocationCopyWith<$Res> implements $SubmitStewardAllocationCopyWith<$Res> { + factory _$SubmitStewardAllocationCopyWith(_SubmitStewardAllocation value, $Res Function(_SubmitStewardAllocation) _then) = __$SubmitStewardAllocationCopyWithImpl; +@override @useResult +$Res call({ + String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date +}); + + + + +} +/// @nodoc +class __$SubmitStewardAllocationCopyWithImpl<$Res> + implements _$SubmitStewardAllocationCopyWith<$Res> { + __$SubmitStewardAllocationCopyWithImpl(this._self, this._then); + + final _SubmitStewardAllocation _self; + final $Res Function(_SubmitStewardAllocation) _then; + +/// Create a copy of SubmitStewardAllocation +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) { + return _then(_SubmitStewardAllocation( +sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable +as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.g.dart b/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.g.dart new file mode 100644 index 0000000..8b4b2e4 --- /dev/null +++ b/packages/chicken/lib/data/models/request/submit_steward_allocation/submit_steward_allocation.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'submit_steward_allocation.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_SubmitStewardAllocation _$SubmitStewardAllocationFromJson( + Map json, +) => _SubmitStewardAllocation( + sellerType: json['seller_type'] as String?, + buyerType: json['buyer_type'] as String?, + guildKey: json['guild_key'] as String?, + productKey: json['product_key'] as String?, + type: json['type'] as String?, + allocationType: json['allocation_type'] as String?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(), + sellType: json['sell_type'] as String?, + amount: (json['amount'] as num?)?.toInt(), + totalAmount: (json['total_amount'] as num?)?.toInt(), + approvedPriceStatus: json['approved_price_status'] as bool?, + date: json['date'] as String?, +); + +Map _$SubmitStewardAllocationToJson( + _SubmitStewardAllocation instance, +) => { + 'seller_type': instance.sellerType, + 'buyer_type': instance.buyerType, + 'guild_key': instance.guildKey, + 'product_key': instance.productKey, + 'type': instance.type, + 'allocation_type': instance.allocationType, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'sell_type': instance.sellType, + 'amount': instance.amount, + 'total_amount': instance.totalAmount, + 'approved_price_status': instance.approvedPriceStatus, + 'date': instance.date, +}; diff --git a/packages/chicken/lib/data/models/response/allocated_made/allocated_made.dart b/packages/chicken/lib/data/models/response/allocated_made/allocated_made.dart new file mode 100644 index 0000000..2bb9431 --- /dev/null +++ b/packages/chicken/lib/data/models/response/allocated_made/allocated_made.dart @@ -0,0 +1,215 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'allocated_made.freezed.dart'; +part 'allocated_made.g.dart'; + +@freezed +abstract class AllocatedMadeModel with _$AllocatedMadeModel { + factory AllocatedMadeModel({ + int? id, + Product? product, + dynamic killHouse, + dynamic toKillHouse, + Steward? steward, + dynamic toSteward, + dynamic guilds, + Steward? toGuilds, + dynamic toColdHouse, + int? indexWeight, + int? dateTimestamp, + int? newState, + int? newReceiverState, + int? newAllocationState, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + int? numberOfCarcasses, + int? realNumberOfCarcasses, + int? receiverRealNumberOfCarcasses, + int? weightOfCarcasses, + int? realWeightOfCarcasses, + int? receiverRealWeightOfCarcasses, + int? weightLossOfCarcasses, + bool? finalRegistration, + String? sellType, + String? productName, + String? sellerType, + String? type, + String? saleType, + String? allocationType, + bool? systemRegistrationCode, + int? registrationCode, + int? amount, + int? totalAmount, + int? totalAmountPaid, + int? totalAmountRemain, + String? loggedRegistrationCode, + String? state, + String? receiverState, + String? allocationState, + String? date, + String? role, + String? stewardTempKey, + bool? approvedPriceStatus, + bool? calculateStatus, + bool? temporaryTrash, + bool? temporaryDeleted, + String? createdBy, + String? modifiedBy, + dynamic wareHouse, + dynamic stewardWareHouse, + dynamic car, + dynamic dispenser, + }) = _AllocatedMadeModel; + + factory AllocatedMadeModel.fromJson(Map json) => + _$AllocatedMadeModelFromJson(json); +} + +@freezed +abstract class Product with _$Product { + factory Product({ + int? weightAverage, + String? name, + }) = _Product; + + factory Product.fromJson(Map json) => + _$ProductFromJson(json); +} + +@freezed +abstract class Steward with _$Steward { + factory Steward({ + int? id, + User? user, + Address? address, + Activity? guildAreaActivity, + Activity? guildTypeActivity, + List? killHouse, + List? stewardKillHouse, + List? stewards, + PosStatus? getPosStatus, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + dynamic userIdForeignKey, + dynamic addressIdForeignKey, + dynamic userBankIdForeignKey, + dynamic walletIdForeignKey, + dynamic provincialGovernmentIdKey, + dynamic identityDocuments, + bool? active, + int? cityNumber, + String? cityName, + String? guildsId, + String? licenseNumber, + String? guildsName, + String? phone, + String? typeActivity, + String? areaActivity, + int? provinceNumber, + String? provinceName, + bool? steward, + bool? hasPos, + dynamic centersAllocation, + dynamic killHouseCentersAllocation, + dynamic allocationLimit, + bool? limitationAllocation, + String? registerarRole, + String? registerarFullname, + String? registerarMobile, + bool? killHouseRegister, + bool? stewardRegister, + bool? guildsRoomRegister, + bool? posCompanyRegister, + String? provinceAcceptState, + String? provinceMessage, + String? condition, + String? descriptionCondition, + bool? stewardActive, + dynamic stewardAllocationLimit, + bool? stewardLimitationAllocation, + bool? license, + dynamic licenseForm, + dynamic licenseFile, + String? reviewerRole, + String? reviewerFullname, + String? reviewerMobile, + String? checkerMessage, + bool? finalAccept, + bool? temporaryRegistration, + String? createdBy, + String? modifiedBy, + dynamic userBankInfo, + int? wallet, + List? cars, + List? userLevel, + }) = _Steward; + + factory Steward.fromJson(Map json) => + _$StewardFromJson(json); +} + +@freezed +abstract class User with _$User { + factory User({ + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? nationalId, + String? city, + }) = _User; + + factory User.fromJson(Map json) => + _$UserFromJson(json); +} + +@freezed +abstract class Address with _$Address { + factory Address({ + Province? province, + Province? city, + String? address, + String? postalCode, + }) = _Address; + + factory Address.fromJson(Map json) => + _$AddressFromJson(json); +} + +@freezed +abstract class Province with _$Province { + factory Province({ + String? key, + String? name, + }) = _Province; + + factory Province.fromJson(Map json) => + _$ProvinceFromJson(json); +} + +@freezed +abstract class Activity with _$Activity { + factory Activity({ + String? key, + String? title, + }) = _Activity; + + factory Activity.fromJson(Map json) => + _$ActivityFromJson(json); +} + +@freezed +abstract class PosStatus with _$PosStatus { + factory PosStatus({ + int? lenActiveSessions, + bool? hasPons, + bool? hasActivePons, + }) = _PosStatus; + + factory PosStatus.fromJson(Map json) => + _$PosStatusFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/allocated_made/allocated_made.freezed.dart b/packages/chicken/lib/data/models/response/allocated_made/allocated_made.freezed.dart new file mode 100644 index 0000000..1d1e683 --- /dev/null +++ b/packages/chicken/lib/data/models/response/allocated_made/allocated_made.freezed.dart @@ -0,0 +1,2791 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'allocated_made.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$AllocatedMadeModel { + + int? get id; Product? get product; dynamic get killHouse; dynamic get toKillHouse; Steward? get steward; dynamic get toSteward; dynamic get guilds; Steward? get toGuilds; dynamic get toColdHouse; int? get indexWeight; int? get dateTimestamp; int? get newState; int? get newReceiverState; int? get newAllocationState; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get numberOfCarcasses; int? get realNumberOfCarcasses; int? get receiverRealNumberOfCarcasses; int? get weightOfCarcasses; int? get realWeightOfCarcasses; int? get receiverRealWeightOfCarcasses; int? get weightLossOfCarcasses; bool? get finalRegistration; String? get sellType; String? get productName; String? get sellerType; String? get type; String? get saleType; String? get allocationType; bool? get systemRegistrationCode; int? get registrationCode; int? get amount; int? get totalAmount; int? get totalAmountPaid; int? get totalAmountRemain; String? get loggedRegistrationCode; String? get state; String? get receiverState; String? get allocationState; String? get date; String? get role; String? get stewardTempKey; bool? get approvedPriceStatus; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy; dynamic get wareHouse; dynamic get stewardWareHouse; dynamic get car; dynamic get dispenser; +/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AllocatedMadeModelCopyWith get copyWith => _$AllocatedMadeModelCopyWithImpl(this as AllocatedMadeModel, _$identity); + + /// Serializes this AllocatedMadeModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AllocatedMadeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.toSteward, toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&(identical(other.toGuilds, toGuilds) || other.toGuilds == toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&(identical(other.loggedRegistrationCode, loggedRegistrationCode) || other.loggedRegistrationCode == loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.stewardTempKey, stewardTempKey) || other.stewardTempKey == stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,product,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(toKillHouse),steward,const DeepCollectionEquality().hash(toSteward),const DeepCollectionEquality().hash(guilds),toGuilds,const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,loggedRegistrationCode,state,receiverState,allocationState,date,role,stewardTempKey,approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,createdBy,modifiedBy,const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); + +@override +String toString() { + return 'AllocatedMadeModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; +} + + +} + +/// @nodoc +abstract mixin class $AllocatedMadeModelCopyWith<$Res> { + factory $AllocatedMadeModelCopyWith(AllocatedMadeModel value, $Res Function(AllocatedMadeModel) _then) = _$AllocatedMadeModelCopyWithImpl; +@useResult +$Res call({ + int? id, Product? product, dynamic killHouse, dynamic toKillHouse, Steward? steward, dynamic toSteward, dynamic guilds, Steward? toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, int? weightOfCarcasses, int? realWeightOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, String? loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, String? role, String? stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser +}); + + +$ProductCopyWith<$Res>? get product;$StewardCopyWith<$Res>? get steward;$StewardCopyWith<$Res>? get toGuilds; + +} +/// @nodoc +class _$AllocatedMadeModelCopyWithImpl<$Res> + implements $AllocatedMadeModelCopyWith<$Res> { + _$AllocatedMadeModelCopyWithImpl(this._self, this._then); + + final AllocatedMadeModel _self; + final $Res Function(AllocatedMadeModel) _then; + +/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as Product?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,toKillHouse: freezed == toKillHouse ? _self.toKillHouse : toKillHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as Steward?,toSteward: freezed == toSteward ? _self.toSteward : toSteward // ignore: cast_nullable_to_non_nullable +as dynamic,guilds: freezed == guilds ? _self.guilds : guilds // ignore: cast_nullable_to_non_nullable +as dynamic,toGuilds: freezed == toGuilds ? _self.toGuilds : toGuilds // ignore: cast_nullable_to_non_nullable +as Steward?,toColdHouse: freezed == toColdHouse ? _self.toColdHouse : toColdHouse // ignore: cast_nullable_to_non_nullable +as dynamic,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as int?,dateTimestamp: freezed == dateTimestamp ? _self.dateTimestamp : dateTimestamp // ignore: cast_nullable_to_non_nullable +as int?,newState: freezed == newState ? _self.newState : newState // ignore: cast_nullable_to_non_nullable +as int?,newReceiverState: freezed == newReceiverState ? _self.newReceiverState : newReceiverState // ignore: cast_nullable_to_non_nullable +as int?,newAllocationState: freezed == newAllocationState ? _self.newAllocationState : newAllocationState // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realNumberOfCarcasses: freezed == realNumberOfCarcasses ? _self.realNumberOfCarcasses : realNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realWeightOfCarcasses: freezed == realWeightOfCarcasses ? _self.realWeightOfCarcasses : realWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,finalRegistration: freezed == finalRegistration ? _self.finalRegistration : finalRegistration // ignore: cast_nullable_to_non_nullable +as bool?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,productName: freezed == productName ? _self.productName : productName // ignore: cast_nullable_to_non_nullable +as String?,sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,saleType: freezed == saleType ? _self.saleType : saleType // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,systemRegistrationCode: freezed == systemRegistrationCode ? _self.systemRegistrationCode : systemRegistrationCode // ignore: cast_nullable_to_non_nullable +as bool?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,totalAmountPaid: freezed == totalAmountPaid ? _self.totalAmountPaid : totalAmountPaid // ignore: cast_nullable_to_non_nullable +as int?,totalAmountRemain: freezed == totalAmountRemain ? _self.totalAmountRemain : totalAmountRemain // ignore: cast_nullable_to_non_nullable +as int?,loggedRegistrationCode: freezed == loggedRegistrationCode ? _self.loggedRegistrationCode : loggedRegistrationCode // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,receiverState: freezed == receiverState ? _self.receiverState : receiverState // ignore: cast_nullable_to_non_nullable +as String?,allocationState: freezed == allocationState ? _self.allocationState : allocationState // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,stewardTempKey: freezed == stewardTempKey ? _self.stewardTempKey : stewardTempKey // ignore: cast_nullable_to_non_nullable +as String?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,stewardWareHouse: freezed == stewardWareHouse ? _self.stewardWareHouse : stewardWareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} +/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +}/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $StewardCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +}/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardCopyWith<$Res>? get toGuilds { + if (_self.toGuilds == null) { + return null; + } + + return $StewardCopyWith<$Res>(_self.toGuilds!, (value) { + return _then(_self.copyWith(toGuilds: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [AllocatedMadeModel]. +extension AllocatedMadeModelPatterns on AllocatedMadeModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AllocatedMadeModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AllocatedMadeModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AllocatedMadeModel value) $default,){ +final _that = this; +switch (_that) { +case _AllocatedMadeModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AllocatedMadeModel value)? $default,){ +final _that = this; +switch (_that) { +case _AllocatedMadeModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, Product? product, dynamic killHouse, dynamic toKillHouse, Steward? steward, dynamic toSteward, dynamic guilds, Steward? toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, int? weightOfCarcasses, int? realWeightOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, String? loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, String? role, String? stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AllocatedMadeModel() when $default != null: +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, Product? product, dynamic killHouse, dynamic toKillHouse, Steward? steward, dynamic toSteward, dynamic guilds, Steward? toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, int? weightOfCarcasses, int? realWeightOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, String? loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, String? role, String? stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser) $default,) {final _that = this; +switch (_that) { +case _AllocatedMadeModel(): +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, Product? product, dynamic killHouse, dynamic toKillHouse, Steward? steward, dynamic toSteward, dynamic guilds, Steward? toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, int? weightOfCarcasses, int? realWeightOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, String? loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, String? role, String? stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser)? $default,) {final _that = this; +switch (_that) { +case _AllocatedMadeModel() when $default != null: +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _AllocatedMadeModel implements AllocatedMadeModel { + _AllocatedMadeModel({this.id, this.product, this.killHouse, this.toKillHouse, this.steward, this.toSteward, this.guilds, this.toGuilds, this.toColdHouse, this.indexWeight, this.dateTimestamp, this.newState, this.newReceiverState, this.newAllocationState, this.key, this.createDate, this.modifyDate, this.trash, this.numberOfCarcasses, this.realNumberOfCarcasses, this.receiverRealNumberOfCarcasses, this.weightOfCarcasses, this.realWeightOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses, this.finalRegistration, this.sellType, this.productName, this.sellerType, this.type, this.saleType, this.allocationType, this.systemRegistrationCode, this.registrationCode, this.amount, this.totalAmount, this.totalAmountPaid, this.totalAmountRemain, this.loggedRegistrationCode, this.state, this.receiverState, this.allocationState, this.date, this.role, this.stewardTempKey, this.approvedPriceStatus, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy, this.wareHouse, this.stewardWareHouse, this.car, this.dispenser}); + factory _AllocatedMadeModel.fromJson(Map json) => _$AllocatedMadeModelFromJson(json); + +@override final int? id; +@override final Product? product; +@override final dynamic killHouse; +@override final dynamic toKillHouse; +@override final Steward? steward; +@override final dynamic toSteward; +@override final dynamic guilds; +@override final Steward? toGuilds; +@override final dynamic toColdHouse; +@override final int? indexWeight; +@override final int? dateTimestamp; +@override final int? newState; +@override final int? newReceiverState; +@override final int? newAllocationState; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final int? numberOfCarcasses; +@override final int? realNumberOfCarcasses; +@override final int? receiverRealNumberOfCarcasses; +@override final int? weightOfCarcasses; +@override final int? realWeightOfCarcasses; +@override final int? receiverRealWeightOfCarcasses; +@override final int? weightLossOfCarcasses; +@override final bool? finalRegistration; +@override final String? sellType; +@override final String? productName; +@override final String? sellerType; +@override final String? type; +@override final String? saleType; +@override final String? allocationType; +@override final bool? systemRegistrationCode; +@override final int? registrationCode; +@override final int? amount; +@override final int? totalAmount; +@override final int? totalAmountPaid; +@override final int? totalAmountRemain; +@override final String? loggedRegistrationCode; +@override final String? state; +@override final String? receiverState; +@override final String? allocationState; +@override final String? date; +@override final String? role; +@override final String? stewardTempKey; +@override final bool? approvedPriceStatus; +@override final bool? calculateStatus; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final String? createdBy; +@override final String? modifiedBy; +@override final dynamic wareHouse; +@override final dynamic stewardWareHouse; +@override final dynamic car; +@override final dynamic dispenser; + +/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AllocatedMadeModelCopyWith<_AllocatedMadeModel> get copyWith => __$AllocatedMadeModelCopyWithImpl<_AllocatedMadeModel>(this, _$identity); + +@override +Map toJson() { + return _$AllocatedMadeModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AllocatedMadeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.toSteward, toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&(identical(other.toGuilds, toGuilds) || other.toGuilds == toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&(identical(other.loggedRegistrationCode, loggedRegistrationCode) || other.loggedRegistrationCode == loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.stewardTempKey, stewardTempKey) || other.stewardTempKey == stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,product,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(toKillHouse),steward,const DeepCollectionEquality().hash(toSteward),const DeepCollectionEquality().hash(guilds),toGuilds,const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,loggedRegistrationCode,state,receiverState,allocationState,date,role,stewardTempKey,approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,createdBy,modifiedBy,const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); + +@override +String toString() { + return 'AllocatedMadeModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; +} + + +} + +/// @nodoc +abstract mixin class _$AllocatedMadeModelCopyWith<$Res> implements $AllocatedMadeModelCopyWith<$Res> { + factory _$AllocatedMadeModelCopyWith(_AllocatedMadeModel value, $Res Function(_AllocatedMadeModel) _then) = __$AllocatedMadeModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, Product? product, dynamic killHouse, dynamic toKillHouse, Steward? steward, dynamic toSteward, dynamic guilds, Steward? toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, int? weightOfCarcasses, int? realWeightOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, String? loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, String? role, String? stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser +}); + + +@override $ProductCopyWith<$Res>? get product;@override $StewardCopyWith<$Res>? get steward;@override $StewardCopyWith<$Res>? get toGuilds; + +} +/// @nodoc +class __$AllocatedMadeModelCopyWithImpl<$Res> + implements _$AllocatedMadeModelCopyWith<$Res> { + __$AllocatedMadeModelCopyWithImpl(this._self, this._then); + + final _AllocatedMadeModel _self; + final $Res Function(_AllocatedMadeModel) _then; + +/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { + return _then(_AllocatedMadeModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as Product?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,toKillHouse: freezed == toKillHouse ? _self.toKillHouse : toKillHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as Steward?,toSteward: freezed == toSteward ? _self.toSteward : toSteward // ignore: cast_nullable_to_non_nullable +as dynamic,guilds: freezed == guilds ? _self.guilds : guilds // ignore: cast_nullable_to_non_nullable +as dynamic,toGuilds: freezed == toGuilds ? _self.toGuilds : toGuilds // ignore: cast_nullable_to_non_nullable +as Steward?,toColdHouse: freezed == toColdHouse ? _self.toColdHouse : toColdHouse // ignore: cast_nullable_to_non_nullable +as dynamic,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as int?,dateTimestamp: freezed == dateTimestamp ? _self.dateTimestamp : dateTimestamp // ignore: cast_nullable_to_non_nullable +as int?,newState: freezed == newState ? _self.newState : newState // ignore: cast_nullable_to_non_nullable +as int?,newReceiverState: freezed == newReceiverState ? _self.newReceiverState : newReceiverState // ignore: cast_nullable_to_non_nullable +as int?,newAllocationState: freezed == newAllocationState ? _self.newAllocationState : newAllocationState // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realNumberOfCarcasses: freezed == realNumberOfCarcasses ? _self.realNumberOfCarcasses : realNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realWeightOfCarcasses: freezed == realWeightOfCarcasses ? _self.realWeightOfCarcasses : realWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,finalRegistration: freezed == finalRegistration ? _self.finalRegistration : finalRegistration // ignore: cast_nullable_to_non_nullable +as bool?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,productName: freezed == productName ? _self.productName : productName // ignore: cast_nullable_to_non_nullable +as String?,sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,saleType: freezed == saleType ? _self.saleType : saleType // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,systemRegistrationCode: freezed == systemRegistrationCode ? _self.systemRegistrationCode : systemRegistrationCode // ignore: cast_nullable_to_non_nullable +as bool?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,totalAmountPaid: freezed == totalAmountPaid ? _self.totalAmountPaid : totalAmountPaid // ignore: cast_nullable_to_non_nullable +as int?,totalAmountRemain: freezed == totalAmountRemain ? _self.totalAmountRemain : totalAmountRemain // ignore: cast_nullable_to_non_nullable +as int?,loggedRegistrationCode: freezed == loggedRegistrationCode ? _self.loggedRegistrationCode : loggedRegistrationCode // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,receiverState: freezed == receiverState ? _self.receiverState : receiverState // ignore: cast_nullable_to_non_nullable +as String?,allocationState: freezed == allocationState ? _self.allocationState : allocationState // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,stewardTempKey: freezed == stewardTempKey ? _self.stewardTempKey : stewardTempKey // ignore: cast_nullable_to_non_nullable +as String?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,stewardWareHouse: freezed == stewardWareHouse ? _self.stewardWareHouse : stewardWareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} + +/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +}/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $StewardCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +}/// Create a copy of AllocatedMadeModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardCopyWith<$Res>? get toGuilds { + if (_self.toGuilds == null) { + return null; + } + + return $StewardCopyWith<$Res>(_self.toGuilds!, (value) { + return _then(_self.copyWith(toGuilds: value)); + }); +} +} + + +/// @nodoc +mixin _$Product { + + int? get weightAverage; String? get name; +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProductCopyWith get copyWith => _$ProductCopyWithImpl(this as Product, _$identity); + + /// Serializes this Product to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Product&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,weightAverage,name); + +@override +String toString() { + return 'Product(weightAverage: $weightAverage, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProductCopyWith<$Res> { + factory $ProductCopyWith(Product value, $Res Function(Product) _then) = _$ProductCopyWithImpl; +@useResult +$Res call({ + int? weightAverage, String? name +}); + + + + +} +/// @nodoc +class _$ProductCopyWithImpl<$Res> + implements $ProductCopyWith<$Res> { + _$ProductCopyWithImpl(this._self, this._then); + + final Product _self; + final $Res Function(Product) _then; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? weightAverage = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Product]. +extension ProductPatterns on Product { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Product value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Product value) $default,){ +final _that = this; +switch (_that) { +case _Product(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Product value)? $default,){ +final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? weightAverage, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that.weightAverage,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? weightAverage, String? name) $default,) {final _that = this; +switch (_that) { +case _Product(): +return $default(_that.weightAverage,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? weightAverage, String? name)? $default,) {final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that.weightAverage,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Product implements Product { + _Product({this.weightAverage, this.name}); + factory _Product.fromJson(Map json) => _$ProductFromJson(json); + +@override final int? weightAverage; +@override final String? name; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProductCopyWith<_Product> get copyWith => __$ProductCopyWithImpl<_Product>(this, _$identity); + +@override +Map toJson() { + return _$ProductToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Product&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,weightAverage,name); + +@override +String toString() { + return 'Product(weightAverage: $weightAverage, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProductCopyWith<$Res> implements $ProductCopyWith<$Res> { + factory _$ProductCopyWith(_Product value, $Res Function(_Product) _then) = __$ProductCopyWithImpl; +@override @useResult +$Res call({ + int? weightAverage, String? name +}); + + + + +} +/// @nodoc +class __$ProductCopyWithImpl<$Res> + implements _$ProductCopyWith<$Res> { + __$ProductCopyWithImpl(this._self, this._then); + + final _Product _self; + final $Res Function(_Product) _then; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? weightAverage = freezed,Object? name = freezed,}) { + return _then(_Product( +weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Steward { + + int? get id; User? get user; Address? get address; Activity? get guildAreaActivity; Activity? get guildTypeActivity; List? get killHouse; List? get stewardKillHouse; List? get stewards; PosStatus? get getPosStatus; String? get key; String? get createDate; String? get modifyDate; bool? get trash; dynamic get userIdForeignKey; dynamic get addressIdForeignKey; dynamic get userBankIdForeignKey; dynamic get walletIdForeignKey; dynamic get provincialGovernmentIdKey; dynamic get identityDocuments; bool? get active; int? get cityNumber; String? get cityName; String? get guildsId; String? get licenseNumber; String? get guildsName; String? get phone; String? get typeActivity; String? get areaActivity; int? get provinceNumber; String? get provinceName; bool? get steward; bool? get hasPos; dynamic get centersAllocation; dynamic get killHouseCentersAllocation; dynamic get allocationLimit; bool? get limitationAllocation; String? get registerarRole; String? get registerarFullname; String? get registerarMobile; bool? get killHouseRegister; bool? get stewardRegister; bool? get guildsRoomRegister; bool? get posCompanyRegister; String? get provinceAcceptState; String? get provinceMessage; String? get condition; String? get descriptionCondition; bool? get stewardActive; dynamic get stewardAllocationLimit; bool? get stewardLimitationAllocation; bool? get license; dynamic get licenseForm; dynamic get licenseFile; String? get reviewerRole; String? get reviewerFullname; String? get reviewerMobile; String? get checkerMessage; bool? get finalAccept; bool? get temporaryRegistration; String? get createdBy; String? get modifiedBy; dynamic get userBankInfo; int? get wallet; List? get cars; List? get userLevel; +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardCopyWith get copyWith => _$StewardCopyWithImpl(this as Steward, _$identity); + + /// Serializes this Steward to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Steward&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&(identical(other.guildAreaActivity, guildAreaActivity) || other.guildAreaActivity == guildAreaActivity)&&(identical(other.guildTypeActivity, guildTypeActivity) || other.guildTypeActivity == guildTypeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.stewardKillHouse, stewardKillHouse)&&const DeepCollectionEquality().equals(other.stewards, stewards)&&(identical(other.getPosStatus, getPosStatus) || other.getPosStatus == getPosStatus)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&const DeepCollectionEquality().equals(other.userIdForeignKey, userIdForeignKey)&&const DeepCollectionEquality().equals(other.addressIdForeignKey, addressIdForeignKey)&&const DeepCollectionEquality().equals(other.userBankIdForeignKey, userBankIdForeignKey)&&const DeepCollectionEquality().equals(other.walletIdForeignKey, walletIdForeignKey)&&const DeepCollectionEquality().equals(other.provincialGovernmentIdKey, provincialGovernmentIdKey)&&const DeepCollectionEquality().equals(other.identityDocuments, identityDocuments)&&(identical(other.active, active) || other.active == active)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.hasPos, hasPos) || other.hasPos == hasPos)&&const DeepCollectionEquality().equals(other.centersAllocation, centersAllocation)&&const DeepCollectionEquality().equals(other.killHouseCentersAllocation, killHouseCentersAllocation)&&const DeepCollectionEquality().equals(other.allocationLimit, allocationLimit)&&(identical(other.limitationAllocation, limitationAllocation) || other.limitationAllocation == limitationAllocation)&&(identical(other.registerarRole, registerarRole) || other.registerarRole == registerarRole)&&(identical(other.registerarFullname, registerarFullname) || other.registerarFullname == registerarFullname)&&(identical(other.registerarMobile, registerarMobile) || other.registerarMobile == registerarMobile)&&(identical(other.killHouseRegister, killHouseRegister) || other.killHouseRegister == killHouseRegister)&&(identical(other.stewardRegister, stewardRegister) || other.stewardRegister == stewardRegister)&&(identical(other.guildsRoomRegister, guildsRoomRegister) || other.guildsRoomRegister == guildsRoomRegister)&&(identical(other.posCompanyRegister, posCompanyRegister) || other.posCompanyRegister == posCompanyRegister)&&(identical(other.provinceAcceptState, provinceAcceptState) || other.provinceAcceptState == provinceAcceptState)&&(identical(other.provinceMessage, provinceMessage) || other.provinceMessage == provinceMessage)&&(identical(other.condition, condition) || other.condition == condition)&&(identical(other.descriptionCondition, descriptionCondition) || other.descriptionCondition == descriptionCondition)&&(identical(other.stewardActive, stewardActive) || other.stewardActive == stewardActive)&&const DeepCollectionEquality().equals(other.stewardAllocationLimit, stewardAllocationLimit)&&(identical(other.stewardLimitationAllocation, stewardLimitationAllocation) || other.stewardLimitationAllocation == stewardLimitationAllocation)&&(identical(other.license, license) || other.license == license)&&const DeepCollectionEquality().equals(other.licenseForm, licenseForm)&&const DeepCollectionEquality().equals(other.licenseFile, licenseFile)&&(identical(other.reviewerRole, reviewerRole) || other.reviewerRole == reviewerRole)&&(identical(other.reviewerFullname, reviewerFullname) || other.reviewerFullname == reviewerFullname)&&(identical(other.reviewerMobile, reviewerMobile) || other.reviewerMobile == reviewerMobile)&&(identical(other.checkerMessage, checkerMessage) || other.checkerMessage == checkerMessage)&&(identical(other.finalAccept, finalAccept) || other.finalAccept == finalAccept)&&(identical(other.temporaryRegistration, temporaryRegistration) || other.temporaryRegistration == temporaryRegistration)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&const DeepCollectionEquality().equals(other.userBankInfo, userBankInfo)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other.cars, cars)&&const DeepCollectionEquality().equals(other.userLevel, userLevel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,guildAreaActivity,guildTypeActivity,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(stewardKillHouse),const DeepCollectionEquality().hash(stewards),getPosStatus,key,createDate,modifyDate,trash,const DeepCollectionEquality().hash(userIdForeignKey),const DeepCollectionEquality().hash(addressIdForeignKey),const DeepCollectionEquality().hash(userBankIdForeignKey),const DeepCollectionEquality().hash(walletIdForeignKey),const DeepCollectionEquality().hash(provincialGovernmentIdKey),const DeepCollectionEquality().hash(identityDocuments),active,cityNumber,cityName,guildsId,licenseNumber,guildsName,phone,typeActivity,areaActivity,provinceNumber,provinceName,steward,hasPos,const DeepCollectionEquality().hash(centersAllocation),const DeepCollectionEquality().hash(killHouseCentersAllocation),const DeepCollectionEquality().hash(allocationLimit),limitationAllocation,registerarRole,registerarFullname,registerarMobile,killHouseRegister,stewardRegister,guildsRoomRegister,posCompanyRegister,provinceAcceptState,provinceMessage,condition,descriptionCondition,stewardActive,const DeepCollectionEquality().hash(stewardAllocationLimit),stewardLimitationAllocation,license,const DeepCollectionEquality().hash(licenseForm),const DeepCollectionEquality().hash(licenseFile),reviewerRole,reviewerFullname,reviewerMobile,checkerMessage,finalAccept,temporaryRegistration,createdBy,modifiedBy,const DeepCollectionEquality().hash(userBankInfo),wallet,const DeepCollectionEquality().hash(cars),const DeepCollectionEquality().hash(userLevel)]); + +@override +String toString() { + return 'Steward(id: $id, user: $user, address: $address, guildAreaActivity: $guildAreaActivity, guildTypeActivity: $guildTypeActivity, killHouse: $killHouse, stewardKillHouse: $stewardKillHouse, stewards: $stewards, getPosStatus: $getPosStatus, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, userIdForeignKey: $userIdForeignKey, addressIdForeignKey: $addressIdForeignKey, userBankIdForeignKey: $userBankIdForeignKey, walletIdForeignKey: $walletIdForeignKey, provincialGovernmentIdKey: $provincialGovernmentIdKey, identityDocuments: $identityDocuments, active: $active, cityNumber: $cityNumber, cityName: $cityName, guildsId: $guildsId, licenseNumber: $licenseNumber, guildsName: $guildsName, phone: $phone, typeActivity: $typeActivity, areaActivity: $areaActivity, provinceNumber: $provinceNumber, provinceName: $provinceName, steward: $steward, hasPos: $hasPos, centersAllocation: $centersAllocation, killHouseCentersAllocation: $killHouseCentersAllocation, allocationLimit: $allocationLimit, limitationAllocation: $limitationAllocation, registerarRole: $registerarRole, registerarFullname: $registerarFullname, registerarMobile: $registerarMobile, killHouseRegister: $killHouseRegister, stewardRegister: $stewardRegister, guildsRoomRegister: $guildsRoomRegister, posCompanyRegister: $posCompanyRegister, provinceAcceptState: $provinceAcceptState, provinceMessage: $provinceMessage, condition: $condition, descriptionCondition: $descriptionCondition, stewardActive: $stewardActive, stewardAllocationLimit: $stewardAllocationLimit, stewardLimitationAllocation: $stewardLimitationAllocation, license: $license, licenseForm: $licenseForm, licenseFile: $licenseFile, reviewerRole: $reviewerRole, reviewerFullname: $reviewerFullname, reviewerMobile: $reviewerMobile, checkerMessage: $checkerMessage, finalAccept: $finalAccept, temporaryRegistration: $temporaryRegistration, createdBy: $createdBy, modifiedBy: $modifiedBy, userBankInfo: $userBankInfo, wallet: $wallet, cars: $cars, userLevel: $userLevel)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardCopyWith<$Res> { + factory $StewardCopyWith(Steward value, $Res Function(Steward) _then) = _$StewardCopyWithImpl; +@useResult +$Res call({ + int? id, User? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, String? registerarRole, String? registerarFullname, String? registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, String? provinceMessage, String? condition, String? descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, String? reviewerRole, String? reviewerFullname, String? reviewerMobile, String? checkerMessage, bool? finalAccept, bool? temporaryRegistration, String? createdBy, String? modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel +}); + + +$UserCopyWith<$Res>? get user;$AddressCopyWith<$Res>? get address;$ActivityCopyWith<$Res>? get guildAreaActivity;$ActivityCopyWith<$Res>? get guildTypeActivity;$PosStatusCopyWith<$Res>? get getPosStatus; + +} +/// @nodoc +class _$StewardCopyWithImpl<$Res> + implements $StewardCopyWith<$Res> { + _$StewardCopyWithImpl(this._self, this._then); + + final Steward _self; + final $Res Function(Steward) _then; + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guildAreaActivity = freezed,Object? guildTypeActivity = freezed,Object? killHouse = freezed,Object? stewardKillHouse = freezed,Object? stewards = freezed,Object? getPosStatus = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? userIdForeignKey = freezed,Object? addressIdForeignKey = freezed,Object? userBankIdForeignKey = freezed,Object? walletIdForeignKey = freezed,Object? provincialGovernmentIdKey = freezed,Object? identityDocuments = freezed,Object? active = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? guildsId = freezed,Object? licenseNumber = freezed,Object? guildsName = freezed,Object? phone = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? steward = freezed,Object? hasPos = freezed,Object? centersAllocation = freezed,Object? killHouseCentersAllocation = freezed,Object? allocationLimit = freezed,Object? limitationAllocation = freezed,Object? registerarRole = freezed,Object? registerarFullname = freezed,Object? registerarMobile = freezed,Object? killHouseRegister = freezed,Object? stewardRegister = freezed,Object? guildsRoomRegister = freezed,Object? posCompanyRegister = freezed,Object? provinceAcceptState = freezed,Object? provinceMessage = freezed,Object? condition = freezed,Object? descriptionCondition = freezed,Object? stewardActive = freezed,Object? stewardAllocationLimit = freezed,Object? stewardLimitationAllocation = freezed,Object? license = freezed,Object? licenseForm = freezed,Object? licenseFile = freezed,Object? reviewerRole = freezed,Object? reviewerFullname = freezed,Object? reviewerMobile = freezed,Object? checkerMessage = freezed,Object? finalAccept = freezed,Object? temporaryRegistration = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? userBankInfo = freezed,Object? wallet = freezed,Object? cars = freezed,Object? userLevel = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,guildAreaActivity: freezed == guildAreaActivity ? _self.guildAreaActivity : guildAreaActivity // ignore: cast_nullable_to_non_nullable +as Activity?,guildTypeActivity: freezed == guildTypeActivity ? _self.guildTypeActivity : guildTypeActivity // ignore: cast_nullable_to_non_nullable +as Activity?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as List?,stewardKillHouse: freezed == stewardKillHouse ? _self.stewardKillHouse : stewardKillHouse // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self.stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,getPosStatus: freezed == getPosStatus ? _self.getPosStatus : getPosStatus // ignore: cast_nullable_to_non_nullable +as PosStatus?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,userIdForeignKey: freezed == userIdForeignKey ? _self.userIdForeignKey : userIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,addressIdForeignKey: freezed == addressIdForeignKey ? _self.addressIdForeignKey : addressIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,userBankIdForeignKey: freezed == userBankIdForeignKey ? _self.userBankIdForeignKey : userBankIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,walletIdForeignKey: freezed == walletIdForeignKey ? _self.walletIdForeignKey : walletIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,provincialGovernmentIdKey: freezed == provincialGovernmentIdKey ? _self.provincialGovernmentIdKey : provincialGovernmentIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,identityDocuments: freezed == identityDocuments ? _self.identityDocuments : identityDocuments // ignore: cast_nullable_to_non_nullable +as dynamic,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,hasPos: freezed == hasPos ? _self.hasPos : hasPos // ignore: cast_nullable_to_non_nullable +as bool?,centersAllocation: freezed == centersAllocation ? _self.centersAllocation : centersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,killHouseCentersAllocation: freezed == killHouseCentersAllocation ? _self.killHouseCentersAllocation : killHouseCentersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,limitationAllocation: freezed == limitationAllocation ? _self.limitationAllocation : limitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,registerarRole: freezed == registerarRole ? _self.registerarRole : registerarRole // ignore: cast_nullable_to_non_nullable +as String?,registerarFullname: freezed == registerarFullname ? _self.registerarFullname : registerarFullname // ignore: cast_nullable_to_non_nullable +as String?,registerarMobile: freezed == registerarMobile ? _self.registerarMobile : registerarMobile // ignore: cast_nullable_to_non_nullable +as String?,killHouseRegister: freezed == killHouseRegister ? _self.killHouseRegister : killHouseRegister // ignore: cast_nullable_to_non_nullable +as bool?,stewardRegister: freezed == stewardRegister ? _self.stewardRegister : stewardRegister // ignore: cast_nullable_to_non_nullable +as bool?,guildsRoomRegister: freezed == guildsRoomRegister ? _self.guildsRoomRegister : guildsRoomRegister // ignore: cast_nullable_to_non_nullable +as bool?,posCompanyRegister: freezed == posCompanyRegister ? _self.posCompanyRegister : posCompanyRegister // ignore: cast_nullable_to_non_nullable +as bool?,provinceAcceptState: freezed == provinceAcceptState ? _self.provinceAcceptState : provinceAcceptState // ignore: cast_nullable_to_non_nullable +as String?,provinceMessage: freezed == provinceMessage ? _self.provinceMessage : provinceMessage // ignore: cast_nullable_to_non_nullable +as String?,condition: freezed == condition ? _self.condition : condition // ignore: cast_nullable_to_non_nullable +as String?,descriptionCondition: freezed == descriptionCondition ? _self.descriptionCondition : descriptionCondition // ignore: cast_nullable_to_non_nullable +as String?,stewardActive: freezed == stewardActive ? _self.stewardActive : stewardActive // ignore: cast_nullable_to_non_nullable +as bool?,stewardAllocationLimit: freezed == stewardAllocationLimit ? _self.stewardAllocationLimit : stewardAllocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,stewardLimitationAllocation: freezed == stewardLimitationAllocation ? _self.stewardLimitationAllocation : stewardLimitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,licenseForm: freezed == licenseForm ? _self.licenseForm : licenseForm // ignore: cast_nullable_to_non_nullable +as dynamic,licenseFile: freezed == licenseFile ? _self.licenseFile : licenseFile // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerRole: freezed == reviewerRole ? _self.reviewerRole : reviewerRole // ignore: cast_nullable_to_non_nullable +as String?,reviewerFullname: freezed == reviewerFullname ? _self.reviewerFullname : reviewerFullname // ignore: cast_nullable_to_non_nullable +as String?,reviewerMobile: freezed == reviewerMobile ? _self.reviewerMobile : reviewerMobile // ignore: cast_nullable_to_non_nullable +as String?,checkerMessage: freezed == checkerMessage ? _self.checkerMessage : checkerMessage // ignore: cast_nullable_to_non_nullable +as String?,finalAccept: freezed == finalAccept ? _self.finalAccept : finalAccept // ignore: cast_nullable_to_non_nullable +as bool?,temporaryRegistration: freezed == temporaryRegistration ? _self.temporaryRegistration : temporaryRegistration // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,userBankInfo: freezed == userBankInfo ? _self.userBankInfo : userBankInfo // ignore: cast_nullable_to_non_nullable +as dynamic,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self.cars : cars // ignore: cast_nullable_to_non_nullable +as List?,userLevel: freezed == userLevel ? _self.userLevel : userLevel // ignore: cast_nullable_to_non_nullable +as List?, + )); +} +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildAreaActivity { + if (_self.guildAreaActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildAreaActivity!, (value) { + return _then(_self.copyWith(guildAreaActivity: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildTypeActivity { + if (_self.guildTypeActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildTypeActivity!, (value) { + return _then(_self.copyWith(guildTypeActivity: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PosStatusCopyWith<$Res>? get getPosStatus { + if (_self.getPosStatus == null) { + return null; + } + + return $PosStatusCopyWith<$Res>(_self.getPosStatus!, (value) { + return _then(_self.copyWith(getPosStatus: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Steward]. +extension StewardPatterns on Steward { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Steward value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Steward value) $default,){ +final _that = this; +switch (_that) { +case _Steward(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Steward value)? $default,){ +final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, User? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, String? registerarRole, String? registerarFullname, String? registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, String? provinceMessage, String? condition, String? descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, String? reviewerRole, String? reviewerFullname, String? reviewerMobile, String? checkerMessage, bool? finalAccept, bool? temporaryRegistration, String? createdBy, String? modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.userIdForeignKey,_that.addressIdForeignKey,_that.userBankIdForeignKey,_that.walletIdForeignKey,_that.provincialGovernmentIdKey,_that.identityDocuments,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.centersAllocation,_that.killHouseCentersAllocation,_that.allocationLimit,_that.limitationAllocation,_that.registerarRole,_that.registerarFullname,_that.registerarMobile,_that.killHouseRegister,_that.stewardRegister,_that.guildsRoomRegister,_that.posCompanyRegister,_that.provinceAcceptState,_that.provinceMessage,_that.condition,_that.descriptionCondition,_that.stewardActive,_that.stewardAllocationLimit,_that.stewardLimitationAllocation,_that.license,_that.licenseForm,_that.licenseFile,_that.reviewerRole,_that.reviewerFullname,_that.reviewerMobile,_that.checkerMessage,_that.finalAccept,_that.temporaryRegistration,_that.createdBy,_that.modifiedBy,_that.userBankInfo,_that.wallet,_that.cars,_that.userLevel);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, User? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, String? registerarRole, String? registerarFullname, String? registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, String? provinceMessage, String? condition, String? descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, String? reviewerRole, String? reviewerFullname, String? reviewerMobile, String? checkerMessage, bool? finalAccept, bool? temporaryRegistration, String? createdBy, String? modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel) $default,) {final _that = this; +switch (_that) { +case _Steward(): +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.userIdForeignKey,_that.addressIdForeignKey,_that.userBankIdForeignKey,_that.walletIdForeignKey,_that.provincialGovernmentIdKey,_that.identityDocuments,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.centersAllocation,_that.killHouseCentersAllocation,_that.allocationLimit,_that.limitationAllocation,_that.registerarRole,_that.registerarFullname,_that.registerarMobile,_that.killHouseRegister,_that.stewardRegister,_that.guildsRoomRegister,_that.posCompanyRegister,_that.provinceAcceptState,_that.provinceMessage,_that.condition,_that.descriptionCondition,_that.stewardActive,_that.stewardAllocationLimit,_that.stewardLimitationAllocation,_that.license,_that.licenseForm,_that.licenseFile,_that.reviewerRole,_that.reviewerFullname,_that.reviewerMobile,_that.checkerMessage,_that.finalAccept,_that.temporaryRegistration,_that.createdBy,_that.modifiedBy,_that.userBankInfo,_that.wallet,_that.cars,_that.userLevel);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, User? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, String? registerarRole, String? registerarFullname, String? registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, String? provinceMessage, String? condition, String? descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, String? reviewerRole, String? reviewerFullname, String? reviewerMobile, String? checkerMessage, bool? finalAccept, bool? temporaryRegistration, String? createdBy, String? modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel)? $default,) {final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.userIdForeignKey,_that.addressIdForeignKey,_that.userBankIdForeignKey,_that.walletIdForeignKey,_that.provincialGovernmentIdKey,_that.identityDocuments,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.centersAllocation,_that.killHouseCentersAllocation,_that.allocationLimit,_that.limitationAllocation,_that.registerarRole,_that.registerarFullname,_that.registerarMobile,_that.killHouseRegister,_that.stewardRegister,_that.guildsRoomRegister,_that.posCompanyRegister,_that.provinceAcceptState,_that.provinceMessage,_that.condition,_that.descriptionCondition,_that.stewardActive,_that.stewardAllocationLimit,_that.stewardLimitationAllocation,_that.license,_that.licenseForm,_that.licenseFile,_that.reviewerRole,_that.reviewerFullname,_that.reviewerMobile,_that.checkerMessage,_that.finalAccept,_that.temporaryRegistration,_that.createdBy,_that.modifiedBy,_that.userBankInfo,_that.wallet,_that.cars,_that.userLevel);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Steward implements Steward { + _Steward({this.id, this.user, this.address, this.guildAreaActivity, this.guildTypeActivity, final List? killHouse, final List? stewardKillHouse, final List? stewards, this.getPosStatus, this.key, this.createDate, this.modifyDate, this.trash, this.userIdForeignKey, this.addressIdForeignKey, this.userBankIdForeignKey, this.walletIdForeignKey, this.provincialGovernmentIdKey, this.identityDocuments, this.active, this.cityNumber, this.cityName, this.guildsId, this.licenseNumber, this.guildsName, this.phone, this.typeActivity, this.areaActivity, this.provinceNumber, this.provinceName, this.steward, this.hasPos, this.centersAllocation, this.killHouseCentersAllocation, this.allocationLimit, this.limitationAllocation, this.registerarRole, this.registerarFullname, this.registerarMobile, this.killHouseRegister, this.stewardRegister, this.guildsRoomRegister, this.posCompanyRegister, this.provinceAcceptState, this.provinceMessage, this.condition, this.descriptionCondition, this.stewardActive, this.stewardAllocationLimit, this.stewardLimitationAllocation, this.license, this.licenseForm, this.licenseFile, this.reviewerRole, this.reviewerFullname, this.reviewerMobile, this.checkerMessage, this.finalAccept, this.temporaryRegistration, this.createdBy, this.modifiedBy, this.userBankInfo, this.wallet, final List? cars, final List? userLevel}): _killHouse = killHouse,_stewardKillHouse = stewardKillHouse,_stewards = stewards,_cars = cars,_userLevel = userLevel; + factory _Steward.fromJson(Map json) => _$StewardFromJson(json); + +@override final int? id; +@override final User? user; +@override final Address? address; +@override final Activity? guildAreaActivity; +@override final Activity? guildTypeActivity; + final List? _killHouse; +@override List? get killHouse { + final value = _killHouse; + if (value == null) return null; + if (_killHouse is EqualUnmodifiableListView) return _killHouse; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewardKillHouse; +@override List? get stewardKillHouse { + final value = _stewardKillHouse; + if (value == null) return null; + if (_stewardKillHouse is EqualUnmodifiableListView) return _stewardKillHouse; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewards; +@override List? get stewards { + final value = _stewards; + if (value == null) return null; + if (_stewards is EqualUnmodifiableListView) return _stewards; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final PosStatus? getPosStatus; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final dynamic userIdForeignKey; +@override final dynamic addressIdForeignKey; +@override final dynamic userBankIdForeignKey; +@override final dynamic walletIdForeignKey; +@override final dynamic provincialGovernmentIdKey; +@override final dynamic identityDocuments; +@override final bool? active; +@override final int? cityNumber; +@override final String? cityName; +@override final String? guildsId; +@override final String? licenseNumber; +@override final String? guildsName; +@override final String? phone; +@override final String? typeActivity; +@override final String? areaActivity; +@override final int? provinceNumber; +@override final String? provinceName; +@override final bool? steward; +@override final bool? hasPos; +@override final dynamic centersAllocation; +@override final dynamic killHouseCentersAllocation; +@override final dynamic allocationLimit; +@override final bool? limitationAllocation; +@override final String? registerarRole; +@override final String? registerarFullname; +@override final String? registerarMobile; +@override final bool? killHouseRegister; +@override final bool? stewardRegister; +@override final bool? guildsRoomRegister; +@override final bool? posCompanyRegister; +@override final String? provinceAcceptState; +@override final String? provinceMessage; +@override final String? condition; +@override final String? descriptionCondition; +@override final bool? stewardActive; +@override final dynamic stewardAllocationLimit; +@override final bool? stewardLimitationAllocation; +@override final bool? license; +@override final dynamic licenseForm; +@override final dynamic licenseFile; +@override final String? reviewerRole; +@override final String? reviewerFullname; +@override final String? reviewerMobile; +@override final String? checkerMessage; +@override final bool? finalAccept; +@override final bool? temporaryRegistration; +@override final String? createdBy; +@override final String? modifiedBy; +@override final dynamic userBankInfo; +@override final int? wallet; + final List? _cars; +@override List? get cars { + final value = _cars; + if (value == null) return null; + if (_cars is EqualUnmodifiableListView) return _cars; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _userLevel; +@override List? get userLevel { + final value = _userLevel; + if (value == null) return null; + if (_userLevel is EqualUnmodifiableListView) return _userLevel; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardCopyWith<_Steward> get copyWith => __$StewardCopyWithImpl<_Steward>(this, _$identity); + +@override +Map toJson() { + return _$StewardToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Steward&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&(identical(other.guildAreaActivity, guildAreaActivity) || other.guildAreaActivity == guildAreaActivity)&&(identical(other.guildTypeActivity, guildTypeActivity) || other.guildTypeActivity == guildTypeActivity)&&const DeepCollectionEquality().equals(other._killHouse, _killHouse)&&const DeepCollectionEquality().equals(other._stewardKillHouse, _stewardKillHouse)&&const DeepCollectionEquality().equals(other._stewards, _stewards)&&(identical(other.getPosStatus, getPosStatus) || other.getPosStatus == getPosStatus)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&const DeepCollectionEquality().equals(other.userIdForeignKey, userIdForeignKey)&&const DeepCollectionEquality().equals(other.addressIdForeignKey, addressIdForeignKey)&&const DeepCollectionEquality().equals(other.userBankIdForeignKey, userBankIdForeignKey)&&const DeepCollectionEquality().equals(other.walletIdForeignKey, walletIdForeignKey)&&const DeepCollectionEquality().equals(other.provincialGovernmentIdKey, provincialGovernmentIdKey)&&const DeepCollectionEquality().equals(other.identityDocuments, identityDocuments)&&(identical(other.active, active) || other.active == active)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.hasPos, hasPos) || other.hasPos == hasPos)&&const DeepCollectionEquality().equals(other.centersAllocation, centersAllocation)&&const DeepCollectionEquality().equals(other.killHouseCentersAllocation, killHouseCentersAllocation)&&const DeepCollectionEquality().equals(other.allocationLimit, allocationLimit)&&(identical(other.limitationAllocation, limitationAllocation) || other.limitationAllocation == limitationAllocation)&&(identical(other.registerarRole, registerarRole) || other.registerarRole == registerarRole)&&(identical(other.registerarFullname, registerarFullname) || other.registerarFullname == registerarFullname)&&(identical(other.registerarMobile, registerarMobile) || other.registerarMobile == registerarMobile)&&(identical(other.killHouseRegister, killHouseRegister) || other.killHouseRegister == killHouseRegister)&&(identical(other.stewardRegister, stewardRegister) || other.stewardRegister == stewardRegister)&&(identical(other.guildsRoomRegister, guildsRoomRegister) || other.guildsRoomRegister == guildsRoomRegister)&&(identical(other.posCompanyRegister, posCompanyRegister) || other.posCompanyRegister == posCompanyRegister)&&(identical(other.provinceAcceptState, provinceAcceptState) || other.provinceAcceptState == provinceAcceptState)&&(identical(other.provinceMessage, provinceMessage) || other.provinceMessage == provinceMessage)&&(identical(other.condition, condition) || other.condition == condition)&&(identical(other.descriptionCondition, descriptionCondition) || other.descriptionCondition == descriptionCondition)&&(identical(other.stewardActive, stewardActive) || other.stewardActive == stewardActive)&&const DeepCollectionEquality().equals(other.stewardAllocationLimit, stewardAllocationLimit)&&(identical(other.stewardLimitationAllocation, stewardLimitationAllocation) || other.stewardLimitationAllocation == stewardLimitationAllocation)&&(identical(other.license, license) || other.license == license)&&const DeepCollectionEquality().equals(other.licenseForm, licenseForm)&&const DeepCollectionEquality().equals(other.licenseFile, licenseFile)&&(identical(other.reviewerRole, reviewerRole) || other.reviewerRole == reviewerRole)&&(identical(other.reviewerFullname, reviewerFullname) || other.reviewerFullname == reviewerFullname)&&(identical(other.reviewerMobile, reviewerMobile) || other.reviewerMobile == reviewerMobile)&&(identical(other.checkerMessage, checkerMessage) || other.checkerMessage == checkerMessage)&&(identical(other.finalAccept, finalAccept) || other.finalAccept == finalAccept)&&(identical(other.temporaryRegistration, temporaryRegistration) || other.temporaryRegistration == temporaryRegistration)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&const DeepCollectionEquality().equals(other.userBankInfo, userBankInfo)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other._cars, _cars)&&const DeepCollectionEquality().equals(other._userLevel, _userLevel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,guildAreaActivity,guildTypeActivity,const DeepCollectionEquality().hash(_killHouse),const DeepCollectionEquality().hash(_stewardKillHouse),const DeepCollectionEquality().hash(_stewards),getPosStatus,key,createDate,modifyDate,trash,const DeepCollectionEquality().hash(userIdForeignKey),const DeepCollectionEquality().hash(addressIdForeignKey),const DeepCollectionEquality().hash(userBankIdForeignKey),const DeepCollectionEquality().hash(walletIdForeignKey),const DeepCollectionEquality().hash(provincialGovernmentIdKey),const DeepCollectionEquality().hash(identityDocuments),active,cityNumber,cityName,guildsId,licenseNumber,guildsName,phone,typeActivity,areaActivity,provinceNumber,provinceName,steward,hasPos,const DeepCollectionEquality().hash(centersAllocation),const DeepCollectionEquality().hash(killHouseCentersAllocation),const DeepCollectionEquality().hash(allocationLimit),limitationAllocation,registerarRole,registerarFullname,registerarMobile,killHouseRegister,stewardRegister,guildsRoomRegister,posCompanyRegister,provinceAcceptState,provinceMessage,condition,descriptionCondition,stewardActive,const DeepCollectionEquality().hash(stewardAllocationLimit),stewardLimitationAllocation,license,const DeepCollectionEquality().hash(licenseForm),const DeepCollectionEquality().hash(licenseFile),reviewerRole,reviewerFullname,reviewerMobile,checkerMessage,finalAccept,temporaryRegistration,createdBy,modifiedBy,const DeepCollectionEquality().hash(userBankInfo),wallet,const DeepCollectionEquality().hash(_cars),const DeepCollectionEquality().hash(_userLevel)]); + +@override +String toString() { + return 'Steward(id: $id, user: $user, address: $address, guildAreaActivity: $guildAreaActivity, guildTypeActivity: $guildTypeActivity, killHouse: $killHouse, stewardKillHouse: $stewardKillHouse, stewards: $stewards, getPosStatus: $getPosStatus, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, userIdForeignKey: $userIdForeignKey, addressIdForeignKey: $addressIdForeignKey, userBankIdForeignKey: $userBankIdForeignKey, walletIdForeignKey: $walletIdForeignKey, provincialGovernmentIdKey: $provincialGovernmentIdKey, identityDocuments: $identityDocuments, active: $active, cityNumber: $cityNumber, cityName: $cityName, guildsId: $guildsId, licenseNumber: $licenseNumber, guildsName: $guildsName, phone: $phone, typeActivity: $typeActivity, areaActivity: $areaActivity, provinceNumber: $provinceNumber, provinceName: $provinceName, steward: $steward, hasPos: $hasPos, centersAllocation: $centersAllocation, killHouseCentersAllocation: $killHouseCentersAllocation, allocationLimit: $allocationLimit, limitationAllocation: $limitationAllocation, registerarRole: $registerarRole, registerarFullname: $registerarFullname, registerarMobile: $registerarMobile, killHouseRegister: $killHouseRegister, stewardRegister: $stewardRegister, guildsRoomRegister: $guildsRoomRegister, posCompanyRegister: $posCompanyRegister, provinceAcceptState: $provinceAcceptState, provinceMessage: $provinceMessage, condition: $condition, descriptionCondition: $descriptionCondition, stewardActive: $stewardActive, stewardAllocationLimit: $stewardAllocationLimit, stewardLimitationAllocation: $stewardLimitationAllocation, license: $license, licenseForm: $licenseForm, licenseFile: $licenseFile, reviewerRole: $reviewerRole, reviewerFullname: $reviewerFullname, reviewerMobile: $reviewerMobile, checkerMessage: $checkerMessage, finalAccept: $finalAccept, temporaryRegistration: $temporaryRegistration, createdBy: $createdBy, modifiedBy: $modifiedBy, userBankInfo: $userBankInfo, wallet: $wallet, cars: $cars, userLevel: $userLevel)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardCopyWith<$Res> implements $StewardCopyWith<$Res> { + factory _$StewardCopyWith(_Steward value, $Res Function(_Steward) _then) = __$StewardCopyWithImpl; +@override @useResult +$Res call({ + int? id, User? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, String? registerarRole, String? registerarFullname, String? registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, String? provinceMessage, String? condition, String? descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, String? reviewerRole, String? reviewerFullname, String? reviewerMobile, String? checkerMessage, bool? finalAccept, bool? temporaryRegistration, String? createdBy, String? modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel +}); + + +@override $UserCopyWith<$Res>? get user;@override $AddressCopyWith<$Res>? get address;@override $ActivityCopyWith<$Res>? get guildAreaActivity;@override $ActivityCopyWith<$Res>? get guildTypeActivity;@override $PosStatusCopyWith<$Res>? get getPosStatus; + +} +/// @nodoc +class __$StewardCopyWithImpl<$Res> + implements _$StewardCopyWith<$Res> { + __$StewardCopyWithImpl(this._self, this._then); + + final _Steward _self; + final $Res Function(_Steward) _then; + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guildAreaActivity = freezed,Object? guildTypeActivity = freezed,Object? killHouse = freezed,Object? stewardKillHouse = freezed,Object? stewards = freezed,Object? getPosStatus = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? userIdForeignKey = freezed,Object? addressIdForeignKey = freezed,Object? userBankIdForeignKey = freezed,Object? walletIdForeignKey = freezed,Object? provincialGovernmentIdKey = freezed,Object? identityDocuments = freezed,Object? active = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? guildsId = freezed,Object? licenseNumber = freezed,Object? guildsName = freezed,Object? phone = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? steward = freezed,Object? hasPos = freezed,Object? centersAllocation = freezed,Object? killHouseCentersAllocation = freezed,Object? allocationLimit = freezed,Object? limitationAllocation = freezed,Object? registerarRole = freezed,Object? registerarFullname = freezed,Object? registerarMobile = freezed,Object? killHouseRegister = freezed,Object? stewardRegister = freezed,Object? guildsRoomRegister = freezed,Object? posCompanyRegister = freezed,Object? provinceAcceptState = freezed,Object? provinceMessage = freezed,Object? condition = freezed,Object? descriptionCondition = freezed,Object? stewardActive = freezed,Object? stewardAllocationLimit = freezed,Object? stewardLimitationAllocation = freezed,Object? license = freezed,Object? licenseForm = freezed,Object? licenseFile = freezed,Object? reviewerRole = freezed,Object? reviewerFullname = freezed,Object? reviewerMobile = freezed,Object? checkerMessage = freezed,Object? finalAccept = freezed,Object? temporaryRegistration = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? userBankInfo = freezed,Object? wallet = freezed,Object? cars = freezed,Object? userLevel = freezed,}) { + return _then(_Steward( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,guildAreaActivity: freezed == guildAreaActivity ? _self.guildAreaActivity : guildAreaActivity // ignore: cast_nullable_to_non_nullable +as Activity?,guildTypeActivity: freezed == guildTypeActivity ? _self.guildTypeActivity : guildTypeActivity // ignore: cast_nullable_to_non_nullable +as Activity?,killHouse: freezed == killHouse ? _self._killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as List?,stewardKillHouse: freezed == stewardKillHouse ? _self._stewardKillHouse : stewardKillHouse // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self._stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,getPosStatus: freezed == getPosStatus ? _self.getPosStatus : getPosStatus // ignore: cast_nullable_to_non_nullable +as PosStatus?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,userIdForeignKey: freezed == userIdForeignKey ? _self.userIdForeignKey : userIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,addressIdForeignKey: freezed == addressIdForeignKey ? _self.addressIdForeignKey : addressIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,userBankIdForeignKey: freezed == userBankIdForeignKey ? _self.userBankIdForeignKey : userBankIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,walletIdForeignKey: freezed == walletIdForeignKey ? _self.walletIdForeignKey : walletIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,provincialGovernmentIdKey: freezed == provincialGovernmentIdKey ? _self.provincialGovernmentIdKey : provincialGovernmentIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,identityDocuments: freezed == identityDocuments ? _self.identityDocuments : identityDocuments // ignore: cast_nullable_to_non_nullable +as dynamic,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,hasPos: freezed == hasPos ? _self.hasPos : hasPos // ignore: cast_nullable_to_non_nullable +as bool?,centersAllocation: freezed == centersAllocation ? _self.centersAllocation : centersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,killHouseCentersAllocation: freezed == killHouseCentersAllocation ? _self.killHouseCentersAllocation : killHouseCentersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,limitationAllocation: freezed == limitationAllocation ? _self.limitationAllocation : limitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,registerarRole: freezed == registerarRole ? _self.registerarRole : registerarRole // ignore: cast_nullable_to_non_nullable +as String?,registerarFullname: freezed == registerarFullname ? _self.registerarFullname : registerarFullname // ignore: cast_nullable_to_non_nullable +as String?,registerarMobile: freezed == registerarMobile ? _self.registerarMobile : registerarMobile // ignore: cast_nullable_to_non_nullable +as String?,killHouseRegister: freezed == killHouseRegister ? _self.killHouseRegister : killHouseRegister // ignore: cast_nullable_to_non_nullable +as bool?,stewardRegister: freezed == stewardRegister ? _self.stewardRegister : stewardRegister // ignore: cast_nullable_to_non_nullable +as bool?,guildsRoomRegister: freezed == guildsRoomRegister ? _self.guildsRoomRegister : guildsRoomRegister // ignore: cast_nullable_to_non_nullable +as bool?,posCompanyRegister: freezed == posCompanyRegister ? _self.posCompanyRegister : posCompanyRegister // ignore: cast_nullable_to_non_nullable +as bool?,provinceAcceptState: freezed == provinceAcceptState ? _self.provinceAcceptState : provinceAcceptState // ignore: cast_nullable_to_non_nullable +as String?,provinceMessage: freezed == provinceMessage ? _self.provinceMessage : provinceMessage // ignore: cast_nullable_to_non_nullable +as String?,condition: freezed == condition ? _self.condition : condition // ignore: cast_nullable_to_non_nullable +as String?,descriptionCondition: freezed == descriptionCondition ? _self.descriptionCondition : descriptionCondition // ignore: cast_nullable_to_non_nullable +as String?,stewardActive: freezed == stewardActive ? _self.stewardActive : stewardActive // ignore: cast_nullable_to_non_nullable +as bool?,stewardAllocationLimit: freezed == stewardAllocationLimit ? _self.stewardAllocationLimit : stewardAllocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,stewardLimitationAllocation: freezed == stewardLimitationAllocation ? _self.stewardLimitationAllocation : stewardLimitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,licenseForm: freezed == licenseForm ? _self.licenseForm : licenseForm // ignore: cast_nullable_to_non_nullable +as dynamic,licenseFile: freezed == licenseFile ? _self.licenseFile : licenseFile // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerRole: freezed == reviewerRole ? _self.reviewerRole : reviewerRole // ignore: cast_nullable_to_non_nullable +as String?,reviewerFullname: freezed == reviewerFullname ? _self.reviewerFullname : reviewerFullname // ignore: cast_nullable_to_non_nullable +as String?,reviewerMobile: freezed == reviewerMobile ? _self.reviewerMobile : reviewerMobile // ignore: cast_nullable_to_non_nullable +as String?,checkerMessage: freezed == checkerMessage ? _self.checkerMessage : checkerMessage // ignore: cast_nullable_to_non_nullable +as String?,finalAccept: freezed == finalAccept ? _self.finalAccept : finalAccept // ignore: cast_nullable_to_non_nullable +as bool?,temporaryRegistration: freezed == temporaryRegistration ? _self.temporaryRegistration : temporaryRegistration // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,userBankInfo: freezed == userBankInfo ? _self.userBankInfo : userBankInfo // ignore: cast_nullable_to_non_nullable +as dynamic,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self._cars : cars // ignore: cast_nullable_to_non_nullable +as List?,userLevel: freezed == userLevel ? _self._userLevel : userLevel // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildAreaActivity { + if (_self.guildAreaActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildAreaActivity!, (value) { + return _then(_self.copyWith(guildAreaActivity: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildTypeActivity { + if (_self.guildTypeActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildTypeActivity!, (value) { + return _then(_self.copyWith(guildTypeActivity: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PosStatusCopyWith<$Res>? get getPosStatus { + if (_self.getPosStatus == null) { + return null; + } + + return $PosStatusCopyWith<$Res>(_self.getPosStatus!, (value) { + return _then(_self.copyWith(getPosStatus: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get nationalId; String? get city; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + _User({this.fullname, this.firstName, this.lastName, this.mobile, this.nationalId, this.city}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? nationalId; +@override final String? city; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Address { + + Province? get province; Province? get city; String? get address; String? get postalCode; +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressCopyWith
get copyWith => _$AddressCopyWithImpl
(this as Address, _$identity); + + /// Serializes this Address to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $AddressCopyWith<$Res> { + factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl; +@useResult +$Res call({ + Province? province, Province? city, String? address, String? postalCode +}); + + +$ProvinceCopyWith<$Res>? get province;$ProvinceCopyWith<$Res>? get city; + +} +/// @nodoc +class _$AddressCopyWithImpl<$Res> + implements $AddressCopyWith<$Res> { + _$AddressCopyWithImpl(this._self, this._then); + + final Address _self; + final $Res Function(Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as Province?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Address]. +extension AddressPatterns on Address { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Address value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Address value) $default,){ +final _that = this; +switch (_that) { +case _Address(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Address value)? $default,){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Province? province, Province? city, String? address, String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Province? province, Province? city, String? address, String? postalCode) $default,) {final _that = this; +switch (_that) { +case _Address(): +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Province? province, Province? city, String? address, String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Address implements Address { + _Address({this.province, this.city, this.address, this.postalCode}); + factory _Address.fromJson(Map json) => _$AddressFromJson(json); + +@override final Province? province; +@override final Province? city; +@override final String? address; +@override final String? postalCode; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity); + +@override +Map toJson() { + return _$AddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> { + factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl; +@override @useResult +$Res call({ + Province? province, Province? city, String? address, String? postalCode +}); + + +@override $ProvinceCopyWith<$Res>? get province;@override $ProvinceCopyWith<$Res>? get city; + +} +/// @nodoc +class __$AddressCopyWithImpl<$Res> + implements _$AddressCopyWith<$Res> { + __$AddressCopyWithImpl(this._self, this._then); + + final _Address _self; + final $Res Function(_Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_Address( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as Province?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$Province { + + String? get key; String? get name; +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProvinceCopyWith get copyWith => _$ProvinceCopyWithImpl(this as Province, _$identity); + + /// Serializes this Province to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProvinceCopyWith<$Res> { + factory $ProvinceCopyWith(Province value, $Res Function(Province) _then) = _$ProvinceCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$ProvinceCopyWithImpl<$Res> + implements $ProvinceCopyWith<$Res> { + _$ProvinceCopyWithImpl(this._self, this._then); + + final Province _self; + final $Res Function(Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Province]. +extension ProvincePatterns on Province { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Province value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Province value) $default,){ +final _that = this; +switch (_that) { +case _Province(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Province value)? $default,){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _Province(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Province implements Province { + _Province({this.key, this.name}); + factory _Province.fromJson(Map json) => _$ProvinceFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProvinceCopyWith<_Province> get copyWith => __$ProvinceCopyWithImpl<_Province>(this, _$identity); + +@override +Map toJson() { + return _$ProvinceToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProvinceCopyWith<$Res> implements $ProvinceCopyWith<$Res> { + factory _$ProvinceCopyWith(_Province value, $Res Function(_Province) _then) = __$ProvinceCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$ProvinceCopyWithImpl<$Res> + implements _$ProvinceCopyWith<$Res> { + __$ProvinceCopyWithImpl(this._self, this._then); + + final _Province _self; + final $Res Function(_Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_Province( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Activity { + + String? get key; String? get title; +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ActivityCopyWith get copyWith => _$ActivityCopyWithImpl(this as Activity, _$identity); + + /// Serializes this Activity to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Activity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'Activity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class $ActivityCopyWith<$Res> { + factory $ActivityCopyWith(Activity value, $Res Function(Activity) _then) = _$ActivityCopyWithImpl; +@useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class _$ActivityCopyWithImpl<$Res> + implements $ActivityCopyWith<$Res> { + _$ActivityCopyWithImpl(this._self, this._then); + + final Activity _self; + final $Res Function(Activity) _then; + +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Activity]. +extension ActivityPatterns on Activity { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Activity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Activity value) $default,){ +final _that = this; +switch (_that) { +case _Activity(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Activity value)? $default,){ +final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? title)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that.key,_that.title);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? title) $default,) {final _that = this; +switch (_that) { +case _Activity(): +return $default(_that.key,_that.title);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? title)? $default,) {final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that.key,_that.title);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Activity implements Activity { + _Activity({this.key, this.title}); + factory _Activity.fromJson(Map json) => _$ActivityFromJson(json); + +@override final String? key; +@override final String? title; + +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ActivityCopyWith<_Activity> get copyWith => __$ActivityCopyWithImpl<_Activity>(this, _$identity); + +@override +Map toJson() { + return _$ActivityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Activity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'Activity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class _$ActivityCopyWith<$Res> implements $ActivityCopyWith<$Res> { + factory _$ActivityCopyWith(_Activity value, $Res Function(_Activity) _then) = __$ActivityCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class __$ActivityCopyWithImpl<$Res> + implements _$ActivityCopyWith<$Res> { + __$ActivityCopyWithImpl(this._self, this._then); + + final _Activity _self; + final $Res Function(_Activity) _then; + +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_Activity( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$PosStatus { + + int? get lenActiveSessions; bool? get hasPons; bool? get hasActivePons; +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PosStatusCopyWith get copyWith => _$PosStatusCopyWithImpl(this as PosStatus, _$identity); + + /// Serializes this PosStatus to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PosStatus&&(identical(other.lenActiveSessions, lenActiveSessions) || other.lenActiveSessions == lenActiveSessions)&&(identical(other.hasPons, hasPons) || other.hasPons == hasPons)&&(identical(other.hasActivePons, hasActivePons) || other.hasActivePons == hasActivePons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lenActiveSessions,hasPons,hasActivePons); + +@override +String toString() { + return 'PosStatus(lenActiveSessions: $lenActiveSessions, hasPons: $hasPons, hasActivePons: $hasActivePons)'; +} + + +} + +/// @nodoc +abstract mixin class $PosStatusCopyWith<$Res> { + factory $PosStatusCopyWith(PosStatus value, $Res Function(PosStatus) _then) = _$PosStatusCopyWithImpl; +@useResult +$Res call({ + int? lenActiveSessions, bool? hasPons, bool? hasActivePons +}); + + + + +} +/// @nodoc +class _$PosStatusCopyWithImpl<$Res> + implements $PosStatusCopyWith<$Res> { + _$PosStatusCopyWithImpl(this._self, this._then); + + final PosStatus _self; + final $Res Function(PosStatus) _then; + +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? lenActiveSessions = freezed,Object? hasPons = freezed,Object? hasActivePons = freezed,}) { + return _then(_self.copyWith( +lenActiveSessions: freezed == lenActiveSessions ? _self.lenActiveSessions : lenActiveSessions // ignore: cast_nullable_to_non_nullable +as int?,hasPons: freezed == hasPons ? _self.hasPons : hasPons // ignore: cast_nullable_to_non_nullable +as bool?,hasActivePons: freezed == hasActivePons ? _self.hasActivePons : hasActivePons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PosStatus]. +extension PosStatusPatterns on PosStatus { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PosStatus value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PosStatus value) $default,){ +final _that = this; +switch (_that) { +case _PosStatus(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PosStatus value)? $default,){ +final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons) $default,) {final _that = this; +switch (_that) { +case _PosStatus(): +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons)? $default,) {final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PosStatus implements PosStatus { + _PosStatus({this.lenActiveSessions, this.hasPons, this.hasActivePons}); + factory _PosStatus.fromJson(Map json) => _$PosStatusFromJson(json); + +@override final int? lenActiveSessions; +@override final bool? hasPons; +@override final bool? hasActivePons; + +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PosStatusCopyWith<_PosStatus> get copyWith => __$PosStatusCopyWithImpl<_PosStatus>(this, _$identity); + +@override +Map toJson() { + return _$PosStatusToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PosStatus&&(identical(other.lenActiveSessions, lenActiveSessions) || other.lenActiveSessions == lenActiveSessions)&&(identical(other.hasPons, hasPons) || other.hasPons == hasPons)&&(identical(other.hasActivePons, hasActivePons) || other.hasActivePons == hasActivePons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lenActiveSessions,hasPons,hasActivePons); + +@override +String toString() { + return 'PosStatus(lenActiveSessions: $lenActiveSessions, hasPons: $hasPons, hasActivePons: $hasActivePons)'; +} + + +} + +/// @nodoc +abstract mixin class _$PosStatusCopyWith<$Res> implements $PosStatusCopyWith<$Res> { + factory _$PosStatusCopyWith(_PosStatus value, $Res Function(_PosStatus) _then) = __$PosStatusCopyWithImpl; +@override @useResult +$Res call({ + int? lenActiveSessions, bool? hasPons, bool? hasActivePons +}); + + + + +} +/// @nodoc +class __$PosStatusCopyWithImpl<$Res> + implements _$PosStatusCopyWith<$Res> { + __$PosStatusCopyWithImpl(this._self, this._then); + + final _PosStatus _self; + final $Res Function(_PosStatus) _then; + +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? lenActiveSessions = freezed,Object? hasPons = freezed,Object? hasActivePons = freezed,}) { + return _then(_PosStatus( +lenActiveSessions: freezed == lenActiveSessions ? _self.lenActiveSessions : lenActiveSessions // ignore: cast_nullable_to_non_nullable +as int?,hasPons: freezed == hasPons ? _self.hasPons : hasPons // ignore: cast_nullable_to_non_nullable +as bool?,hasActivePons: freezed == hasActivePons ? _self.hasActivePons : hasActivePons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/allocated_made/allocated_made.g.dart b/packages/chicken/lib/data/models/response/allocated_made/allocated_made.g.dart new file mode 100644 index 0000000..e123cf2 --- /dev/null +++ b/packages/chicken/lib/data/models/response/allocated_made/allocated_made.g.dart @@ -0,0 +1,356 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'allocated_made.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_AllocatedMadeModel _$AllocatedMadeModelFromJson( + Map json, +) => _AllocatedMadeModel( + id: (json['id'] as num?)?.toInt(), + product: json['product'] == null + ? null + : Product.fromJson(json['product'] as Map), + killHouse: json['kill_house'], + toKillHouse: json['to_kill_house'], + steward: json['steward'] == null + ? null + : Steward.fromJson(json['steward'] as Map), + toSteward: json['to_steward'], + guilds: json['guilds'], + toGuilds: json['to_guilds'] == null + ? null + : Steward.fromJson(json['to_guilds'] as Map), + toColdHouse: json['to_cold_house'], + indexWeight: (json['index_weight'] as num?)?.toInt(), + dateTimestamp: (json['date_timestamp'] as num?)?.toInt(), + newState: (json['new_state'] as num?)?.toInt(), + newReceiverState: (json['new_receiver_state'] as num?)?.toInt(), + newAllocationState: (json['new_allocation_state'] as num?)?.toInt(), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(), + receiverRealNumberOfCarcasses: + (json['receiver_real_number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(), + realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(), + receiverRealWeightOfCarcasses: + (json['receiver_real_weight_of_carcasses'] as num?)?.toInt(), + weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(), + finalRegistration: json['final_registration'] as bool?, + sellType: json['sell_type'] as String?, + productName: json['product_name'] as String?, + sellerType: json['seller_type'] as String?, + type: json['type'] as String?, + saleType: json['sale_type'] as String?, + allocationType: json['allocation_type'] as String?, + systemRegistrationCode: json['system_registration_code'] as bool?, + registrationCode: (json['registration_code'] as num?)?.toInt(), + amount: (json['amount'] as num?)?.toInt(), + totalAmount: (json['total_amount'] as num?)?.toInt(), + totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(), + totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(), + loggedRegistrationCode: json['logged_registration_code'] as String?, + state: json['state'] as String?, + receiverState: json['receiver_state'] as String?, + allocationState: json['allocation_state'] as String?, + date: json['date'] as String?, + role: json['role'] as String?, + stewardTempKey: json['steward_temp_key'] as String?, + approvedPriceStatus: json['approved_price_status'] as bool?, + calculateStatus: json['calculate_status'] as bool?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + createdBy: json['created_by'] as String?, + modifiedBy: json['modified_by'] as String?, + wareHouse: json['ware_house'], + stewardWareHouse: json['steward_ware_house'], + car: json['car'], + dispenser: json['dispenser'], +); + +Map _$AllocatedMadeModelToJson( + _AllocatedMadeModel instance, +) => { + 'id': instance.id, + 'product': instance.product, + 'kill_house': instance.killHouse, + 'to_kill_house': instance.toKillHouse, + 'steward': instance.steward, + 'to_steward': instance.toSteward, + 'guilds': instance.guilds, + 'to_guilds': instance.toGuilds, + 'to_cold_house': instance.toColdHouse, + 'index_weight': instance.indexWeight, + 'date_timestamp': instance.dateTimestamp, + 'new_state': instance.newState, + 'new_receiver_state': instance.newReceiverState, + 'new_allocation_state': instance.newAllocationState, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'number_of_carcasses': instance.numberOfCarcasses, + 'real_number_of_carcasses': instance.realNumberOfCarcasses, + 'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'real_weight_of_carcasses': instance.realWeightOfCarcasses, + 'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses, + 'weight_loss_of_carcasses': instance.weightLossOfCarcasses, + 'final_registration': instance.finalRegistration, + 'sell_type': instance.sellType, + 'product_name': instance.productName, + 'seller_type': instance.sellerType, + 'type': instance.type, + 'sale_type': instance.saleType, + 'allocation_type': instance.allocationType, + 'system_registration_code': instance.systemRegistrationCode, + 'registration_code': instance.registrationCode, + 'amount': instance.amount, + 'total_amount': instance.totalAmount, + 'total_amount_paid': instance.totalAmountPaid, + 'total_amount_remain': instance.totalAmountRemain, + 'logged_registration_code': instance.loggedRegistrationCode, + 'state': instance.state, + 'receiver_state': instance.receiverState, + 'allocation_state': instance.allocationState, + 'date': instance.date, + 'role': instance.role, + 'steward_temp_key': instance.stewardTempKey, + 'approved_price_status': instance.approvedPriceStatus, + 'calculate_status': instance.calculateStatus, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'ware_house': instance.wareHouse, + 'steward_ware_house': instance.stewardWareHouse, + 'car': instance.car, + 'dispenser': instance.dispenser, +}; + +_Product _$ProductFromJson(Map json) => _Product( + weightAverage: (json['weight_average'] as num?)?.toInt(), + name: json['name'] as String?, +); + +Map _$ProductToJson(_Product instance) => { + 'weight_average': instance.weightAverage, + 'name': instance.name, +}; + +_Steward _$StewardFromJson(Map json) => _Steward( + id: (json['id'] as num?)?.toInt(), + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + guildAreaActivity: json['guild_area_activity'] == null + ? null + : Activity.fromJson(json['guild_area_activity'] as Map), + guildTypeActivity: json['guild_type_activity'] == null + ? null + : Activity.fromJson(json['guild_type_activity'] as Map), + killHouse: json['kill_house'] as List?, + stewardKillHouse: json['steward_kill_house'] as List?, + stewards: json['stewards'] as List?, + getPosStatus: json['get_pos_status'] == null + ? null + : PosStatus.fromJson(json['get_pos_status'] as Map), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + userIdForeignKey: json['user_id_foreign_key'], + addressIdForeignKey: json['address_id_foreign_key'], + userBankIdForeignKey: json['user_bank_id_foreign_key'], + walletIdForeignKey: json['wallet_id_foreign_key'], + provincialGovernmentIdKey: json['provincial_government_id_key'], + identityDocuments: json['identity_documents'], + active: json['active'] as bool?, + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + guildsId: json['guilds_id'] as String?, + licenseNumber: json['license_number'] as String?, + guildsName: json['guilds_name'] as String?, + phone: json['phone'] as String?, + typeActivity: json['type_activity'] as String?, + areaActivity: json['area_activity'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + steward: json['steward'] as bool?, + hasPos: json['has_pos'] as bool?, + centersAllocation: json['centers_allocation'], + killHouseCentersAllocation: json['kill_house_centers_allocation'], + allocationLimit: json['allocation_limit'], + limitationAllocation: json['limitation_allocation'] as bool?, + registerarRole: json['registerar_role'] as String?, + registerarFullname: json['registerar_fullname'] as String?, + registerarMobile: json['registerar_mobile'] as String?, + killHouseRegister: json['kill_house_register'] as bool?, + stewardRegister: json['steward_register'] as bool?, + guildsRoomRegister: json['guilds_room_register'] as bool?, + posCompanyRegister: json['pos_company_register'] as bool?, + provinceAcceptState: json['province_accept_state'] as String?, + provinceMessage: json['province_message'] as String?, + condition: json['condition'] as String?, + descriptionCondition: json['description_condition'] as String?, + stewardActive: json['steward_active'] as bool?, + stewardAllocationLimit: json['steward_allocation_limit'], + stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?, + license: json['license'] as bool?, + licenseForm: json['license_form'], + licenseFile: json['license_file'], + reviewerRole: json['reviewer_role'] as String?, + reviewerFullname: json['reviewer_fullname'] as String?, + reviewerMobile: json['reviewer_mobile'] as String?, + checkerMessage: json['checker_message'] as String?, + finalAccept: json['final_accept'] as bool?, + temporaryRegistration: json['temporary_registration'] as bool?, + createdBy: json['created_by'] as String?, + modifiedBy: json['modified_by'] as String?, + userBankInfo: json['user_bank_info'], + wallet: (json['wallet'] as num?)?.toInt(), + cars: json['cars'] as List?, + userLevel: json['user_level'] as List?, +); + +Map _$StewardToJson(_Steward instance) => { + 'id': instance.id, + 'user': instance.user, + 'address': instance.address, + 'guild_area_activity': instance.guildAreaActivity, + 'guild_type_activity': instance.guildTypeActivity, + 'kill_house': instance.killHouse, + 'steward_kill_house': instance.stewardKillHouse, + 'stewards': instance.stewards, + 'get_pos_status': instance.getPosStatus, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'user_id_foreign_key': instance.userIdForeignKey, + 'address_id_foreign_key': instance.addressIdForeignKey, + 'user_bank_id_foreign_key': instance.userBankIdForeignKey, + 'wallet_id_foreign_key': instance.walletIdForeignKey, + 'provincial_government_id_key': instance.provincialGovernmentIdKey, + 'identity_documents': instance.identityDocuments, + 'active': instance.active, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'guilds_id': instance.guildsId, + 'license_number': instance.licenseNumber, + 'guilds_name': instance.guildsName, + 'phone': instance.phone, + 'type_activity': instance.typeActivity, + 'area_activity': instance.areaActivity, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'steward': instance.steward, + 'has_pos': instance.hasPos, + 'centers_allocation': instance.centersAllocation, + 'kill_house_centers_allocation': instance.killHouseCentersAllocation, + 'allocation_limit': instance.allocationLimit, + 'limitation_allocation': instance.limitationAllocation, + 'registerar_role': instance.registerarRole, + 'registerar_fullname': instance.registerarFullname, + 'registerar_mobile': instance.registerarMobile, + 'kill_house_register': instance.killHouseRegister, + 'steward_register': instance.stewardRegister, + 'guilds_room_register': instance.guildsRoomRegister, + 'pos_company_register': instance.posCompanyRegister, + 'province_accept_state': instance.provinceAcceptState, + 'province_message': instance.provinceMessage, + 'condition': instance.condition, + 'description_condition': instance.descriptionCondition, + 'steward_active': instance.stewardActive, + 'steward_allocation_limit': instance.stewardAllocationLimit, + 'steward_limitation_allocation': instance.stewardLimitationAllocation, + 'license': instance.license, + 'license_form': instance.licenseForm, + 'license_file': instance.licenseFile, + 'reviewer_role': instance.reviewerRole, + 'reviewer_fullname': instance.reviewerFullname, + 'reviewer_mobile': instance.reviewerMobile, + 'checker_message': instance.checkerMessage, + 'final_accept': instance.finalAccept, + 'temporary_registration': instance.temporaryRegistration, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'user_bank_info': instance.userBankInfo, + 'wallet': instance.wallet, + 'cars': instance.cars, + 'user_level': instance.userLevel, +}; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + city: json['city'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'city': instance.city, +}; + +_Address _$AddressFromJson(Map json) => _Address( + province: json['province'] == null + ? null + : Province.fromJson(json['province'] as Map), + city: json['city'] == null + ? null + : Province.fromJson(json['city'] as Map), + address: json['address'] as String?, + postalCode: json['postal_code'] as String?, +); + +Map _$AddressToJson(_Address instance) => { + 'province': instance.province, + 'city': instance.city, + 'address': instance.address, + 'postal_code': instance.postalCode, +}; + +_Province _$ProvinceFromJson(Map json) => + _Province(key: json['key'] as String?, name: json['name'] as String?); + +Map _$ProvinceToJson(_Province instance) => { + 'key': instance.key, + 'name': instance.name, +}; + +_Activity _$ActivityFromJson(Map json) => + _Activity(key: json['key'] as String?, title: json['title'] as String?); + +Map _$ActivityToJson(_Activity instance) => { + 'key': instance.key, + 'title': instance.title, +}; + +_PosStatus _$PosStatusFromJson(Map json) => _PosStatus( + lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(), + hasPons: json['has_pons'] as bool?, + hasActivePons: json['has_active_pons'] as bool?, +); + +Map _$PosStatusToJson(_PosStatus instance) => + { + 'len_active_sessions': instance.lenActiveSessions, + 'has_pons': instance.hasPons, + 'has_active_pons': instance.hasActivePons, + }; diff --git a/packages/chicken/lib/data/models/response/auth/auth_response_model.dart b/packages/chicken/lib/data/models/response/auth/auth_response_model.dart new file mode 100644 index 0000000..1f5faba --- /dev/null +++ b/packages/chicken/lib/data/models/response/auth/auth_response_model.dart @@ -0,0 +1,20 @@ + + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'auth_response_model.freezed.dart'; +part 'auth_response_model.g.dart'; + +@freezed +abstract class AuthResponseModel with _$AuthResponseModel { + const factory AuthResponseModel({ + String? refresh, + String? access, + bool? otpStatus, + }) = _AuthResponseModel; + + factory AuthResponseModel.fromJson(Map json) => + _$AuthResponseModelFromJson(json); + +} + diff --git a/packages/chicken/lib/data/models/response/auth/auth_response_model.freezed.dart b/packages/chicken/lib/data/models/response/auth/auth_response_model.freezed.dart new file mode 100644 index 0000000..fdca0fc --- /dev/null +++ b/packages/chicken/lib/data/models/response/auth/auth_response_model.freezed.dart @@ -0,0 +1,283 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'auth_response_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$AuthResponseModel { + + String? get refresh; String? get access; bool? get otpStatus; +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AuthResponseModelCopyWith get copyWith => _$AuthResponseModelCopyWithImpl(this as AuthResponseModel, _$identity); + + /// Serializes this AuthResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthResponseModel&&(identical(other.refresh, refresh) || other.refresh == refresh)&&(identical(other.access, access) || other.access == access)&&(identical(other.otpStatus, otpStatus) || other.otpStatus == otpStatus)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,refresh,access,otpStatus); + +@override +String toString() { + return 'AuthResponseModel(refresh: $refresh, access: $access, otpStatus: $otpStatus)'; +} + + +} + +/// @nodoc +abstract mixin class $AuthResponseModelCopyWith<$Res> { + factory $AuthResponseModelCopyWith(AuthResponseModel value, $Res Function(AuthResponseModel) _then) = _$AuthResponseModelCopyWithImpl; +@useResult +$Res call({ + String? refresh, String? access, bool? otpStatus +}); + + + + +} +/// @nodoc +class _$AuthResponseModelCopyWithImpl<$Res> + implements $AuthResponseModelCopyWith<$Res> { + _$AuthResponseModelCopyWithImpl(this._self, this._then); + + final AuthResponseModel _self; + final $Res Function(AuthResponseModel) _then; + +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? refresh = freezed,Object? access = freezed,Object? otpStatus = freezed,}) { + return _then(_self.copyWith( +refresh: freezed == refresh ? _self.refresh : refresh // ignore: cast_nullable_to_non_nullable +as String?,access: freezed == access ? _self.access : access // ignore: cast_nullable_to_non_nullable +as String?,otpStatus: freezed == otpStatus ? _self.otpStatus : otpStatus // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AuthResponseModel]. +extension AuthResponseModelPatterns on AuthResponseModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AuthResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AuthResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _AuthResponseModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AuthResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? refresh, String? access, bool? otpStatus)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that.refresh,_that.access,_that.otpStatus);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? refresh, String? access, bool? otpStatus) $default,) {final _that = this; +switch (_that) { +case _AuthResponseModel(): +return $default(_that.refresh,_that.access,_that.otpStatus);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? refresh, String? access, bool? otpStatus)? $default,) {final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that.refresh,_that.access,_that.otpStatus);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _AuthResponseModel implements AuthResponseModel { + const _AuthResponseModel({this.refresh, this.access, this.otpStatus}); + factory _AuthResponseModel.fromJson(Map json) => _$AuthResponseModelFromJson(json); + +@override final String? refresh; +@override final String? access; +@override final bool? otpStatus; + +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AuthResponseModelCopyWith<_AuthResponseModel> get copyWith => __$AuthResponseModelCopyWithImpl<_AuthResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$AuthResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthResponseModel&&(identical(other.refresh, refresh) || other.refresh == refresh)&&(identical(other.access, access) || other.access == access)&&(identical(other.otpStatus, otpStatus) || other.otpStatus == otpStatus)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,refresh,access,otpStatus); + +@override +String toString() { + return 'AuthResponseModel(refresh: $refresh, access: $access, otpStatus: $otpStatus)'; +} + + +} + +/// @nodoc +abstract mixin class _$AuthResponseModelCopyWith<$Res> implements $AuthResponseModelCopyWith<$Res> { + factory _$AuthResponseModelCopyWith(_AuthResponseModel value, $Res Function(_AuthResponseModel) _then) = __$AuthResponseModelCopyWithImpl; +@override @useResult +$Res call({ + String? refresh, String? access, bool? otpStatus +}); + + + + +} +/// @nodoc +class __$AuthResponseModelCopyWithImpl<$Res> + implements _$AuthResponseModelCopyWith<$Res> { + __$AuthResponseModelCopyWithImpl(this._self, this._then); + + final _AuthResponseModel _self; + final $Res Function(_AuthResponseModel) _then; + +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? refresh = freezed,Object? access = freezed,Object? otpStatus = freezed,}) { + return _then(_AuthResponseModel( +refresh: freezed == refresh ? _self.refresh : refresh // ignore: cast_nullable_to_non_nullable +as String?,access: freezed == access ? _self.access : access // ignore: cast_nullable_to_non_nullable +as String?,otpStatus: freezed == otpStatus ? _self.otpStatus : otpStatus // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/auth/auth_response_model.g.dart b/packages/chicken/lib/data/models/response/auth/auth_response_model.g.dart new file mode 100644 index 0000000..dc5d66d --- /dev/null +++ b/packages/chicken/lib/data/models/response/auth/auth_response_model.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_response_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_AuthResponseModel _$AuthResponseModelFromJson(Map json) => + _AuthResponseModel( + refresh: json['refresh'] as String?, + access: json['access'] as String?, + otpStatus: json['otp_status'] as bool?, + ); + +Map _$AuthResponseModelToJson(_AuthResponseModel instance) => + { + 'refresh': instance.refresh, + 'access': instance.access, + 'otp_status': instance.otpStatus, + }; diff --git a/packages/chicken/lib/data/models/response/bar_information/bar_information.dart b/packages/chicken/lib/data/models/response/bar_information/bar_information.dart new file mode 100644 index 0000000..ed39c98 --- /dev/null +++ b/packages/chicken/lib/data/models/response/bar_information/bar_information.dart @@ -0,0 +1,25 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'bar_information.freezed.dart'; +part 'bar_information.g.dart'; + +@freezed +abstract class BarInformation with _$BarInformation { + const factory BarInformation({ + int? totalBars, + int? totalBarsQuantity, + double? totalBarsWeight, + int? totalEnteredBars, + int? totalEnteredBarsQuantity, + double? totalEnteredBarsWeight, + int? totalNotEnteredBars, + int? totalNotEnteredBarsQuantity, + double? totalNotEnteredKillHouseRequestsWeight, + int? totalRejectedBars, + int? totalRejectedBarsQuantity, + double? totalRejectedBarsWeight, + }) = _BarInformation; + + factory BarInformation.fromJson(Map json) => + _$BarInformationFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/bar_information/bar_information.freezed.dart b/packages/chicken/lib/data/models/response/bar_information/bar_information.freezed.dart new file mode 100644 index 0000000..0741449 --- /dev/null +++ b/packages/chicken/lib/data/models/response/bar_information/bar_information.freezed.dart @@ -0,0 +1,310 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'bar_information.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$BarInformation { + + int? get totalBars; int? get totalBarsQuantity; double? get totalBarsWeight; int? get totalEnteredBars; int? get totalEnteredBarsQuantity; double? get totalEnteredBarsWeight; int? get totalNotEnteredBars; int? get totalNotEnteredBarsQuantity; double? get totalNotEnteredKillHouseRequestsWeight; int? get totalRejectedBars; int? get totalRejectedBarsQuantity; double? get totalRejectedBarsWeight; +/// Create a copy of BarInformation +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BarInformationCopyWith get copyWith => _$BarInformationCopyWithImpl(this as BarInformation, _$identity); + + /// Serializes this BarInformation to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight); + +@override +String toString() { + return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)'; +} + + +} + +/// @nodoc +abstract mixin class $BarInformationCopyWith<$Res> { + factory $BarInformationCopyWith(BarInformation value, $Res Function(BarInformation) _then) = _$BarInformationCopyWithImpl; +@useResult +$Res call({ + int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight +}); + + + + +} +/// @nodoc +class _$BarInformationCopyWithImpl<$Res> + implements $BarInformationCopyWith<$Res> { + _$BarInformationCopyWithImpl(this._self, this._then); + + final BarInformation _self; + final $Res Function(BarInformation) _then; + +/// Create a copy of BarInformation +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) { + return _then(_self.copyWith( +totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable +as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable +as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable +as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable +as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable +as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable +as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable +as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BarInformation]. +extension BarInformationPatterns on BarInformation { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BarInformation value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BarInformation() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BarInformation value) $default,){ +final _that = this; +switch (_that) { +case _BarInformation(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BarInformation value)? $default,){ +final _that = this; +switch (_that) { +case _BarInformation() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BarInformation() when $default != null: +return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight) $default,) {final _that = this; +switch (_that) { +case _BarInformation(): +return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight)? $default,) {final _that = this; +switch (_that) { +case _BarInformation() when $default != null: +return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _BarInformation implements BarInformation { + const _BarInformation({this.totalBars, this.totalBarsQuantity, this.totalBarsWeight, this.totalEnteredBars, this.totalEnteredBarsQuantity, this.totalEnteredBarsWeight, this.totalNotEnteredBars, this.totalNotEnteredBarsQuantity, this.totalNotEnteredKillHouseRequestsWeight, this.totalRejectedBars, this.totalRejectedBarsQuantity, this.totalRejectedBarsWeight}); + factory _BarInformation.fromJson(Map json) => _$BarInformationFromJson(json); + +@override final int? totalBars; +@override final int? totalBarsQuantity; +@override final double? totalBarsWeight; +@override final int? totalEnteredBars; +@override final int? totalEnteredBarsQuantity; +@override final double? totalEnteredBarsWeight; +@override final int? totalNotEnteredBars; +@override final int? totalNotEnteredBarsQuantity; +@override final double? totalNotEnteredKillHouseRequestsWeight; +@override final int? totalRejectedBars; +@override final int? totalRejectedBarsQuantity; +@override final double? totalRejectedBarsWeight; + +/// Create a copy of BarInformation +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BarInformationCopyWith<_BarInformation> get copyWith => __$BarInformationCopyWithImpl<_BarInformation>(this, _$identity); + +@override +Map toJson() { + return _$BarInformationToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight); + +@override +String toString() { + return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)'; +} + + +} + +/// @nodoc +abstract mixin class _$BarInformationCopyWith<$Res> implements $BarInformationCopyWith<$Res> { + factory _$BarInformationCopyWith(_BarInformation value, $Res Function(_BarInformation) _then) = __$BarInformationCopyWithImpl; +@override @useResult +$Res call({ + int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight +}); + + + + +} +/// @nodoc +class __$BarInformationCopyWithImpl<$Res> + implements _$BarInformationCopyWith<$Res> { + __$BarInformationCopyWithImpl(this._self, this._then); + + final _BarInformation _self; + final $Res Function(_BarInformation) _then; + +/// Create a copy of BarInformation +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) { + return _then(_BarInformation( +totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable +as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable +as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable +as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable +as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable +as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable +as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable +as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/bar_information/bar_information.g.dart b/packages/chicken/lib/data/models/response/bar_information/bar_information.g.dart new file mode 100644 index 0000000..51c1221 --- /dev/null +++ b/packages/chicken/lib/data/models/response/bar_information/bar_information.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'bar_information.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_BarInformation _$BarInformationFromJson(Map json) => + _BarInformation( + totalBars: (json['total_bars'] as num?)?.toInt(), + totalBarsQuantity: (json['total_bars_quantity'] as num?)?.toInt(), + totalBarsWeight: (json['total_bars_weight'] as num?)?.toDouble(), + totalEnteredBars: (json['total_entered_bars'] as num?)?.toInt(), + totalEnteredBarsQuantity: (json['total_entered_bars_quantity'] as num?) + ?.toInt(), + totalEnteredBarsWeight: (json['total_entered_bars_weight'] as num?) + ?.toDouble(), + totalNotEnteredBars: (json['total_not_entered_bars'] as num?)?.toInt(), + totalNotEnteredBarsQuantity: + (json['total_not_entered_bars_quantity'] as num?)?.toInt(), + totalNotEnteredKillHouseRequestsWeight: + (json['total_not_entered_kill_house_requests_weight'] as num?) + ?.toDouble(), + totalRejectedBars: (json['total_rejected_bars'] as num?)?.toInt(), + totalRejectedBarsQuantity: (json['total_rejected_bars_quantity'] as num?) + ?.toInt(), + totalRejectedBarsWeight: (json['total_rejected_bars_weight'] as num?) + ?.toDouble(), + ); + +Map _$BarInformationToJson(_BarInformation instance) => + { + 'total_bars': instance.totalBars, + 'total_bars_quantity': instance.totalBarsQuantity, + 'total_bars_weight': instance.totalBarsWeight, + 'total_entered_bars': instance.totalEnteredBars, + 'total_entered_bars_quantity': instance.totalEnteredBarsQuantity, + 'total_entered_bars_weight': instance.totalEnteredBarsWeight, + 'total_not_entered_bars': instance.totalNotEnteredBars, + 'total_not_entered_bars_quantity': instance.totalNotEnteredBarsQuantity, + 'total_not_entered_kill_house_requests_weight': + instance.totalNotEnteredKillHouseRequestsWeight, + 'total_rejected_bars': instance.totalRejectedBars, + 'total_rejected_bars_quantity': instance.totalRejectedBarsQuantity, + 'total_rejected_bars_weight': instance.totalRejectedBarsWeight, + }; diff --git a/packages/chicken/lib/data/models/response/captcha/captcha_response_model.dart b/packages/chicken/lib/data/models/response/captcha/captcha_response_model.dart new file mode 100644 index 0000000..2b2f986 --- /dev/null +++ b/packages/chicken/lib/data/models/response/captcha/captcha_response_model.dart @@ -0,0 +1,17 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'captcha_response_model.freezed.dart'; +part 'captcha_response_model.g.dart'; + +@freezed +abstract class CaptchaResponseModel with _$CaptchaResponseModel { + const factory CaptchaResponseModel({ + String? captchaKey, + String? captchaImage, + String? imageType, + String? imageDecode, + }) = _CaptchaResponseModel; + + factory CaptchaResponseModel.fromJson(Map json) => + _$CaptchaResponseModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/captcha/captcha_response_model.freezed.dart b/packages/chicken/lib/data/models/response/captcha/captcha_response_model.freezed.dart new file mode 100644 index 0000000..33d0167 --- /dev/null +++ b/packages/chicken/lib/data/models/response/captcha/captcha_response_model.freezed.dart @@ -0,0 +1,286 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'captcha_response_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$CaptchaResponseModel { + + String? get captchaKey; String? get captchaImage; String? get imageType; String? get imageDecode; +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CaptchaResponseModelCopyWith get copyWith => _$CaptchaResponseModelCopyWithImpl(this as CaptchaResponseModel, _$identity); + + /// Serializes this CaptchaResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CaptchaResponseModel&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)&&(identical(other.captchaImage, captchaImage) || other.captchaImage == captchaImage)&&(identical(other.imageType, imageType) || other.imageType == imageType)&&(identical(other.imageDecode, imageDecode) || other.imageDecode == imageDecode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,captchaKey,captchaImage,imageType,imageDecode); + +@override +String toString() { + return 'CaptchaResponseModel(captchaKey: $captchaKey, captchaImage: $captchaImage, imageType: $imageType, imageDecode: $imageDecode)'; +} + + +} + +/// @nodoc +abstract mixin class $CaptchaResponseModelCopyWith<$Res> { + factory $CaptchaResponseModelCopyWith(CaptchaResponseModel value, $Res Function(CaptchaResponseModel) _then) = _$CaptchaResponseModelCopyWithImpl; +@useResult +$Res call({ + String? captchaKey, String? captchaImage, String? imageType, String? imageDecode +}); + + + + +} +/// @nodoc +class _$CaptchaResponseModelCopyWithImpl<$Res> + implements $CaptchaResponseModelCopyWith<$Res> { + _$CaptchaResponseModelCopyWithImpl(this._self, this._then); + + final CaptchaResponseModel _self; + final $Res Function(CaptchaResponseModel) _then; + +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? captchaKey = freezed,Object? captchaImage = freezed,Object? imageType = freezed,Object? imageDecode = freezed,}) { + return _then(_self.copyWith( +captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?,captchaImage: freezed == captchaImage ? _self.captchaImage : captchaImage // ignore: cast_nullable_to_non_nullable +as String?,imageType: freezed == imageType ? _self.imageType : imageType // ignore: cast_nullable_to_non_nullable +as String?,imageDecode: freezed == imageDecode ? _self.imageDecode : imageDecode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CaptchaResponseModel]. +extension CaptchaResponseModelPatterns on CaptchaResponseModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CaptchaResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CaptchaResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _CaptchaResponseModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CaptchaResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode) $default,) {final _that = this; +switch (_that) { +case _CaptchaResponseModel(): +return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode)? $default,) {final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CaptchaResponseModel implements CaptchaResponseModel { + const _CaptchaResponseModel({this.captchaKey, this.captchaImage, this.imageType, this.imageDecode}); + factory _CaptchaResponseModel.fromJson(Map json) => _$CaptchaResponseModelFromJson(json); + +@override final String? captchaKey; +@override final String? captchaImage; +@override final String? imageType; +@override final String? imageDecode; + +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CaptchaResponseModelCopyWith<_CaptchaResponseModel> get copyWith => __$CaptchaResponseModelCopyWithImpl<_CaptchaResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$CaptchaResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CaptchaResponseModel&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)&&(identical(other.captchaImage, captchaImage) || other.captchaImage == captchaImage)&&(identical(other.imageType, imageType) || other.imageType == imageType)&&(identical(other.imageDecode, imageDecode) || other.imageDecode == imageDecode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,captchaKey,captchaImage,imageType,imageDecode); + +@override +String toString() { + return 'CaptchaResponseModel(captchaKey: $captchaKey, captchaImage: $captchaImage, imageType: $imageType, imageDecode: $imageDecode)'; +} + + +} + +/// @nodoc +abstract mixin class _$CaptchaResponseModelCopyWith<$Res> implements $CaptchaResponseModelCopyWith<$Res> { + factory _$CaptchaResponseModelCopyWith(_CaptchaResponseModel value, $Res Function(_CaptchaResponseModel) _then) = __$CaptchaResponseModelCopyWithImpl; +@override @useResult +$Res call({ + String? captchaKey, String? captchaImage, String? imageType, String? imageDecode +}); + + + + +} +/// @nodoc +class __$CaptchaResponseModelCopyWithImpl<$Res> + implements _$CaptchaResponseModelCopyWith<$Res> { + __$CaptchaResponseModelCopyWithImpl(this._self, this._then); + + final _CaptchaResponseModel _self; + final $Res Function(_CaptchaResponseModel) _then; + +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? captchaKey = freezed,Object? captchaImage = freezed,Object? imageType = freezed,Object? imageDecode = freezed,}) { + return _then(_CaptchaResponseModel( +captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?,captchaImage: freezed == captchaImage ? _self.captchaImage : captchaImage // ignore: cast_nullable_to_non_nullable +as String?,imageType: freezed == imageType ? _self.imageType : imageType // ignore: cast_nullable_to_non_nullable +as String?,imageDecode: freezed == imageDecode ? _self.imageDecode : imageDecode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/captcha/captcha_response_model.g.dart b/packages/chicken/lib/data/models/response/captcha/captcha_response_model.g.dart new file mode 100644 index 0000000..8d69248 --- /dev/null +++ b/packages/chicken/lib/data/models/response/captcha/captcha_response_model.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'captcha_response_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_CaptchaResponseModel _$CaptchaResponseModelFromJson( + Map json, +) => _CaptchaResponseModel( + captchaKey: json['captcha_key'] as String?, + captchaImage: json['captcha_image'] as String?, + imageType: json['image_type'] as String?, + imageDecode: json['image_decode'] as String?, +); + +Map _$CaptchaResponseModelToJson( + _CaptchaResponseModel instance, +) => { + 'captcha_key': instance.captchaKey, + 'captcha_image': instance.captchaImage, + 'image_type': instance.imageType, + 'image_decode': instance.imageDecode, +}; diff --git a/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart b/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart new file mode 100644 index 0000000..3f48858 --- /dev/null +++ b/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'dashboard_kill_house_free_bar.freezed.dart'; +part 'dashboard_kill_house_free_bar.g.dart'; + +@freezed +abstract class DashboardKillHouseFreeBar with _$DashboardKillHouseFreeBar { + const factory DashboardKillHouseFreeBar({ + int? totalBars, + int? totalBarsQuantity, + int? totalBarsLiveWeight, + int? totalBarsNumberOfCarcasses, + int? totalBarsWeightOfCarcasses, + }) = _DashboardKillHouseFreeBar; + + factory DashboardKillHouseFreeBar.fromJson(Map json) => + _$DashboardKillHouseFreeBarFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.freezed.dart b/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.freezed.dart new file mode 100644 index 0000000..e86892c --- /dev/null +++ b/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.freezed.dart @@ -0,0 +1,289 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'dashboard_kill_house_free_bar.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$DashboardKillHouseFreeBar { + + int? get totalBars; int? get totalBarsQuantity; int? get totalBarsLiveWeight; int? get totalBarsNumberOfCarcasses; int? get totalBarsWeightOfCarcasses; +/// Create a copy of DashboardKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DashboardKillHouseFreeBarCopyWith get copyWith => _$DashboardKillHouseFreeBarCopyWithImpl(this as DashboardKillHouseFreeBar, _$identity); + + /// Serializes this DashboardKillHouseFreeBar to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DashboardKillHouseFreeBar&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsLiveWeight, totalBarsLiveWeight) || other.totalBarsLiveWeight == totalBarsLiveWeight)&&(identical(other.totalBarsNumberOfCarcasses, totalBarsNumberOfCarcasses) || other.totalBarsNumberOfCarcasses == totalBarsNumberOfCarcasses)&&(identical(other.totalBarsWeightOfCarcasses, totalBarsWeightOfCarcasses) || other.totalBarsWeightOfCarcasses == totalBarsWeightOfCarcasses)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsLiveWeight,totalBarsNumberOfCarcasses,totalBarsWeightOfCarcasses); + +@override +String toString() { + return 'DashboardKillHouseFreeBar(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsLiveWeight: $totalBarsLiveWeight, totalBarsNumberOfCarcasses: $totalBarsNumberOfCarcasses, totalBarsWeightOfCarcasses: $totalBarsWeightOfCarcasses)'; +} + + +} + +/// @nodoc +abstract mixin class $DashboardKillHouseFreeBarCopyWith<$Res> { + factory $DashboardKillHouseFreeBarCopyWith(DashboardKillHouseFreeBar value, $Res Function(DashboardKillHouseFreeBar) _then) = _$DashboardKillHouseFreeBarCopyWithImpl; +@useResult +$Res call({ + int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses +}); + + + + +} +/// @nodoc +class _$DashboardKillHouseFreeBarCopyWithImpl<$Res> + implements $DashboardKillHouseFreeBarCopyWith<$Res> { + _$DashboardKillHouseFreeBarCopyWithImpl(this._self, this._then); + + final DashboardKillHouseFreeBar _self; + final $Res Function(DashboardKillHouseFreeBar) _then; + +/// Create a copy of DashboardKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsLiveWeight = freezed,Object? totalBarsNumberOfCarcasses = freezed,Object? totalBarsWeightOfCarcasses = freezed,}) { + return _then(_self.copyWith( +totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable +as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalBarsLiveWeight: freezed == totalBarsLiveWeight ? _self.totalBarsLiveWeight : totalBarsLiveWeight // ignore: cast_nullable_to_non_nullable +as int?,totalBarsNumberOfCarcasses: freezed == totalBarsNumberOfCarcasses ? _self.totalBarsNumberOfCarcasses : totalBarsNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,totalBarsWeightOfCarcasses: freezed == totalBarsWeightOfCarcasses ? _self.totalBarsWeightOfCarcasses : totalBarsWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DashboardKillHouseFreeBar]. +extension DashboardKillHouseFreeBarPatterns on DashboardKillHouseFreeBar { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _DashboardKillHouseFreeBar value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DashboardKillHouseFreeBar() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _DashboardKillHouseFreeBar value) $default,){ +final _that = this; +switch (_that) { +case _DashboardKillHouseFreeBar(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _DashboardKillHouseFreeBar value)? $default,){ +final _that = this; +switch (_that) { +case _DashboardKillHouseFreeBar() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DashboardKillHouseFreeBar() when $default != null: +return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsLiveWeight,_that.totalBarsNumberOfCarcasses,_that.totalBarsWeightOfCarcasses);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses) $default,) {final _that = this; +switch (_that) { +case _DashboardKillHouseFreeBar(): +return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsLiveWeight,_that.totalBarsNumberOfCarcasses,_that.totalBarsWeightOfCarcasses);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses)? $default,) {final _that = this; +switch (_that) { +case _DashboardKillHouseFreeBar() when $default != null: +return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsLiveWeight,_that.totalBarsNumberOfCarcasses,_that.totalBarsWeightOfCarcasses);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _DashboardKillHouseFreeBar implements DashboardKillHouseFreeBar { + const _DashboardKillHouseFreeBar({this.totalBars, this.totalBarsQuantity, this.totalBarsLiveWeight, this.totalBarsNumberOfCarcasses, this.totalBarsWeightOfCarcasses}); + factory _DashboardKillHouseFreeBar.fromJson(Map json) => _$DashboardKillHouseFreeBarFromJson(json); + +@override final int? totalBars; +@override final int? totalBarsQuantity; +@override final int? totalBarsLiveWeight; +@override final int? totalBarsNumberOfCarcasses; +@override final int? totalBarsWeightOfCarcasses; + +/// Create a copy of DashboardKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DashboardKillHouseFreeBarCopyWith<_DashboardKillHouseFreeBar> get copyWith => __$DashboardKillHouseFreeBarCopyWithImpl<_DashboardKillHouseFreeBar>(this, _$identity); + +@override +Map toJson() { + return _$DashboardKillHouseFreeBarToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DashboardKillHouseFreeBar&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsLiveWeight, totalBarsLiveWeight) || other.totalBarsLiveWeight == totalBarsLiveWeight)&&(identical(other.totalBarsNumberOfCarcasses, totalBarsNumberOfCarcasses) || other.totalBarsNumberOfCarcasses == totalBarsNumberOfCarcasses)&&(identical(other.totalBarsWeightOfCarcasses, totalBarsWeightOfCarcasses) || other.totalBarsWeightOfCarcasses == totalBarsWeightOfCarcasses)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsLiveWeight,totalBarsNumberOfCarcasses,totalBarsWeightOfCarcasses); + +@override +String toString() { + return 'DashboardKillHouseFreeBar(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsLiveWeight: $totalBarsLiveWeight, totalBarsNumberOfCarcasses: $totalBarsNumberOfCarcasses, totalBarsWeightOfCarcasses: $totalBarsWeightOfCarcasses)'; +} + + +} + +/// @nodoc +abstract mixin class _$DashboardKillHouseFreeBarCopyWith<$Res> implements $DashboardKillHouseFreeBarCopyWith<$Res> { + factory _$DashboardKillHouseFreeBarCopyWith(_DashboardKillHouseFreeBar value, $Res Function(_DashboardKillHouseFreeBar) _then) = __$DashboardKillHouseFreeBarCopyWithImpl; +@override @useResult +$Res call({ + int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses +}); + + + + +} +/// @nodoc +class __$DashboardKillHouseFreeBarCopyWithImpl<$Res> + implements _$DashboardKillHouseFreeBarCopyWith<$Res> { + __$DashboardKillHouseFreeBarCopyWithImpl(this._self, this._then); + + final _DashboardKillHouseFreeBar _self; + final $Res Function(_DashboardKillHouseFreeBar) _then; + +/// Create a copy of DashboardKillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsLiveWeight = freezed,Object? totalBarsNumberOfCarcasses = freezed,Object? totalBarsWeightOfCarcasses = freezed,}) { + return _then(_DashboardKillHouseFreeBar( +totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable +as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalBarsLiveWeight: freezed == totalBarsLiveWeight ? _self.totalBarsLiveWeight : totalBarsLiveWeight // ignore: cast_nullable_to_non_nullable +as int?,totalBarsNumberOfCarcasses: freezed == totalBarsNumberOfCarcasses ? _self.totalBarsNumberOfCarcasses : totalBarsNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,totalBarsWeightOfCarcasses: freezed == totalBarsWeightOfCarcasses ? _self.totalBarsWeightOfCarcasses : totalBarsWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.g.dart b/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.g.dart new file mode 100644 index 0000000..175c035 --- /dev/null +++ b/packages/chicken/lib/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'dashboard_kill_house_free_bar.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_DashboardKillHouseFreeBar _$DashboardKillHouseFreeBarFromJson( + Map json, +) => _DashboardKillHouseFreeBar( + totalBars: (json['total_bars'] as num?)?.toInt(), + totalBarsQuantity: (json['total_bars_quantity'] as num?)?.toInt(), + totalBarsLiveWeight: (json['total_bars_live_weight'] as num?)?.toInt(), + totalBarsNumberOfCarcasses: (json['total_bars_number_of_carcasses'] as num?) + ?.toInt(), + totalBarsWeightOfCarcasses: (json['total_bars_weight_of_carcasses'] as num?) + ?.toInt(), +); + +Map _$DashboardKillHouseFreeBarToJson( + _DashboardKillHouseFreeBar instance, +) => { + 'total_bars': instance.totalBars, + 'total_bars_quantity': instance.totalBarsQuantity, + 'total_bars_live_weight': instance.totalBarsLiveWeight, + 'total_bars_number_of_carcasses': instance.totalBarsNumberOfCarcasses, + 'total_bars_weight_of_carcasses': instance.totalBarsWeightOfCarcasses, +}; diff --git a/packages/chicken/lib/data/models/response/guild/guild_model.dart b/packages/chicken/lib/data/models/response/guild/guild_model.dart new file mode 100644 index 0000000..22beee1 --- /dev/null +++ b/packages/chicken/lib/data/models/response/guild/guild_model.dart @@ -0,0 +1,28 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'guild_model.freezed.dart'; +part 'guild_model.g.dart'; + +@freezed +abstract class GuildModel with _$GuildModel { + const factory GuildModel({ + String? key, + String? guildsName, + bool? steward, + User? user, + }) = _GuildModel; + + factory GuildModel.fromJson(Map json) => + _$GuildModelFromJson(json); +} + +@freezed +abstract class User with _$User { + const factory User({ + String? fullname, + String? mobile, + String? city, + }) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/guild/guild_model.freezed.dart b/packages/chicken/lib/data/models/response/guild/guild_model.freezed.dart new file mode 100644 index 0000000..fae500a --- /dev/null +++ b/packages/chicken/lib/data/models/response/guild/guild_model.freezed.dart @@ -0,0 +1,579 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'guild_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$GuildModel { + + String? get key; String? get guildsName; bool? get steward; User? get user; +/// Create a copy of GuildModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GuildModelCopyWith get copyWith => _$GuildModelCopyWithImpl(this as GuildModel, _$identity); + + /// Serializes this GuildModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user); + +@override +String toString() { + return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class $GuildModelCopyWith<$Res> { + factory $GuildModelCopyWith(GuildModel value, $Res Function(GuildModel) _then) = _$GuildModelCopyWithImpl; +@useResult +$Res call({ + String? key, String? guildsName, bool? steward, User? user +}); + + +$UserCopyWith<$Res>? get user; + +} +/// @nodoc +class _$GuildModelCopyWithImpl<$Res> + implements $GuildModelCopyWith<$Res> { + _$GuildModelCopyWithImpl(this._self, this._then); + + final GuildModel _self; + final $Res Function(GuildModel) _then; + +/// Create a copy of GuildModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?, + )); +} +/// Create a copy of GuildModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [GuildModel]. +extension GuildModelPatterns on GuildModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GuildModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GuildModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GuildModel value) $default,){ +final _that = this; +switch (_that) { +case _GuildModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GuildModel value)? $default,){ +final _that = this; +switch (_that) { +case _GuildModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? guildsName, bool? steward, User? user)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GuildModel() when $default != null: +return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? guildsName, bool? steward, User? user) $default,) {final _that = this; +switch (_that) { +case _GuildModel(): +return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? guildsName, bool? steward, User? user)? $default,) {final _that = this; +switch (_that) { +case _GuildModel() when $default != null: +return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GuildModel implements GuildModel { + const _GuildModel({this.key, this.guildsName, this.steward, this.user}); + factory _GuildModel.fromJson(Map json) => _$GuildModelFromJson(json); + +@override final String? key; +@override final String? guildsName; +@override final bool? steward; +@override final User? user; + +/// Create a copy of GuildModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GuildModelCopyWith<_GuildModel> get copyWith => __$GuildModelCopyWithImpl<_GuildModel>(this, _$identity); + +@override +Map toJson() { + return _$GuildModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user); + +@override +String toString() { + return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class _$GuildModelCopyWith<$Res> implements $GuildModelCopyWith<$Res> { + factory _$GuildModelCopyWith(_GuildModel value, $Res Function(_GuildModel) _then) = __$GuildModelCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? guildsName, bool? steward, User? user +}); + + +@override $UserCopyWith<$Res>? get user; + +} +/// @nodoc +class __$GuildModelCopyWithImpl<$Res> + implements _$GuildModelCopyWith<$Res> { + __$GuildModelCopyWithImpl(this._self, this._then); + + final _GuildModel _self; + final $Res Function(_GuildModel) _then; + +/// Create a copy of GuildModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) { + return _then(_GuildModel( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?, + )); +} + +/// Create a copy of GuildModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get mobile; String? get city; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,mobile,city); + +@override +String toString() { + return 'User(fullname: $fullname, mobile: $mobile, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? mobile, String? city +}); + + + + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? mobile, String? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.mobile,_that.city);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? mobile, String? city) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.mobile,_that.city);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? mobile, String? city)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.mobile,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({this.fullname, this.mobile, this.city}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? mobile; +@override final String? city; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,mobile,city); + +@override +String toString() { + return 'User(fullname: $fullname, mobile: $mobile, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? mobile, String? city +}); + + + + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/guild/guild_model.g.dart b/packages/chicken/lib/data/models/response/guild/guild_model.g.dart new file mode 100644 index 0000000..4b82c26 --- /dev/null +++ b/packages/chicken/lib/data/models/response/guild/guild_model.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'guild_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_GuildModel _$GuildModelFromJson(Map json) => _GuildModel( + key: json['key'] as String?, + guildsName: json['guilds_name'] as String?, + steward: json['steward'] as bool?, + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), +); + +Map _$GuildModelToJson(_GuildModel instance) => + { + 'key': instance.key, + 'guilds_name': instance.guildsName, + 'steward': instance.steward, + 'user': instance.user, + }; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + mobile: json['mobile'] as String?, + city: json['city'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'mobile': instance.mobile, + 'city': instance.city, +}; diff --git a/packages/chicken/lib/data/models/response/guild_profile/guild_profile.dart b/packages/chicken/lib/data/models/response/guild_profile/guild_profile.dart new file mode 100644 index 0000000..4572332 --- /dev/null +++ b/packages/chicken/lib/data/models/response/guild_profile/guild_profile.dart @@ -0,0 +1,160 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'guild_profile.freezed.dart'; +part 'guild_profile.g.dart'; + +@freezed +abstract class GuildProfile with _$GuildProfile { + const factory GuildProfile({ + int? id, + User? user, + Address? address, + GuildAreaActivity? guild_area_activity, + GuildTypeActivity? guild_type_activity, + List? kill_house, + List? steward_kill_house, + List? stewards, + GetPosStatus? get_pos_status, + String? key, + String? create_date, + String? modify_date, + bool? trash, + String? user_id_foreign_key, + String? address_id_foreign_key, + String? user_bank_id_foreign_key, + String? wallet_id_foreign_key, + String? provincial_government_id_key, + dynamic identity_documents, + bool? active, + int? city_number, + String? city_name, + String? guilds_id, + String? license_number, + String? guilds_name, + String? phone, + String? type_activity, + String? area_activity, + int? province_number, + String? province_name, + bool? steward, + bool? has_pos, + dynamic centers_allocation, + dynamic kill_house_centers_allocation, + dynamic allocation_limit, + bool? limitation_allocation, + String? registerar_role, + String? registerar_fullname, + String? registerar_mobile, + bool? kill_house_register, + bool? steward_register, + bool? guilds_room_register, + bool? pos_company_register, + String? province_accept_state, + String? province_message, + String? condition, + String? description_condition, + bool? steward_active, + dynamic steward_allocation_limit, + bool? steward_limitation_allocation, + bool? license, + dynamic license_form, + dynamic license_file, + String? reviewer_role, + String? reviewer_fullname, + String? reviewer_mobile, + String? checker_message, + bool? final_accept, + bool? temporary_registration, + String? created_by, + String? modified_by, + dynamic user_bank_info, + int? wallet, + List? cars, + List? user_level, + }) = _GuildProfile; + + factory GuildProfile.fromJson(Map json) => + _$GuildProfileFromJson(json); +} + +@freezed +abstract class User with _$User { + const factory User({ + String? fullname, + String? first_name, + String? last_name, + String? mobile, + String? national_id, + String? city, + }) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} + +@freezed +abstract class Address with _$Address { + const factory Address({ + Province? province, + City? city, + String? address, + String? postal_code, + }) = _Address; + + factory Address.fromJson(Map json) => + _$AddressFromJson(json); +} + +@freezed +abstract class Province with _$Province { + const factory Province({ + String? key, + String? name, + }) = _Province; + + factory Province.fromJson(Map json) => + _$ProvinceFromJson(json); +} + +@freezed +abstract class City with _$City { + const factory City({ + String? key, + String? name, + }) = _City; + + factory City.fromJson(Map json) => _$CityFromJson(json); +} + +@freezed +abstract class GuildAreaActivity with _$GuildAreaActivity { + const factory GuildAreaActivity({ + String? key, + String? title, + }) = _GuildAreaActivity; + + factory GuildAreaActivity.fromJson(Map json) => + _$GuildAreaActivityFromJson(json); +} + +@freezed +abstract class GuildTypeActivity with _$GuildTypeActivity { + const factory GuildTypeActivity({ + String? key, + String? title, + }) = _GuildTypeActivity; + + factory GuildTypeActivity.fromJson(Map json) => + _$GuildTypeActivityFromJson(json); +} + +@freezed +abstract class GetPosStatus with _$GetPosStatus { + const factory GetPosStatus({ + int? len_active_sessions, + bool? has_pons, + bool? has_active_pons, + }) = _GetPosStatus; + + factory GetPosStatus.fromJson(Map json) => + _$GetPosStatusFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/guild_profile/guild_profile.freezed.dart b/packages/chicken/lib/data/models/response/guild_profile/guild_profile.freezed.dart new file mode 100644 index 0000000..70b427c --- /dev/null +++ b/packages/chicken/lib/data/models/response/guild_profile/guild_profile.freezed.dart @@ -0,0 +1,2560 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'guild_profile.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$GuildProfile { + + int? get id; User? get user; Address? get address; GuildAreaActivity? get guild_area_activity; GuildTypeActivity? get guild_type_activity; List? get kill_house; List? get steward_kill_house; List? get stewards; GetPosStatus? get get_pos_status; String? get key; String? get create_date; String? get modify_date; bool? get trash; String? get user_id_foreign_key; String? get address_id_foreign_key; String? get user_bank_id_foreign_key; String? get wallet_id_foreign_key; String? get provincial_government_id_key; dynamic get identity_documents; bool? get active; int? get city_number; String? get city_name; String? get guilds_id; String? get license_number; String? get guilds_name; String? get phone; String? get type_activity; String? get area_activity; int? get province_number; String? get province_name; bool? get steward; bool? get has_pos; dynamic get centers_allocation; dynamic get kill_house_centers_allocation; dynamic get allocation_limit; bool? get limitation_allocation; String? get registerar_role; String? get registerar_fullname; String? get registerar_mobile; bool? get kill_house_register; bool? get steward_register; bool? get guilds_room_register; bool? get pos_company_register; String? get province_accept_state; String? get province_message; String? get condition; String? get description_condition; bool? get steward_active; dynamic get steward_allocation_limit; bool? get steward_limitation_allocation; bool? get license; dynamic get license_form; dynamic get license_file; String? get reviewer_role; String? get reviewer_fullname; String? get reviewer_mobile; String? get checker_message; bool? get final_accept; bool? get temporary_registration; String? get created_by; String? get modified_by; dynamic get user_bank_info; int? get wallet; List? get cars; List? get user_level; +/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GuildProfileCopyWith get copyWith => _$GuildProfileCopyWithImpl(this as GuildProfile, _$identity); + + /// Serializes this GuildProfile to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildProfile&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&(identical(other.guild_area_activity, guild_area_activity) || other.guild_area_activity == guild_area_activity)&&(identical(other.guild_type_activity, guild_type_activity) || other.guild_type_activity == guild_type_activity)&&const DeepCollectionEquality().equals(other.kill_house, kill_house)&&const DeepCollectionEquality().equals(other.steward_kill_house, steward_kill_house)&&const DeepCollectionEquality().equals(other.stewards, stewards)&&(identical(other.get_pos_status, get_pos_status) || other.get_pos_status == get_pos_status)&&(identical(other.key, key) || other.key == key)&&(identical(other.create_date, create_date) || other.create_date == create_date)&&(identical(other.modify_date, modify_date) || other.modify_date == modify_date)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.user_id_foreign_key, user_id_foreign_key) || other.user_id_foreign_key == user_id_foreign_key)&&(identical(other.address_id_foreign_key, address_id_foreign_key) || other.address_id_foreign_key == address_id_foreign_key)&&(identical(other.user_bank_id_foreign_key, user_bank_id_foreign_key) || other.user_bank_id_foreign_key == user_bank_id_foreign_key)&&(identical(other.wallet_id_foreign_key, wallet_id_foreign_key) || other.wallet_id_foreign_key == wallet_id_foreign_key)&&(identical(other.provincial_government_id_key, provincial_government_id_key) || other.provincial_government_id_key == provincial_government_id_key)&&const DeepCollectionEquality().equals(other.identity_documents, identity_documents)&&(identical(other.active, active) || other.active == active)&&(identical(other.city_number, city_number) || other.city_number == city_number)&&(identical(other.city_name, city_name) || other.city_name == city_name)&&(identical(other.guilds_id, guilds_id) || other.guilds_id == guilds_id)&&(identical(other.license_number, license_number) || other.license_number == license_number)&&(identical(other.guilds_name, guilds_name) || other.guilds_name == guilds_name)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.type_activity, type_activity) || other.type_activity == type_activity)&&(identical(other.area_activity, area_activity) || other.area_activity == area_activity)&&(identical(other.province_number, province_number) || other.province_number == province_number)&&(identical(other.province_name, province_name) || other.province_name == province_name)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.has_pos, has_pos) || other.has_pos == has_pos)&&const DeepCollectionEquality().equals(other.centers_allocation, centers_allocation)&&const DeepCollectionEquality().equals(other.kill_house_centers_allocation, kill_house_centers_allocation)&&const DeepCollectionEquality().equals(other.allocation_limit, allocation_limit)&&(identical(other.limitation_allocation, limitation_allocation) || other.limitation_allocation == limitation_allocation)&&(identical(other.registerar_role, registerar_role) || other.registerar_role == registerar_role)&&(identical(other.registerar_fullname, registerar_fullname) || other.registerar_fullname == registerar_fullname)&&(identical(other.registerar_mobile, registerar_mobile) || other.registerar_mobile == registerar_mobile)&&(identical(other.kill_house_register, kill_house_register) || other.kill_house_register == kill_house_register)&&(identical(other.steward_register, steward_register) || other.steward_register == steward_register)&&(identical(other.guilds_room_register, guilds_room_register) || other.guilds_room_register == guilds_room_register)&&(identical(other.pos_company_register, pos_company_register) || other.pos_company_register == pos_company_register)&&(identical(other.province_accept_state, province_accept_state) || other.province_accept_state == province_accept_state)&&(identical(other.province_message, province_message) || other.province_message == province_message)&&(identical(other.condition, condition) || other.condition == condition)&&(identical(other.description_condition, description_condition) || other.description_condition == description_condition)&&(identical(other.steward_active, steward_active) || other.steward_active == steward_active)&&const DeepCollectionEquality().equals(other.steward_allocation_limit, steward_allocation_limit)&&(identical(other.steward_limitation_allocation, steward_limitation_allocation) || other.steward_limitation_allocation == steward_limitation_allocation)&&(identical(other.license, license) || other.license == license)&&const DeepCollectionEquality().equals(other.license_form, license_form)&&const DeepCollectionEquality().equals(other.license_file, license_file)&&(identical(other.reviewer_role, reviewer_role) || other.reviewer_role == reviewer_role)&&(identical(other.reviewer_fullname, reviewer_fullname) || other.reviewer_fullname == reviewer_fullname)&&(identical(other.reviewer_mobile, reviewer_mobile) || other.reviewer_mobile == reviewer_mobile)&&(identical(other.checker_message, checker_message) || other.checker_message == checker_message)&&(identical(other.final_accept, final_accept) || other.final_accept == final_accept)&&(identical(other.temporary_registration, temporary_registration) || other.temporary_registration == temporary_registration)&&(identical(other.created_by, created_by) || other.created_by == created_by)&&(identical(other.modified_by, modified_by) || other.modified_by == modified_by)&&const DeepCollectionEquality().equals(other.user_bank_info, user_bank_info)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other.cars, cars)&&const DeepCollectionEquality().equals(other.user_level, user_level)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,guild_area_activity,guild_type_activity,const DeepCollectionEquality().hash(kill_house),const DeepCollectionEquality().hash(steward_kill_house),const DeepCollectionEquality().hash(stewards),get_pos_status,key,create_date,modify_date,trash,user_id_foreign_key,address_id_foreign_key,user_bank_id_foreign_key,wallet_id_foreign_key,provincial_government_id_key,const DeepCollectionEquality().hash(identity_documents),active,city_number,city_name,guilds_id,license_number,guilds_name,phone,type_activity,area_activity,province_number,province_name,steward,has_pos,const DeepCollectionEquality().hash(centers_allocation),const DeepCollectionEquality().hash(kill_house_centers_allocation),const DeepCollectionEquality().hash(allocation_limit),limitation_allocation,registerar_role,registerar_fullname,registerar_mobile,kill_house_register,steward_register,guilds_room_register,pos_company_register,province_accept_state,province_message,condition,description_condition,steward_active,const DeepCollectionEquality().hash(steward_allocation_limit),steward_limitation_allocation,license,const DeepCollectionEquality().hash(license_form),const DeepCollectionEquality().hash(license_file),reviewer_role,reviewer_fullname,reviewer_mobile,checker_message,final_accept,temporary_registration,created_by,modified_by,const DeepCollectionEquality().hash(user_bank_info),wallet,const DeepCollectionEquality().hash(cars),const DeepCollectionEquality().hash(user_level)]); + +@override +String toString() { + return 'GuildProfile(id: $id, user: $user, address: $address, guild_area_activity: $guild_area_activity, guild_type_activity: $guild_type_activity, kill_house: $kill_house, steward_kill_house: $steward_kill_house, stewards: $stewards, get_pos_status: $get_pos_status, key: $key, create_date: $create_date, modify_date: $modify_date, trash: $trash, user_id_foreign_key: $user_id_foreign_key, address_id_foreign_key: $address_id_foreign_key, user_bank_id_foreign_key: $user_bank_id_foreign_key, wallet_id_foreign_key: $wallet_id_foreign_key, provincial_government_id_key: $provincial_government_id_key, identity_documents: $identity_documents, active: $active, city_number: $city_number, city_name: $city_name, guilds_id: $guilds_id, license_number: $license_number, guilds_name: $guilds_name, phone: $phone, type_activity: $type_activity, area_activity: $area_activity, province_number: $province_number, province_name: $province_name, steward: $steward, has_pos: $has_pos, centers_allocation: $centers_allocation, kill_house_centers_allocation: $kill_house_centers_allocation, allocation_limit: $allocation_limit, limitation_allocation: $limitation_allocation, registerar_role: $registerar_role, registerar_fullname: $registerar_fullname, registerar_mobile: $registerar_mobile, kill_house_register: $kill_house_register, steward_register: $steward_register, guilds_room_register: $guilds_room_register, pos_company_register: $pos_company_register, province_accept_state: $province_accept_state, province_message: $province_message, condition: $condition, description_condition: $description_condition, steward_active: $steward_active, steward_allocation_limit: $steward_allocation_limit, steward_limitation_allocation: $steward_limitation_allocation, license: $license, license_form: $license_form, license_file: $license_file, reviewer_role: $reviewer_role, reviewer_fullname: $reviewer_fullname, reviewer_mobile: $reviewer_mobile, checker_message: $checker_message, final_accept: $final_accept, temporary_registration: $temporary_registration, created_by: $created_by, modified_by: $modified_by, user_bank_info: $user_bank_info, wallet: $wallet, cars: $cars, user_level: $user_level)'; +} + + +} + +/// @nodoc +abstract mixin class $GuildProfileCopyWith<$Res> { + factory $GuildProfileCopyWith(GuildProfile value, $Res Function(GuildProfile) _then) = _$GuildProfileCopyWithImpl; +@useResult +$Res call({ + int? id, User? user, Address? address, GuildAreaActivity? guild_area_activity, GuildTypeActivity? guild_type_activity, List? kill_house, List? steward_kill_house, List? stewards, GetPosStatus? get_pos_status, String? key, String? create_date, String? modify_date, bool? trash, String? user_id_foreign_key, String? address_id_foreign_key, String? user_bank_id_foreign_key, String? wallet_id_foreign_key, String? provincial_government_id_key, dynamic identity_documents, bool? active, int? city_number, String? city_name, String? guilds_id, String? license_number, String? guilds_name, String? phone, String? type_activity, String? area_activity, int? province_number, String? province_name, bool? steward, bool? has_pos, dynamic centers_allocation, dynamic kill_house_centers_allocation, dynamic allocation_limit, bool? limitation_allocation, String? registerar_role, String? registerar_fullname, String? registerar_mobile, bool? kill_house_register, bool? steward_register, bool? guilds_room_register, bool? pos_company_register, String? province_accept_state, String? province_message, String? condition, String? description_condition, bool? steward_active, dynamic steward_allocation_limit, bool? steward_limitation_allocation, bool? license, dynamic license_form, dynamic license_file, String? reviewer_role, String? reviewer_fullname, String? reviewer_mobile, String? checker_message, bool? final_accept, bool? temporary_registration, String? created_by, String? modified_by, dynamic user_bank_info, int? wallet, List? cars, List? user_level +}); + + +$UserCopyWith<$Res>? get user;$AddressCopyWith<$Res>? get address;$GuildAreaActivityCopyWith<$Res>? get guild_area_activity;$GuildTypeActivityCopyWith<$Res>? get guild_type_activity;$GetPosStatusCopyWith<$Res>? get get_pos_status; + +} +/// @nodoc +class _$GuildProfileCopyWithImpl<$Res> + implements $GuildProfileCopyWith<$Res> { + _$GuildProfileCopyWithImpl(this._self, this._then); + + final GuildProfile _self; + final $Res Function(GuildProfile) _then; + +/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guild_area_activity = freezed,Object? guild_type_activity = freezed,Object? kill_house = freezed,Object? steward_kill_house = freezed,Object? stewards = freezed,Object? get_pos_status = freezed,Object? key = freezed,Object? create_date = freezed,Object? modify_date = freezed,Object? trash = freezed,Object? user_id_foreign_key = freezed,Object? address_id_foreign_key = freezed,Object? user_bank_id_foreign_key = freezed,Object? wallet_id_foreign_key = freezed,Object? provincial_government_id_key = freezed,Object? identity_documents = freezed,Object? active = freezed,Object? city_number = freezed,Object? city_name = freezed,Object? guilds_id = freezed,Object? license_number = freezed,Object? guilds_name = freezed,Object? phone = freezed,Object? type_activity = freezed,Object? area_activity = freezed,Object? province_number = freezed,Object? province_name = freezed,Object? steward = freezed,Object? has_pos = freezed,Object? centers_allocation = freezed,Object? kill_house_centers_allocation = freezed,Object? allocation_limit = freezed,Object? limitation_allocation = freezed,Object? registerar_role = freezed,Object? registerar_fullname = freezed,Object? registerar_mobile = freezed,Object? kill_house_register = freezed,Object? steward_register = freezed,Object? guilds_room_register = freezed,Object? pos_company_register = freezed,Object? province_accept_state = freezed,Object? province_message = freezed,Object? condition = freezed,Object? description_condition = freezed,Object? steward_active = freezed,Object? steward_allocation_limit = freezed,Object? steward_limitation_allocation = freezed,Object? license = freezed,Object? license_form = freezed,Object? license_file = freezed,Object? reviewer_role = freezed,Object? reviewer_fullname = freezed,Object? reviewer_mobile = freezed,Object? checker_message = freezed,Object? final_accept = freezed,Object? temporary_registration = freezed,Object? created_by = freezed,Object? modified_by = freezed,Object? user_bank_info = freezed,Object? wallet = freezed,Object? cars = freezed,Object? user_level = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,guild_area_activity: freezed == guild_area_activity ? _self.guild_area_activity : guild_area_activity // ignore: cast_nullable_to_non_nullable +as GuildAreaActivity?,guild_type_activity: freezed == guild_type_activity ? _self.guild_type_activity : guild_type_activity // ignore: cast_nullable_to_non_nullable +as GuildTypeActivity?,kill_house: freezed == kill_house ? _self.kill_house : kill_house // ignore: cast_nullable_to_non_nullable +as List?,steward_kill_house: freezed == steward_kill_house ? _self.steward_kill_house : steward_kill_house // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self.stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,get_pos_status: freezed == get_pos_status ? _self.get_pos_status : get_pos_status // ignore: cast_nullable_to_non_nullable +as GetPosStatus?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,create_date: freezed == create_date ? _self.create_date : create_date // ignore: cast_nullable_to_non_nullable +as String?,modify_date: freezed == modify_date ? _self.modify_date : modify_date // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,user_id_foreign_key: freezed == user_id_foreign_key ? _self.user_id_foreign_key : user_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,address_id_foreign_key: freezed == address_id_foreign_key ? _self.address_id_foreign_key : address_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,user_bank_id_foreign_key: freezed == user_bank_id_foreign_key ? _self.user_bank_id_foreign_key : user_bank_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,wallet_id_foreign_key: freezed == wallet_id_foreign_key ? _self.wallet_id_foreign_key : wallet_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,provincial_government_id_key: freezed == provincial_government_id_key ? _self.provincial_government_id_key : provincial_government_id_key // ignore: cast_nullable_to_non_nullable +as String?,identity_documents: freezed == identity_documents ? _self.identity_documents : identity_documents // ignore: cast_nullable_to_non_nullable +as dynamic,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,city_number: freezed == city_number ? _self.city_number : city_number // ignore: cast_nullable_to_non_nullable +as int?,city_name: freezed == city_name ? _self.city_name : city_name // ignore: cast_nullable_to_non_nullable +as String?,guilds_id: freezed == guilds_id ? _self.guilds_id : guilds_id // ignore: cast_nullable_to_non_nullable +as String?,license_number: freezed == license_number ? _self.license_number : license_number // ignore: cast_nullable_to_non_nullable +as String?,guilds_name: freezed == guilds_name ? _self.guilds_name : guilds_name // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,type_activity: freezed == type_activity ? _self.type_activity : type_activity // ignore: cast_nullable_to_non_nullable +as String?,area_activity: freezed == area_activity ? _self.area_activity : area_activity // ignore: cast_nullable_to_non_nullable +as String?,province_number: freezed == province_number ? _self.province_number : province_number // ignore: cast_nullable_to_non_nullable +as int?,province_name: freezed == province_name ? _self.province_name : province_name // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,has_pos: freezed == has_pos ? _self.has_pos : has_pos // ignore: cast_nullable_to_non_nullable +as bool?,centers_allocation: freezed == centers_allocation ? _self.centers_allocation : centers_allocation // ignore: cast_nullable_to_non_nullable +as dynamic,kill_house_centers_allocation: freezed == kill_house_centers_allocation ? _self.kill_house_centers_allocation : kill_house_centers_allocation // ignore: cast_nullable_to_non_nullable +as dynamic,allocation_limit: freezed == allocation_limit ? _self.allocation_limit : allocation_limit // ignore: cast_nullable_to_non_nullable +as dynamic,limitation_allocation: freezed == limitation_allocation ? _self.limitation_allocation : limitation_allocation // ignore: cast_nullable_to_non_nullable +as bool?,registerar_role: freezed == registerar_role ? _self.registerar_role : registerar_role // ignore: cast_nullable_to_non_nullable +as String?,registerar_fullname: freezed == registerar_fullname ? _self.registerar_fullname : registerar_fullname // ignore: cast_nullable_to_non_nullable +as String?,registerar_mobile: freezed == registerar_mobile ? _self.registerar_mobile : registerar_mobile // ignore: cast_nullable_to_non_nullable +as String?,kill_house_register: freezed == kill_house_register ? _self.kill_house_register : kill_house_register // ignore: cast_nullable_to_non_nullable +as bool?,steward_register: freezed == steward_register ? _self.steward_register : steward_register // ignore: cast_nullable_to_non_nullable +as bool?,guilds_room_register: freezed == guilds_room_register ? _self.guilds_room_register : guilds_room_register // ignore: cast_nullable_to_non_nullable +as bool?,pos_company_register: freezed == pos_company_register ? _self.pos_company_register : pos_company_register // ignore: cast_nullable_to_non_nullable +as bool?,province_accept_state: freezed == province_accept_state ? _self.province_accept_state : province_accept_state // ignore: cast_nullable_to_non_nullable +as String?,province_message: freezed == province_message ? _self.province_message : province_message // ignore: cast_nullable_to_non_nullable +as String?,condition: freezed == condition ? _self.condition : condition // ignore: cast_nullable_to_non_nullable +as String?,description_condition: freezed == description_condition ? _self.description_condition : description_condition // ignore: cast_nullable_to_non_nullable +as String?,steward_active: freezed == steward_active ? _self.steward_active : steward_active // ignore: cast_nullable_to_non_nullable +as bool?,steward_allocation_limit: freezed == steward_allocation_limit ? _self.steward_allocation_limit : steward_allocation_limit // ignore: cast_nullable_to_non_nullable +as dynamic,steward_limitation_allocation: freezed == steward_limitation_allocation ? _self.steward_limitation_allocation : steward_limitation_allocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,license_form: freezed == license_form ? _self.license_form : license_form // ignore: cast_nullable_to_non_nullable +as dynamic,license_file: freezed == license_file ? _self.license_file : license_file // ignore: cast_nullable_to_non_nullable +as dynamic,reviewer_role: freezed == reviewer_role ? _self.reviewer_role : reviewer_role // ignore: cast_nullable_to_non_nullable +as String?,reviewer_fullname: freezed == reviewer_fullname ? _self.reviewer_fullname : reviewer_fullname // ignore: cast_nullable_to_non_nullable +as String?,reviewer_mobile: freezed == reviewer_mobile ? _self.reviewer_mobile : reviewer_mobile // ignore: cast_nullable_to_non_nullable +as String?,checker_message: freezed == checker_message ? _self.checker_message : checker_message // ignore: cast_nullable_to_non_nullable +as String?,final_accept: freezed == final_accept ? _self.final_accept : final_accept // ignore: cast_nullable_to_non_nullable +as bool?,temporary_registration: freezed == temporary_registration ? _self.temporary_registration : temporary_registration // ignore: cast_nullable_to_non_nullable +as bool?,created_by: freezed == created_by ? _self.created_by : created_by // ignore: cast_nullable_to_non_nullable +as String?,modified_by: freezed == modified_by ? _self.modified_by : modified_by // ignore: cast_nullable_to_non_nullable +as String?,user_bank_info: freezed == user_bank_info ? _self.user_bank_info : user_bank_info // ignore: cast_nullable_to_non_nullable +as dynamic,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self.cars : cars // ignore: cast_nullable_to_non_nullable +as List?,user_level: freezed == user_level ? _self.user_level : user_level // ignore: cast_nullable_to_non_nullable +as List?, + )); +} +/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GuildAreaActivityCopyWith<$Res>? get guild_area_activity { + if (_self.guild_area_activity == null) { + return null; + } + + return $GuildAreaActivityCopyWith<$Res>(_self.guild_area_activity!, (value) { + return _then(_self.copyWith(guild_area_activity: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GuildTypeActivityCopyWith<$Res>? get guild_type_activity { + if (_self.guild_type_activity == null) { + return null; + } + + return $GuildTypeActivityCopyWith<$Res>(_self.guild_type_activity!, (value) { + return _then(_self.copyWith(guild_type_activity: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetPosStatusCopyWith<$Res>? get get_pos_status { + if (_self.get_pos_status == null) { + return null; + } + + return $GetPosStatusCopyWith<$Res>(_self.get_pos_status!, (value) { + return _then(_self.copyWith(get_pos_status: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [GuildProfile]. +extension GuildProfilePatterns on GuildProfile { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GuildProfile value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GuildProfile() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GuildProfile value) $default,){ +final _that = this; +switch (_that) { +case _GuildProfile(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GuildProfile value)? $default,){ +final _that = this; +switch (_that) { +case _GuildProfile() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, User? user, Address? address, GuildAreaActivity? guild_area_activity, GuildTypeActivity? guild_type_activity, List? kill_house, List? steward_kill_house, List? stewards, GetPosStatus? get_pos_status, String? key, String? create_date, String? modify_date, bool? trash, String? user_id_foreign_key, String? address_id_foreign_key, String? user_bank_id_foreign_key, String? wallet_id_foreign_key, String? provincial_government_id_key, dynamic identity_documents, bool? active, int? city_number, String? city_name, String? guilds_id, String? license_number, String? guilds_name, String? phone, String? type_activity, String? area_activity, int? province_number, String? province_name, bool? steward, bool? has_pos, dynamic centers_allocation, dynamic kill_house_centers_allocation, dynamic allocation_limit, bool? limitation_allocation, String? registerar_role, String? registerar_fullname, String? registerar_mobile, bool? kill_house_register, bool? steward_register, bool? guilds_room_register, bool? pos_company_register, String? province_accept_state, String? province_message, String? condition, String? description_condition, bool? steward_active, dynamic steward_allocation_limit, bool? steward_limitation_allocation, bool? license, dynamic license_form, dynamic license_file, String? reviewer_role, String? reviewer_fullname, String? reviewer_mobile, String? checker_message, bool? final_accept, bool? temporary_registration, String? created_by, String? modified_by, dynamic user_bank_info, int? wallet, List? cars, List? user_level)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GuildProfile() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guild_area_activity,_that.guild_type_activity,_that.kill_house,_that.steward_kill_house,_that.stewards,_that.get_pos_status,_that.key,_that.create_date,_that.modify_date,_that.trash,_that.user_id_foreign_key,_that.address_id_foreign_key,_that.user_bank_id_foreign_key,_that.wallet_id_foreign_key,_that.provincial_government_id_key,_that.identity_documents,_that.active,_that.city_number,_that.city_name,_that.guilds_id,_that.license_number,_that.guilds_name,_that.phone,_that.type_activity,_that.area_activity,_that.province_number,_that.province_name,_that.steward,_that.has_pos,_that.centers_allocation,_that.kill_house_centers_allocation,_that.allocation_limit,_that.limitation_allocation,_that.registerar_role,_that.registerar_fullname,_that.registerar_mobile,_that.kill_house_register,_that.steward_register,_that.guilds_room_register,_that.pos_company_register,_that.province_accept_state,_that.province_message,_that.condition,_that.description_condition,_that.steward_active,_that.steward_allocation_limit,_that.steward_limitation_allocation,_that.license,_that.license_form,_that.license_file,_that.reviewer_role,_that.reviewer_fullname,_that.reviewer_mobile,_that.checker_message,_that.final_accept,_that.temporary_registration,_that.created_by,_that.modified_by,_that.user_bank_info,_that.wallet,_that.cars,_that.user_level);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, User? user, Address? address, GuildAreaActivity? guild_area_activity, GuildTypeActivity? guild_type_activity, List? kill_house, List? steward_kill_house, List? stewards, GetPosStatus? get_pos_status, String? key, String? create_date, String? modify_date, bool? trash, String? user_id_foreign_key, String? address_id_foreign_key, String? user_bank_id_foreign_key, String? wallet_id_foreign_key, String? provincial_government_id_key, dynamic identity_documents, bool? active, int? city_number, String? city_name, String? guilds_id, String? license_number, String? guilds_name, String? phone, String? type_activity, String? area_activity, int? province_number, String? province_name, bool? steward, bool? has_pos, dynamic centers_allocation, dynamic kill_house_centers_allocation, dynamic allocation_limit, bool? limitation_allocation, String? registerar_role, String? registerar_fullname, String? registerar_mobile, bool? kill_house_register, bool? steward_register, bool? guilds_room_register, bool? pos_company_register, String? province_accept_state, String? province_message, String? condition, String? description_condition, bool? steward_active, dynamic steward_allocation_limit, bool? steward_limitation_allocation, bool? license, dynamic license_form, dynamic license_file, String? reviewer_role, String? reviewer_fullname, String? reviewer_mobile, String? checker_message, bool? final_accept, bool? temporary_registration, String? created_by, String? modified_by, dynamic user_bank_info, int? wallet, List? cars, List? user_level) $default,) {final _that = this; +switch (_that) { +case _GuildProfile(): +return $default(_that.id,_that.user,_that.address,_that.guild_area_activity,_that.guild_type_activity,_that.kill_house,_that.steward_kill_house,_that.stewards,_that.get_pos_status,_that.key,_that.create_date,_that.modify_date,_that.trash,_that.user_id_foreign_key,_that.address_id_foreign_key,_that.user_bank_id_foreign_key,_that.wallet_id_foreign_key,_that.provincial_government_id_key,_that.identity_documents,_that.active,_that.city_number,_that.city_name,_that.guilds_id,_that.license_number,_that.guilds_name,_that.phone,_that.type_activity,_that.area_activity,_that.province_number,_that.province_name,_that.steward,_that.has_pos,_that.centers_allocation,_that.kill_house_centers_allocation,_that.allocation_limit,_that.limitation_allocation,_that.registerar_role,_that.registerar_fullname,_that.registerar_mobile,_that.kill_house_register,_that.steward_register,_that.guilds_room_register,_that.pos_company_register,_that.province_accept_state,_that.province_message,_that.condition,_that.description_condition,_that.steward_active,_that.steward_allocation_limit,_that.steward_limitation_allocation,_that.license,_that.license_form,_that.license_file,_that.reviewer_role,_that.reviewer_fullname,_that.reviewer_mobile,_that.checker_message,_that.final_accept,_that.temporary_registration,_that.created_by,_that.modified_by,_that.user_bank_info,_that.wallet,_that.cars,_that.user_level);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, User? user, Address? address, GuildAreaActivity? guild_area_activity, GuildTypeActivity? guild_type_activity, List? kill_house, List? steward_kill_house, List? stewards, GetPosStatus? get_pos_status, String? key, String? create_date, String? modify_date, bool? trash, String? user_id_foreign_key, String? address_id_foreign_key, String? user_bank_id_foreign_key, String? wallet_id_foreign_key, String? provincial_government_id_key, dynamic identity_documents, bool? active, int? city_number, String? city_name, String? guilds_id, String? license_number, String? guilds_name, String? phone, String? type_activity, String? area_activity, int? province_number, String? province_name, bool? steward, bool? has_pos, dynamic centers_allocation, dynamic kill_house_centers_allocation, dynamic allocation_limit, bool? limitation_allocation, String? registerar_role, String? registerar_fullname, String? registerar_mobile, bool? kill_house_register, bool? steward_register, bool? guilds_room_register, bool? pos_company_register, String? province_accept_state, String? province_message, String? condition, String? description_condition, bool? steward_active, dynamic steward_allocation_limit, bool? steward_limitation_allocation, bool? license, dynamic license_form, dynamic license_file, String? reviewer_role, String? reviewer_fullname, String? reviewer_mobile, String? checker_message, bool? final_accept, bool? temporary_registration, String? created_by, String? modified_by, dynamic user_bank_info, int? wallet, List? cars, List? user_level)? $default,) {final _that = this; +switch (_that) { +case _GuildProfile() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guild_area_activity,_that.guild_type_activity,_that.kill_house,_that.steward_kill_house,_that.stewards,_that.get_pos_status,_that.key,_that.create_date,_that.modify_date,_that.trash,_that.user_id_foreign_key,_that.address_id_foreign_key,_that.user_bank_id_foreign_key,_that.wallet_id_foreign_key,_that.provincial_government_id_key,_that.identity_documents,_that.active,_that.city_number,_that.city_name,_that.guilds_id,_that.license_number,_that.guilds_name,_that.phone,_that.type_activity,_that.area_activity,_that.province_number,_that.province_name,_that.steward,_that.has_pos,_that.centers_allocation,_that.kill_house_centers_allocation,_that.allocation_limit,_that.limitation_allocation,_that.registerar_role,_that.registerar_fullname,_that.registerar_mobile,_that.kill_house_register,_that.steward_register,_that.guilds_room_register,_that.pos_company_register,_that.province_accept_state,_that.province_message,_that.condition,_that.description_condition,_that.steward_active,_that.steward_allocation_limit,_that.steward_limitation_allocation,_that.license,_that.license_form,_that.license_file,_that.reviewer_role,_that.reviewer_fullname,_that.reviewer_mobile,_that.checker_message,_that.final_accept,_that.temporary_registration,_that.created_by,_that.modified_by,_that.user_bank_info,_that.wallet,_that.cars,_that.user_level);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GuildProfile implements GuildProfile { + const _GuildProfile({this.id, this.user, this.address, this.guild_area_activity, this.guild_type_activity, final List? kill_house, final List? steward_kill_house, final List? stewards, this.get_pos_status, this.key, this.create_date, this.modify_date, this.trash, this.user_id_foreign_key, this.address_id_foreign_key, this.user_bank_id_foreign_key, this.wallet_id_foreign_key, this.provincial_government_id_key, this.identity_documents, this.active, this.city_number, this.city_name, this.guilds_id, this.license_number, this.guilds_name, this.phone, this.type_activity, this.area_activity, this.province_number, this.province_name, this.steward, this.has_pos, this.centers_allocation, this.kill_house_centers_allocation, this.allocation_limit, this.limitation_allocation, this.registerar_role, this.registerar_fullname, this.registerar_mobile, this.kill_house_register, this.steward_register, this.guilds_room_register, this.pos_company_register, this.province_accept_state, this.province_message, this.condition, this.description_condition, this.steward_active, this.steward_allocation_limit, this.steward_limitation_allocation, this.license, this.license_form, this.license_file, this.reviewer_role, this.reviewer_fullname, this.reviewer_mobile, this.checker_message, this.final_accept, this.temporary_registration, this.created_by, this.modified_by, this.user_bank_info, this.wallet, final List? cars, final List? user_level}): _kill_house = kill_house,_steward_kill_house = steward_kill_house,_stewards = stewards,_cars = cars,_user_level = user_level; + factory _GuildProfile.fromJson(Map json) => _$GuildProfileFromJson(json); + +@override final int? id; +@override final User? user; +@override final Address? address; +@override final GuildAreaActivity? guild_area_activity; +@override final GuildTypeActivity? guild_type_activity; + final List? _kill_house; +@override List? get kill_house { + final value = _kill_house; + if (value == null) return null; + if (_kill_house is EqualUnmodifiableListView) return _kill_house; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _steward_kill_house; +@override List? get steward_kill_house { + final value = _steward_kill_house; + if (value == null) return null; + if (_steward_kill_house is EqualUnmodifiableListView) return _steward_kill_house; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewards; +@override List? get stewards { + final value = _stewards; + if (value == null) return null; + if (_stewards is EqualUnmodifiableListView) return _stewards; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final GetPosStatus? get_pos_status; +@override final String? key; +@override final String? create_date; +@override final String? modify_date; +@override final bool? trash; +@override final String? user_id_foreign_key; +@override final String? address_id_foreign_key; +@override final String? user_bank_id_foreign_key; +@override final String? wallet_id_foreign_key; +@override final String? provincial_government_id_key; +@override final dynamic identity_documents; +@override final bool? active; +@override final int? city_number; +@override final String? city_name; +@override final String? guilds_id; +@override final String? license_number; +@override final String? guilds_name; +@override final String? phone; +@override final String? type_activity; +@override final String? area_activity; +@override final int? province_number; +@override final String? province_name; +@override final bool? steward; +@override final bool? has_pos; +@override final dynamic centers_allocation; +@override final dynamic kill_house_centers_allocation; +@override final dynamic allocation_limit; +@override final bool? limitation_allocation; +@override final String? registerar_role; +@override final String? registerar_fullname; +@override final String? registerar_mobile; +@override final bool? kill_house_register; +@override final bool? steward_register; +@override final bool? guilds_room_register; +@override final bool? pos_company_register; +@override final String? province_accept_state; +@override final String? province_message; +@override final String? condition; +@override final String? description_condition; +@override final bool? steward_active; +@override final dynamic steward_allocation_limit; +@override final bool? steward_limitation_allocation; +@override final bool? license; +@override final dynamic license_form; +@override final dynamic license_file; +@override final String? reviewer_role; +@override final String? reviewer_fullname; +@override final String? reviewer_mobile; +@override final String? checker_message; +@override final bool? final_accept; +@override final bool? temporary_registration; +@override final String? created_by; +@override final String? modified_by; +@override final dynamic user_bank_info; +@override final int? wallet; + final List? _cars; +@override List? get cars { + final value = _cars; + if (value == null) return null; + if (_cars is EqualUnmodifiableListView) return _cars; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _user_level; +@override List? get user_level { + final value = _user_level; + if (value == null) return null; + if (_user_level is EqualUnmodifiableListView) return _user_level; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GuildProfileCopyWith<_GuildProfile> get copyWith => __$GuildProfileCopyWithImpl<_GuildProfile>(this, _$identity); + +@override +Map toJson() { + return _$GuildProfileToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildProfile&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&(identical(other.guild_area_activity, guild_area_activity) || other.guild_area_activity == guild_area_activity)&&(identical(other.guild_type_activity, guild_type_activity) || other.guild_type_activity == guild_type_activity)&&const DeepCollectionEquality().equals(other._kill_house, _kill_house)&&const DeepCollectionEquality().equals(other._steward_kill_house, _steward_kill_house)&&const DeepCollectionEquality().equals(other._stewards, _stewards)&&(identical(other.get_pos_status, get_pos_status) || other.get_pos_status == get_pos_status)&&(identical(other.key, key) || other.key == key)&&(identical(other.create_date, create_date) || other.create_date == create_date)&&(identical(other.modify_date, modify_date) || other.modify_date == modify_date)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.user_id_foreign_key, user_id_foreign_key) || other.user_id_foreign_key == user_id_foreign_key)&&(identical(other.address_id_foreign_key, address_id_foreign_key) || other.address_id_foreign_key == address_id_foreign_key)&&(identical(other.user_bank_id_foreign_key, user_bank_id_foreign_key) || other.user_bank_id_foreign_key == user_bank_id_foreign_key)&&(identical(other.wallet_id_foreign_key, wallet_id_foreign_key) || other.wallet_id_foreign_key == wallet_id_foreign_key)&&(identical(other.provincial_government_id_key, provincial_government_id_key) || other.provincial_government_id_key == provincial_government_id_key)&&const DeepCollectionEquality().equals(other.identity_documents, identity_documents)&&(identical(other.active, active) || other.active == active)&&(identical(other.city_number, city_number) || other.city_number == city_number)&&(identical(other.city_name, city_name) || other.city_name == city_name)&&(identical(other.guilds_id, guilds_id) || other.guilds_id == guilds_id)&&(identical(other.license_number, license_number) || other.license_number == license_number)&&(identical(other.guilds_name, guilds_name) || other.guilds_name == guilds_name)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.type_activity, type_activity) || other.type_activity == type_activity)&&(identical(other.area_activity, area_activity) || other.area_activity == area_activity)&&(identical(other.province_number, province_number) || other.province_number == province_number)&&(identical(other.province_name, province_name) || other.province_name == province_name)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.has_pos, has_pos) || other.has_pos == has_pos)&&const DeepCollectionEquality().equals(other.centers_allocation, centers_allocation)&&const DeepCollectionEquality().equals(other.kill_house_centers_allocation, kill_house_centers_allocation)&&const DeepCollectionEquality().equals(other.allocation_limit, allocation_limit)&&(identical(other.limitation_allocation, limitation_allocation) || other.limitation_allocation == limitation_allocation)&&(identical(other.registerar_role, registerar_role) || other.registerar_role == registerar_role)&&(identical(other.registerar_fullname, registerar_fullname) || other.registerar_fullname == registerar_fullname)&&(identical(other.registerar_mobile, registerar_mobile) || other.registerar_mobile == registerar_mobile)&&(identical(other.kill_house_register, kill_house_register) || other.kill_house_register == kill_house_register)&&(identical(other.steward_register, steward_register) || other.steward_register == steward_register)&&(identical(other.guilds_room_register, guilds_room_register) || other.guilds_room_register == guilds_room_register)&&(identical(other.pos_company_register, pos_company_register) || other.pos_company_register == pos_company_register)&&(identical(other.province_accept_state, province_accept_state) || other.province_accept_state == province_accept_state)&&(identical(other.province_message, province_message) || other.province_message == province_message)&&(identical(other.condition, condition) || other.condition == condition)&&(identical(other.description_condition, description_condition) || other.description_condition == description_condition)&&(identical(other.steward_active, steward_active) || other.steward_active == steward_active)&&const DeepCollectionEquality().equals(other.steward_allocation_limit, steward_allocation_limit)&&(identical(other.steward_limitation_allocation, steward_limitation_allocation) || other.steward_limitation_allocation == steward_limitation_allocation)&&(identical(other.license, license) || other.license == license)&&const DeepCollectionEquality().equals(other.license_form, license_form)&&const DeepCollectionEquality().equals(other.license_file, license_file)&&(identical(other.reviewer_role, reviewer_role) || other.reviewer_role == reviewer_role)&&(identical(other.reviewer_fullname, reviewer_fullname) || other.reviewer_fullname == reviewer_fullname)&&(identical(other.reviewer_mobile, reviewer_mobile) || other.reviewer_mobile == reviewer_mobile)&&(identical(other.checker_message, checker_message) || other.checker_message == checker_message)&&(identical(other.final_accept, final_accept) || other.final_accept == final_accept)&&(identical(other.temporary_registration, temporary_registration) || other.temporary_registration == temporary_registration)&&(identical(other.created_by, created_by) || other.created_by == created_by)&&(identical(other.modified_by, modified_by) || other.modified_by == modified_by)&&const DeepCollectionEquality().equals(other.user_bank_info, user_bank_info)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other._cars, _cars)&&const DeepCollectionEquality().equals(other._user_level, _user_level)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,guild_area_activity,guild_type_activity,const DeepCollectionEquality().hash(_kill_house),const DeepCollectionEquality().hash(_steward_kill_house),const DeepCollectionEquality().hash(_stewards),get_pos_status,key,create_date,modify_date,trash,user_id_foreign_key,address_id_foreign_key,user_bank_id_foreign_key,wallet_id_foreign_key,provincial_government_id_key,const DeepCollectionEquality().hash(identity_documents),active,city_number,city_name,guilds_id,license_number,guilds_name,phone,type_activity,area_activity,province_number,province_name,steward,has_pos,const DeepCollectionEquality().hash(centers_allocation),const DeepCollectionEquality().hash(kill_house_centers_allocation),const DeepCollectionEquality().hash(allocation_limit),limitation_allocation,registerar_role,registerar_fullname,registerar_mobile,kill_house_register,steward_register,guilds_room_register,pos_company_register,province_accept_state,province_message,condition,description_condition,steward_active,const DeepCollectionEquality().hash(steward_allocation_limit),steward_limitation_allocation,license,const DeepCollectionEquality().hash(license_form),const DeepCollectionEquality().hash(license_file),reviewer_role,reviewer_fullname,reviewer_mobile,checker_message,final_accept,temporary_registration,created_by,modified_by,const DeepCollectionEquality().hash(user_bank_info),wallet,const DeepCollectionEquality().hash(_cars),const DeepCollectionEquality().hash(_user_level)]); + +@override +String toString() { + return 'GuildProfile(id: $id, user: $user, address: $address, guild_area_activity: $guild_area_activity, guild_type_activity: $guild_type_activity, kill_house: $kill_house, steward_kill_house: $steward_kill_house, stewards: $stewards, get_pos_status: $get_pos_status, key: $key, create_date: $create_date, modify_date: $modify_date, trash: $trash, user_id_foreign_key: $user_id_foreign_key, address_id_foreign_key: $address_id_foreign_key, user_bank_id_foreign_key: $user_bank_id_foreign_key, wallet_id_foreign_key: $wallet_id_foreign_key, provincial_government_id_key: $provincial_government_id_key, identity_documents: $identity_documents, active: $active, city_number: $city_number, city_name: $city_name, guilds_id: $guilds_id, license_number: $license_number, guilds_name: $guilds_name, phone: $phone, type_activity: $type_activity, area_activity: $area_activity, province_number: $province_number, province_name: $province_name, steward: $steward, has_pos: $has_pos, centers_allocation: $centers_allocation, kill_house_centers_allocation: $kill_house_centers_allocation, allocation_limit: $allocation_limit, limitation_allocation: $limitation_allocation, registerar_role: $registerar_role, registerar_fullname: $registerar_fullname, registerar_mobile: $registerar_mobile, kill_house_register: $kill_house_register, steward_register: $steward_register, guilds_room_register: $guilds_room_register, pos_company_register: $pos_company_register, province_accept_state: $province_accept_state, province_message: $province_message, condition: $condition, description_condition: $description_condition, steward_active: $steward_active, steward_allocation_limit: $steward_allocation_limit, steward_limitation_allocation: $steward_limitation_allocation, license: $license, license_form: $license_form, license_file: $license_file, reviewer_role: $reviewer_role, reviewer_fullname: $reviewer_fullname, reviewer_mobile: $reviewer_mobile, checker_message: $checker_message, final_accept: $final_accept, temporary_registration: $temporary_registration, created_by: $created_by, modified_by: $modified_by, user_bank_info: $user_bank_info, wallet: $wallet, cars: $cars, user_level: $user_level)'; +} + + +} + +/// @nodoc +abstract mixin class _$GuildProfileCopyWith<$Res> implements $GuildProfileCopyWith<$Res> { + factory _$GuildProfileCopyWith(_GuildProfile value, $Res Function(_GuildProfile) _then) = __$GuildProfileCopyWithImpl; +@override @useResult +$Res call({ + int? id, User? user, Address? address, GuildAreaActivity? guild_area_activity, GuildTypeActivity? guild_type_activity, List? kill_house, List? steward_kill_house, List? stewards, GetPosStatus? get_pos_status, String? key, String? create_date, String? modify_date, bool? trash, String? user_id_foreign_key, String? address_id_foreign_key, String? user_bank_id_foreign_key, String? wallet_id_foreign_key, String? provincial_government_id_key, dynamic identity_documents, bool? active, int? city_number, String? city_name, String? guilds_id, String? license_number, String? guilds_name, String? phone, String? type_activity, String? area_activity, int? province_number, String? province_name, bool? steward, bool? has_pos, dynamic centers_allocation, dynamic kill_house_centers_allocation, dynamic allocation_limit, bool? limitation_allocation, String? registerar_role, String? registerar_fullname, String? registerar_mobile, bool? kill_house_register, bool? steward_register, bool? guilds_room_register, bool? pos_company_register, String? province_accept_state, String? province_message, String? condition, String? description_condition, bool? steward_active, dynamic steward_allocation_limit, bool? steward_limitation_allocation, bool? license, dynamic license_form, dynamic license_file, String? reviewer_role, String? reviewer_fullname, String? reviewer_mobile, String? checker_message, bool? final_accept, bool? temporary_registration, String? created_by, String? modified_by, dynamic user_bank_info, int? wallet, List? cars, List? user_level +}); + + +@override $UserCopyWith<$Res>? get user;@override $AddressCopyWith<$Res>? get address;@override $GuildAreaActivityCopyWith<$Res>? get guild_area_activity;@override $GuildTypeActivityCopyWith<$Res>? get guild_type_activity;@override $GetPosStatusCopyWith<$Res>? get get_pos_status; + +} +/// @nodoc +class __$GuildProfileCopyWithImpl<$Res> + implements _$GuildProfileCopyWith<$Res> { + __$GuildProfileCopyWithImpl(this._self, this._then); + + final _GuildProfile _self; + final $Res Function(_GuildProfile) _then; + +/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guild_area_activity = freezed,Object? guild_type_activity = freezed,Object? kill_house = freezed,Object? steward_kill_house = freezed,Object? stewards = freezed,Object? get_pos_status = freezed,Object? key = freezed,Object? create_date = freezed,Object? modify_date = freezed,Object? trash = freezed,Object? user_id_foreign_key = freezed,Object? address_id_foreign_key = freezed,Object? user_bank_id_foreign_key = freezed,Object? wallet_id_foreign_key = freezed,Object? provincial_government_id_key = freezed,Object? identity_documents = freezed,Object? active = freezed,Object? city_number = freezed,Object? city_name = freezed,Object? guilds_id = freezed,Object? license_number = freezed,Object? guilds_name = freezed,Object? phone = freezed,Object? type_activity = freezed,Object? area_activity = freezed,Object? province_number = freezed,Object? province_name = freezed,Object? steward = freezed,Object? has_pos = freezed,Object? centers_allocation = freezed,Object? kill_house_centers_allocation = freezed,Object? allocation_limit = freezed,Object? limitation_allocation = freezed,Object? registerar_role = freezed,Object? registerar_fullname = freezed,Object? registerar_mobile = freezed,Object? kill_house_register = freezed,Object? steward_register = freezed,Object? guilds_room_register = freezed,Object? pos_company_register = freezed,Object? province_accept_state = freezed,Object? province_message = freezed,Object? condition = freezed,Object? description_condition = freezed,Object? steward_active = freezed,Object? steward_allocation_limit = freezed,Object? steward_limitation_allocation = freezed,Object? license = freezed,Object? license_form = freezed,Object? license_file = freezed,Object? reviewer_role = freezed,Object? reviewer_fullname = freezed,Object? reviewer_mobile = freezed,Object? checker_message = freezed,Object? final_accept = freezed,Object? temporary_registration = freezed,Object? created_by = freezed,Object? modified_by = freezed,Object? user_bank_info = freezed,Object? wallet = freezed,Object? cars = freezed,Object? user_level = freezed,}) { + return _then(_GuildProfile( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,guild_area_activity: freezed == guild_area_activity ? _self.guild_area_activity : guild_area_activity // ignore: cast_nullable_to_non_nullable +as GuildAreaActivity?,guild_type_activity: freezed == guild_type_activity ? _self.guild_type_activity : guild_type_activity // ignore: cast_nullable_to_non_nullable +as GuildTypeActivity?,kill_house: freezed == kill_house ? _self._kill_house : kill_house // ignore: cast_nullable_to_non_nullable +as List?,steward_kill_house: freezed == steward_kill_house ? _self._steward_kill_house : steward_kill_house // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self._stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,get_pos_status: freezed == get_pos_status ? _self.get_pos_status : get_pos_status // ignore: cast_nullable_to_non_nullable +as GetPosStatus?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,create_date: freezed == create_date ? _self.create_date : create_date // ignore: cast_nullable_to_non_nullable +as String?,modify_date: freezed == modify_date ? _self.modify_date : modify_date // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,user_id_foreign_key: freezed == user_id_foreign_key ? _self.user_id_foreign_key : user_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,address_id_foreign_key: freezed == address_id_foreign_key ? _self.address_id_foreign_key : address_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,user_bank_id_foreign_key: freezed == user_bank_id_foreign_key ? _self.user_bank_id_foreign_key : user_bank_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,wallet_id_foreign_key: freezed == wallet_id_foreign_key ? _self.wallet_id_foreign_key : wallet_id_foreign_key // ignore: cast_nullable_to_non_nullable +as String?,provincial_government_id_key: freezed == provincial_government_id_key ? _self.provincial_government_id_key : provincial_government_id_key // ignore: cast_nullable_to_non_nullable +as String?,identity_documents: freezed == identity_documents ? _self.identity_documents : identity_documents // ignore: cast_nullable_to_non_nullable +as dynamic,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,city_number: freezed == city_number ? _self.city_number : city_number // ignore: cast_nullable_to_non_nullable +as int?,city_name: freezed == city_name ? _self.city_name : city_name // ignore: cast_nullable_to_non_nullable +as String?,guilds_id: freezed == guilds_id ? _self.guilds_id : guilds_id // ignore: cast_nullable_to_non_nullable +as String?,license_number: freezed == license_number ? _self.license_number : license_number // ignore: cast_nullable_to_non_nullable +as String?,guilds_name: freezed == guilds_name ? _self.guilds_name : guilds_name // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,type_activity: freezed == type_activity ? _self.type_activity : type_activity // ignore: cast_nullable_to_non_nullable +as String?,area_activity: freezed == area_activity ? _self.area_activity : area_activity // ignore: cast_nullable_to_non_nullable +as String?,province_number: freezed == province_number ? _self.province_number : province_number // ignore: cast_nullable_to_non_nullable +as int?,province_name: freezed == province_name ? _self.province_name : province_name // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,has_pos: freezed == has_pos ? _self.has_pos : has_pos // ignore: cast_nullable_to_non_nullable +as bool?,centers_allocation: freezed == centers_allocation ? _self.centers_allocation : centers_allocation // ignore: cast_nullable_to_non_nullable +as dynamic,kill_house_centers_allocation: freezed == kill_house_centers_allocation ? _self.kill_house_centers_allocation : kill_house_centers_allocation // ignore: cast_nullable_to_non_nullable +as dynamic,allocation_limit: freezed == allocation_limit ? _self.allocation_limit : allocation_limit // ignore: cast_nullable_to_non_nullable +as dynamic,limitation_allocation: freezed == limitation_allocation ? _self.limitation_allocation : limitation_allocation // ignore: cast_nullable_to_non_nullable +as bool?,registerar_role: freezed == registerar_role ? _self.registerar_role : registerar_role // ignore: cast_nullable_to_non_nullable +as String?,registerar_fullname: freezed == registerar_fullname ? _self.registerar_fullname : registerar_fullname // ignore: cast_nullable_to_non_nullable +as String?,registerar_mobile: freezed == registerar_mobile ? _self.registerar_mobile : registerar_mobile // ignore: cast_nullable_to_non_nullable +as String?,kill_house_register: freezed == kill_house_register ? _self.kill_house_register : kill_house_register // ignore: cast_nullable_to_non_nullable +as bool?,steward_register: freezed == steward_register ? _self.steward_register : steward_register // ignore: cast_nullable_to_non_nullable +as bool?,guilds_room_register: freezed == guilds_room_register ? _self.guilds_room_register : guilds_room_register // ignore: cast_nullable_to_non_nullable +as bool?,pos_company_register: freezed == pos_company_register ? _self.pos_company_register : pos_company_register // ignore: cast_nullable_to_non_nullable +as bool?,province_accept_state: freezed == province_accept_state ? _self.province_accept_state : province_accept_state // ignore: cast_nullable_to_non_nullable +as String?,province_message: freezed == province_message ? _self.province_message : province_message // ignore: cast_nullable_to_non_nullable +as String?,condition: freezed == condition ? _self.condition : condition // ignore: cast_nullable_to_non_nullable +as String?,description_condition: freezed == description_condition ? _self.description_condition : description_condition // ignore: cast_nullable_to_non_nullable +as String?,steward_active: freezed == steward_active ? _self.steward_active : steward_active // ignore: cast_nullable_to_non_nullable +as bool?,steward_allocation_limit: freezed == steward_allocation_limit ? _self.steward_allocation_limit : steward_allocation_limit // ignore: cast_nullable_to_non_nullable +as dynamic,steward_limitation_allocation: freezed == steward_limitation_allocation ? _self.steward_limitation_allocation : steward_limitation_allocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,license_form: freezed == license_form ? _self.license_form : license_form // ignore: cast_nullable_to_non_nullable +as dynamic,license_file: freezed == license_file ? _self.license_file : license_file // ignore: cast_nullable_to_non_nullable +as dynamic,reviewer_role: freezed == reviewer_role ? _self.reviewer_role : reviewer_role // ignore: cast_nullable_to_non_nullable +as String?,reviewer_fullname: freezed == reviewer_fullname ? _self.reviewer_fullname : reviewer_fullname // ignore: cast_nullable_to_non_nullable +as String?,reviewer_mobile: freezed == reviewer_mobile ? _self.reviewer_mobile : reviewer_mobile // ignore: cast_nullable_to_non_nullable +as String?,checker_message: freezed == checker_message ? _self.checker_message : checker_message // ignore: cast_nullable_to_non_nullable +as String?,final_accept: freezed == final_accept ? _self.final_accept : final_accept // ignore: cast_nullable_to_non_nullable +as bool?,temporary_registration: freezed == temporary_registration ? _self.temporary_registration : temporary_registration // ignore: cast_nullable_to_non_nullable +as bool?,created_by: freezed == created_by ? _self.created_by : created_by // ignore: cast_nullable_to_non_nullable +as String?,modified_by: freezed == modified_by ? _self.modified_by : modified_by // ignore: cast_nullable_to_non_nullable +as String?,user_bank_info: freezed == user_bank_info ? _self.user_bank_info : user_bank_info // ignore: cast_nullable_to_non_nullable +as dynamic,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self._cars : cars // ignore: cast_nullable_to_non_nullable +as List?,user_level: freezed == user_level ? _self._user_level : user_level // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GuildAreaActivityCopyWith<$Res>? get guild_area_activity { + if (_self.guild_area_activity == null) { + return null; + } + + return $GuildAreaActivityCopyWith<$Res>(_self.guild_area_activity!, (value) { + return _then(_self.copyWith(guild_area_activity: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GuildTypeActivityCopyWith<$Res>? get guild_type_activity { + if (_self.guild_type_activity == null) { + return null; + } + + return $GuildTypeActivityCopyWith<$Res>(_self.guild_type_activity!, (value) { + return _then(_self.copyWith(guild_type_activity: value)); + }); +}/// Create a copy of GuildProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetPosStatusCopyWith<$Res>? get get_pos_status { + if (_self.get_pos_status == null) { + return null; + } + + return $GetPosStatusCopyWith<$Res>(_self.get_pos_status!, (value) { + return _then(_self.copyWith(get_pos_status: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get first_name; String? get last_name; String? get mobile; String? get national_id; String? get city; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.first_name, first_name) || other.first_name == first_name)&&(identical(other.last_name, last_name) || other.last_name == last_name)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.national_id, national_id) || other.national_id == national_id)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,first_name,last_name,mobile,national_id,city); + +@override +String toString() { + return 'User(fullname: $fullname, first_name: $first_name, last_name: $last_name, mobile: $mobile, national_id: $national_id, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? first_name, String? last_name, String? mobile, String? national_id, String? city +}); + + + + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? first_name = freezed,Object? last_name = freezed,Object? mobile = freezed,Object? national_id = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,first_name: freezed == first_name ? _self.first_name : first_name // ignore: cast_nullable_to_non_nullable +as String?,last_name: freezed == last_name ? _self.last_name : last_name // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,national_id: freezed == national_id ? _self.national_id : national_id // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? first_name, String? last_name, String? mobile, String? national_id, String? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.first_name,_that.last_name,_that.mobile,_that.national_id,_that.city);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? first_name, String? last_name, String? mobile, String? national_id, String? city) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.first_name,_that.last_name,_that.mobile,_that.national_id,_that.city);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? first_name, String? last_name, String? mobile, String? national_id, String? city)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.first_name,_that.last_name,_that.mobile,_that.national_id,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({this.fullname, this.first_name, this.last_name, this.mobile, this.national_id, this.city}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? first_name; +@override final String? last_name; +@override final String? mobile; +@override final String? national_id; +@override final String? city; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.first_name, first_name) || other.first_name == first_name)&&(identical(other.last_name, last_name) || other.last_name == last_name)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.national_id, national_id) || other.national_id == national_id)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,first_name,last_name,mobile,national_id,city); + +@override +String toString() { + return 'User(fullname: $fullname, first_name: $first_name, last_name: $last_name, mobile: $mobile, national_id: $national_id, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? first_name, String? last_name, String? mobile, String? national_id, String? city +}); + + + + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? first_name = freezed,Object? last_name = freezed,Object? mobile = freezed,Object? national_id = freezed,Object? city = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,first_name: freezed == first_name ? _self.first_name : first_name // ignore: cast_nullable_to_non_nullable +as String?,last_name: freezed == last_name ? _self.last_name : last_name // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,national_id: freezed == national_id ? _self.national_id : national_id // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Address { + + Province? get province; City? get city; String? get address; String? get postal_code; +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressCopyWith
get copyWith => _$AddressCopyWithImpl
(this as Address, _$identity); + + /// Serializes this Address to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postal_code, postal_code) || other.postal_code == postal_code)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postal_code); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postal_code: $postal_code)'; +} + + +} + +/// @nodoc +abstract mixin class $AddressCopyWith<$Res> { + factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl; +@useResult +$Res call({ + Province? province, City? city, String? address, String? postal_code +}); + + +$ProvinceCopyWith<$Res>? get province;$CityCopyWith<$Res>? get city; + +} +/// @nodoc +class _$AddressCopyWithImpl<$Res> + implements $AddressCopyWith<$Res> { + _$AddressCopyWithImpl(this._self, this._then); + + final Address _self; + final $Res Function(Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postal_code = freezed,}) { + return _then(_self.copyWith( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postal_code: freezed == postal_code ? _self.postal_code : postal_code // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Address]. +extension AddressPatterns on Address { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Address value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Address value) $default,){ +final _that = this; +switch (_that) { +case _Address(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Address value)? $default,){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Province? province, City? city, String? address, String? postal_code)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postal_code);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Province? province, City? city, String? address, String? postal_code) $default,) {final _that = this; +switch (_that) { +case _Address(): +return $default(_that.province,_that.city,_that.address,_that.postal_code);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Province? province, City? city, String? address, String? postal_code)? $default,) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postal_code);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Address implements Address { + const _Address({this.province, this.city, this.address, this.postal_code}); + factory _Address.fromJson(Map json) => _$AddressFromJson(json); + +@override final Province? province; +@override final City? city; +@override final String? address; +@override final String? postal_code; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity); + +@override +Map toJson() { + return _$AddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postal_code, postal_code) || other.postal_code == postal_code)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postal_code); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postal_code: $postal_code)'; +} + + +} + +/// @nodoc +abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> { + factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl; +@override @useResult +$Res call({ + Province? province, City? city, String? address, String? postal_code +}); + + +@override $ProvinceCopyWith<$Res>? get province;@override $CityCopyWith<$Res>? get city; + +} +/// @nodoc +class __$AddressCopyWithImpl<$Res> + implements _$AddressCopyWith<$Res> { + __$AddressCopyWithImpl(this._self, this._then); + + final _Address _self; + final $Res Function(_Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postal_code = freezed,}) { + return _then(_Address( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postal_code: freezed == postal_code ? _self.postal_code : postal_code // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$Province { + + String? get key; String? get name; +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProvinceCopyWith get copyWith => _$ProvinceCopyWithImpl(this as Province, _$identity); + + /// Serializes this Province to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProvinceCopyWith<$Res> { + factory $ProvinceCopyWith(Province value, $Res Function(Province) _then) = _$ProvinceCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$ProvinceCopyWithImpl<$Res> + implements $ProvinceCopyWith<$Res> { + _$ProvinceCopyWithImpl(this._self, this._then); + + final Province _self; + final $Res Function(Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Province]. +extension ProvincePatterns on Province { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Province value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Province value) $default,){ +final _that = this; +switch (_that) { +case _Province(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Province value)? $default,){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _Province(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Province implements Province { + const _Province({this.key, this.name}); + factory _Province.fromJson(Map json) => _$ProvinceFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProvinceCopyWith<_Province> get copyWith => __$ProvinceCopyWithImpl<_Province>(this, _$identity); + +@override +Map toJson() { + return _$ProvinceToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProvinceCopyWith<$Res> implements $ProvinceCopyWith<$Res> { + factory _$ProvinceCopyWith(_Province value, $Res Function(_Province) _then) = __$ProvinceCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$ProvinceCopyWithImpl<$Res> + implements _$ProvinceCopyWith<$Res> { + __$ProvinceCopyWithImpl(this._self, this._then); + + final _Province _self; + final $Res Function(_Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_Province( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$City { + + String? get key; String? get name; +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityCopyWith get copyWith => _$CityCopyWithImpl(this as City, _$identity); + + /// Serializes this City to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is City&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'City(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $CityCopyWith<$Res> { + factory $CityCopyWith(City value, $Res Function(City) _then) = _$CityCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$CityCopyWithImpl<$Res> + implements $CityCopyWith<$Res> { + _$CityCopyWithImpl(this._self, this._then); + + final City _self; + final $Res Function(City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [City]. +extension CityPatterns on City { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _City value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _City value) $default,){ +final _that = this; +switch (_that) { +case _City(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _City value)? $default,){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _City(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _City implements City { + const _City({this.key, this.name}); + factory _City.fromJson(Map json) => _$CityFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CityCopyWith<_City> get copyWith => __$CityCopyWithImpl<_City>(this, _$identity); + +@override +Map toJson() { + return _$CityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _City&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'City(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$CityCopyWith<$Res> implements $CityCopyWith<$Res> { + factory _$CityCopyWith(_City value, $Res Function(_City) _then) = __$CityCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$CityCopyWithImpl<$Res> + implements _$CityCopyWith<$Res> { + __$CityCopyWithImpl(this._self, this._then); + + final _City _self; + final $Res Function(_City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_City( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$GuildAreaActivity { + + String? get key; String? get title; +/// Create a copy of GuildAreaActivity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GuildAreaActivityCopyWith get copyWith => _$GuildAreaActivityCopyWithImpl(this as GuildAreaActivity, _$identity); + + /// Serializes this GuildAreaActivity to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildAreaActivity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'GuildAreaActivity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class $GuildAreaActivityCopyWith<$Res> { + factory $GuildAreaActivityCopyWith(GuildAreaActivity value, $Res Function(GuildAreaActivity) _then) = _$GuildAreaActivityCopyWithImpl; +@useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class _$GuildAreaActivityCopyWithImpl<$Res> + implements $GuildAreaActivityCopyWith<$Res> { + _$GuildAreaActivityCopyWithImpl(this._self, this._then); + + final GuildAreaActivity _self; + final $Res Function(GuildAreaActivity) _then; + +/// Create a copy of GuildAreaActivity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GuildAreaActivity]. +extension GuildAreaActivityPatterns on GuildAreaActivity { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GuildAreaActivity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GuildAreaActivity() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GuildAreaActivity value) $default,){ +final _that = this; +switch (_that) { +case _GuildAreaActivity(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GuildAreaActivity value)? $default,){ +final _that = this; +switch (_that) { +case _GuildAreaActivity() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? title)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GuildAreaActivity() when $default != null: +return $default(_that.key,_that.title);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? title) $default,) {final _that = this; +switch (_that) { +case _GuildAreaActivity(): +return $default(_that.key,_that.title);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? title)? $default,) {final _that = this; +switch (_that) { +case _GuildAreaActivity() when $default != null: +return $default(_that.key,_that.title);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GuildAreaActivity implements GuildAreaActivity { + const _GuildAreaActivity({this.key, this.title}); + factory _GuildAreaActivity.fromJson(Map json) => _$GuildAreaActivityFromJson(json); + +@override final String? key; +@override final String? title; + +/// Create a copy of GuildAreaActivity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GuildAreaActivityCopyWith<_GuildAreaActivity> get copyWith => __$GuildAreaActivityCopyWithImpl<_GuildAreaActivity>(this, _$identity); + +@override +Map toJson() { + return _$GuildAreaActivityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildAreaActivity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'GuildAreaActivity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class _$GuildAreaActivityCopyWith<$Res> implements $GuildAreaActivityCopyWith<$Res> { + factory _$GuildAreaActivityCopyWith(_GuildAreaActivity value, $Res Function(_GuildAreaActivity) _then) = __$GuildAreaActivityCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class __$GuildAreaActivityCopyWithImpl<$Res> + implements _$GuildAreaActivityCopyWith<$Res> { + __$GuildAreaActivityCopyWithImpl(this._self, this._then); + + final _GuildAreaActivity _self; + final $Res Function(_GuildAreaActivity) _then; + +/// Create a copy of GuildAreaActivity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_GuildAreaActivity( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$GuildTypeActivity { + + String? get key; String? get title; +/// Create a copy of GuildTypeActivity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GuildTypeActivityCopyWith get copyWith => _$GuildTypeActivityCopyWithImpl(this as GuildTypeActivity, _$identity); + + /// Serializes this GuildTypeActivity to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildTypeActivity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'GuildTypeActivity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class $GuildTypeActivityCopyWith<$Res> { + factory $GuildTypeActivityCopyWith(GuildTypeActivity value, $Res Function(GuildTypeActivity) _then) = _$GuildTypeActivityCopyWithImpl; +@useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class _$GuildTypeActivityCopyWithImpl<$Res> + implements $GuildTypeActivityCopyWith<$Res> { + _$GuildTypeActivityCopyWithImpl(this._self, this._then); + + final GuildTypeActivity _self; + final $Res Function(GuildTypeActivity) _then; + +/// Create a copy of GuildTypeActivity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GuildTypeActivity]. +extension GuildTypeActivityPatterns on GuildTypeActivity { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GuildTypeActivity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GuildTypeActivity() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GuildTypeActivity value) $default,){ +final _that = this; +switch (_that) { +case _GuildTypeActivity(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GuildTypeActivity value)? $default,){ +final _that = this; +switch (_that) { +case _GuildTypeActivity() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? title)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GuildTypeActivity() when $default != null: +return $default(_that.key,_that.title);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? title) $default,) {final _that = this; +switch (_that) { +case _GuildTypeActivity(): +return $default(_that.key,_that.title);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? title)? $default,) {final _that = this; +switch (_that) { +case _GuildTypeActivity() when $default != null: +return $default(_that.key,_that.title);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GuildTypeActivity implements GuildTypeActivity { + const _GuildTypeActivity({this.key, this.title}); + factory _GuildTypeActivity.fromJson(Map json) => _$GuildTypeActivityFromJson(json); + +@override final String? key; +@override final String? title; + +/// Create a copy of GuildTypeActivity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GuildTypeActivityCopyWith<_GuildTypeActivity> get copyWith => __$GuildTypeActivityCopyWithImpl<_GuildTypeActivity>(this, _$identity); + +@override +Map toJson() { + return _$GuildTypeActivityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildTypeActivity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'GuildTypeActivity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class _$GuildTypeActivityCopyWith<$Res> implements $GuildTypeActivityCopyWith<$Res> { + factory _$GuildTypeActivityCopyWith(_GuildTypeActivity value, $Res Function(_GuildTypeActivity) _then) = __$GuildTypeActivityCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class __$GuildTypeActivityCopyWithImpl<$Res> + implements _$GuildTypeActivityCopyWith<$Res> { + __$GuildTypeActivityCopyWithImpl(this._self, this._then); + + final _GuildTypeActivity _self; + final $Res Function(_GuildTypeActivity) _then; + +/// Create a copy of GuildTypeActivity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_GuildTypeActivity( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$GetPosStatus { + + int? get len_active_sessions; bool? get has_pons; bool? get has_active_pons; +/// Create a copy of GetPosStatus +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GetPosStatusCopyWith get copyWith => _$GetPosStatusCopyWithImpl(this as GetPosStatus, _$identity); + + /// Serializes this GetPosStatus to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetPosStatus&&(identical(other.len_active_sessions, len_active_sessions) || other.len_active_sessions == len_active_sessions)&&(identical(other.has_pons, has_pons) || other.has_pons == has_pons)&&(identical(other.has_active_pons, has_active_pons) || other.has_active_pons == has_active_pons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,len_active_sessions,has_pons,has_active_pons); + +@override +String toString() { + return 'GetPosStatus(len_active_sessions: $len_active_sessions, has_pons: $has_pons, has_active_pons: $has_active_pons)'; +} + + +} + +/// @nodoc +abstract mixin class $GetPosStatusCopyWith<$Res> { + factory $GetPosStatusCopyWith(GetPosStatus value, $Res Function(GetPosStatus) _then) = _$GetPosStatusCopyWithImpl; +@useResult +$Res call({ + int? len_active_sessions, bool? has_pons, bool? has_active_pons +}); + + + + +} +/// @nodoc +class _$GetPosStatusCopyWithImpl<$Res> + implements $GetPosStatusCopyWith<$Res> { + _$GetPosStatusCopyWithImpl(this._self, this._then); + + final GetPosStatus _self; + final $Res Function(GetPosStatus) _then; + +/// Create a copy of GetPosStatus +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? len_active_sessions = freezed,Object? has_pons = freezed,Object? has_active_pons = freezed,}) { + return _then(_self.copyWith( +len_active_sessions: freezed == len_active_sessions ? _self.len_active_sessions : len_active_sessions // ignore: cast_nullable_to_non_nullable +as int?,has_pons: freezed == has_pons ? _self.has_pons : has_pons // ignore: cast_nullable_to_non_nullable +as bool?,has_active_pons: freezed == has_active_pons ? _self.has_active_pons : has_active_pons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GetPosStatus]. +extension GetPosStatusPatterns on GetPosStatus { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GetPosStatus value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GetPosStatus() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GetPosStatus value) $default,){ +final _that = this; +switch (_that) { +case _GetPosStatus(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GetPosStatus value)? $default,){ +final _that = this; +switch (_that) { +case _GetPosStatus() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? len_active_sessions, bool? has_pons, bool? has_active_pons)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GetPosStatus() when $default != null: +return $default(_that.len_active_sessions,_that.has_pons,_that.has_active_pons);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? len_active_sessions, bool? has_pons, bool? has_active_pons) $default,) {final _that = this; +switch (_that) { +case _GetPosStatus(): +return $default(_that.len_active_sessions,_that.has_pons,_that.has_active_pons);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? len_active_sessions, bool? has_pons, bool? has_active_pons)? $default,) {final _that = this; +switch (_that) { +case _GetPosStatus() when $default != null: +return $default(_that.len_active_sessions,_that.has_pons,_that.has_active_pons);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GetPosStatus implements GetPosStatus { + const _GetPosStatus({this.len_active_sessions, this.has_pons, this.has_active_pons}); + factory _GetPosStatus.fromJson(Map json) => _$GetPosStatusFromJson(json); + +@override final int? len_active_sessions; +@override final bool? has_pons; +@override final bool? has_active_pons; + +/// Create a copy of GetPosStatus +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GetPosStatusCopyWith<_GetPosStatus> get copyWith => __$GetPosStatusCopyWithImpl<_GetPosStatus>(this, _$identity); + +@override +Map toJson() { + return _$GetPosStatusToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetPosStatus&&(identical(other.len_active_sessions, len_active_sessions) || other.len_active_sessions == len_active_sessions)&&(identical(other.has_pons, has_pons) || other.has_pons == has_pons)&&(identical(other.has_active_pons, has_active_pons) || other.has_active_pons == has_active_pons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,len_active_sessions,has_pons,has_active_pons); + +@override +String toString() { + return 'GetPosStatus(len_active_sessions: $len_active_sessions, has_pons: $has_pons, has_active_pons: $has_active_pons)'; +} + + +} + +/// @nodoc +abstract mixin class _$GetPosStatusCopyWith<$Res> implements $GetPosStatusCopyWith<$Res> { + factory _$GetPosStatusCopyWith(_GetPosStatus value, $Res Function(_GetPosStatus) _then) = __$GetPosStatusCopyWithImpl; +@override @useResult +$Res call({ + int? len_active_sessions, bool? has_pons, bool? has_active_pons +}); + + + + +} +/// @nodoc +class __$GetPosStatusCopyWithImpl<$Res> + implements _$GetPosStatusCopyWith<$Res> { + __$GetPosStatusCopyWithImpl(this._self, this._then); + + final _GetPosStatus _self; + final $Res Function(_GetPosStatus) _then; + +/// Create a copy of GetPosStatus +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? len_active_sessions = freezed,Object? has_pons = freezed,Object? has_active_pons = freezed,}) { + return _then(_GetPosStatus( +len_active_sessions: freezed == len_active_sessions ? _self.len_active_sessions : len_active_sessions // ignore: cast_nullable_to_non_nullable +as int?,has_pons: freezed == has_pons ? _self.has_pons : has_pons // ignore: cast_nullable_to_non_nullable +as bool?,has_active_pons: freezed == has_active_pons ? _self.has_active_pons : has_active_pons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/guild_profile/guild_profile.g.dart b/packages/chicken/lib/data/models/response/guild_profile/guild_profile.g.dart new file mode 100644 index 0000000..98edd02 --- /dev/null +++ b/packages/chicken/lib/data/models/response/guild_profile/guild_profile.g.dart @@ -0,0 +1,244 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'guild_profile.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_GuildProfile _$GuildProfileFromJson( + Map json, +) => _GuildProfile( + id: (json['id'] as num?)?.toInt(), + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + guild_area_activity: json['guild_area_activity'] == null + ? null + : GuildAreaActivity.fromJson( + json['guild_area_activity'] as Map, + ), + guild_type_activity: json['guild_type_activity'] == null + ? null + : GuildTypeActivity.fromJson( + json['guild_type_activity'] as Map, + ), + kill_house: json['kill_house'] as List?, + steward_kill_house: json['steward_kill_house'] as List?, + stewards: json['stewards'] as List?, + get_pos_status: json['get_pos_status'] == null + ? null + : GetPosStatus.fromJson(json['get_pos_status'] as Map), + key: json['key'] as String?, + create_date: json['create_date'] as String?, + modify_date: json['modify_date'] as String?, + trash: json['trash'] as bool?, + user_id_foreign_key: json['user_id_foreign_key'] as String?, + address_id_foreign_key: json['address_id_foreign_key'] as String?, + user_bank_id_foreign_key: json['user_bank_id_foreign_key'] as String?, + wallet_id_foreign_key: json['wallet_id_foreign_key'] as String?, + provincial_government_id_key: json['provincial_government_id_key'] as String?, + identity_documents: json['identity_documents'], + active: json['active'] as bool?, + city_number: (json['city_number'] as num?)?.toInt(), + city_name: json['city_name'] as String?, + guilds_id: json['guilds_id'] as String?, + license_number: json['license_number'] as String?, + guilds_name: json['guilds_name'] as String?, + phone: json['phone'] as String?, + type_activity: json['type_activity'] as String?, + area_activity: json['area_activity'] as String?, + province_number: (json['province_number'] as num?)?.toInt(), + province_name: json['province_name'] as String?, + steward: json['steward'] as bool?, + has_pos: json['has_pos'] as bool?, + centers_allocation: json['centers_allocation'], + kill_house_centers_allocation: json['kill_house_centers_allocation'], + allocation_limit: json['allocation_limit'], + limitation_allocation: json['limitation_allocation'] as bool?, + registerar_role: json['registerar_role'] as String?, + registerar_fullname: json['registerar_fullname'] as String?, + registerar_mobile: json['registerar_mobile'] as String?, + kill_house_register: json['kill_house_register'] as bool?, + steward_register: json['steward_register'] as bool?, + guilds_room_register: json['guilds_room_register'] as bool?, + pos_company_register: json['pos_company_register'] as bool?, + province_accept_state: json['province_accept_state'] as String?, + province_message: json['province_message'] as String?, + condition: json['condition'] as String?, + description_condition: json['description_condition'] as String?, + steward_active: json['steward_active'] as bool?, + steward_allocation_limit: json['steward_allocation_limit'], + steward_limitation_allocation: json['steward_limitation_allocation'] as bool?, + license: json['license'] as bool?, + license_form: json['license_form'], + license_file: json['license_file'], + reviewer_role: json['reviewer_role'] as String?, + reviewer_fullname: json['reviewer_fullname'] as String?, + reviewer_mobile: json['reviewer_mobile'] as String?, + checker_message: json['checker_message'] as String?, + final_accept: json['final_accept'] as bool?, + temporary_registration: json['temporary_registration'] as bool?, + created_by: json['created_by'] as String?, + modified_by: json['modified_by'] as String?, + user_bank_info: json['user_bank_info'], + wallet: (json['wallet'] as num?)?.toInt(), + cars: json['cars'] as List?, + user_level: json['user_level'] as List?, +); + +Map _$GuildProfileToJson(_GuildProfile instance) => + { + 'id': instance.id, + 'user': instance.user, + 'address': instance.address, + 'guild_area_activity': instance.guild_area_activity, + 'guild_type_activity': instance.guild_type_activity, + 'kill_house': instance.kill_house, + 'steward_kill_house': instance.steward_kill_house, + 'stewards': instance.stewards, + 'get_pos_status': instance.get_pos_status, + 'key': instance.key, + 'create_date': instance.create_date, + 'modify_date': instance.modify_date, + 'trash': instance.trash, + 'user_id_foreign_key': instance.user_id_foreign_key, + 'address_id_foreign_key': instance.address_id_foreign_key, + 'user_bank_id_foreign_key': instance.user_bank_id_foreign_key, + 'wallet_id_foreign_key': instance.wallet_id_foreign_key, + 'provincial_government_id_key': instance.provincial_government_id_key, + 'identity_documents': instance.identity_documents, + 'active': instance.active, + 'city_number': instance.city_number, + 'city_name': instance.city_name, + 'guilds_id': instance.guilds_id, + 'license_number': instance.license_number, + 'guilds_name': instance.guilds_name, + 'phone': instance.phone, + 'type_activity': instance.type_activity, + 'area_activity': instance.area_activity, + 'province_number': instance.province_number, + 'province_name': instance.province_name, + 'steward': instance.steward, + 'has_pos': instance.has_pos, + 'centers_allocation': instance.centers_allocation, + 'kill_house_centers_allocation': instance.kill_house_centers_allocation, + 'allocation_limit': instance.allocation_limit, + 'limitation_allocation': instance.limitation_allocation, + 'registerar_role': instance.registerar_role, + 'registerar_fullname': instance.registerar_fullname, + 'registerar_mobile': instance.registerar_mobile, + 'kill_house_register': instance.kill_house_register, + 'steward_register': instance.steward_register, + 'guilds_room_register': instance.guilds_room_register, + 'pos_company_register': instance.pos_company_register, + 'province_accept_state': instance.province_accept_state, + 'province_message': instance.province_message, + 'condition': instance.condition, + 'description_condition': instance.description_condition, + 'steward_active': instance.steward_active, + 'steward_allocation_limit': instance.steward_allocation_limit, + 'steward_limitation_allocation': instance.steward_limitation_allocation, + 'license': instance.license, + 'license_form': instance.license_form, + 'license_file': instance.license_file, + 'reviewer_role': instance.reviewer_role, + 'reviewer_fullname': instance.reviewer_fullname, + 'reviewer_mobile': instance.reviewer_mobile, + 'checker_message': instance.checker_message, + 'final_accept': instance.final_accept, + 'temporary_registration': instance.temporary_registration, + 'created_by': instance.created_by, + 'modified_by': instance.modified_by, + 'user_bank_info': instance.user_bank_info, + 'wallet': instance.wallet, + 'cars': instance.cars, + 'user_level': instance.user_level, + }; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + first_name: json['first_name'] as String?, + last_name: json['last_name'] as String?, + mobile: json['mobile'] as String?, + national_id: json['national_id'] as String?, + city: json['city'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'first_name': instance.first_name, + 'last_name': instance.last_name, + 'mobile': instance.mobile, + 'national_id': instance.national_id, + 'city': instance.city, +}; + +_Address _$AddressFromJson(Map json) => _Address( + province: json['province'] == null + ? null + : Province.fromJson(json['province'] as Map), + city: json['city'] == null + ? null + : City.fromJson(json['city'] as Map), + address: json['address'] as String?, + postal_code: json['postal_code'] as String?, +); + +Map _$AddressToJson(_Address instance) => { + 'province': instance.province, + 'city': instance.city, + 'address': instance.address, + 'postal_code': instance.postal_code, +}; + +_Province _$ProvinceFromJson(Map json) => + _Province(key: json['key'] as String?, name: json['name'] as String?); + +Map _$ProvinceToJson(_Province instance) => { + 'key': instance.key, + 'name': instance.name, +}; + +_City _$CityFromJson(Map json) => + _City(key: json['key'] as String?, name: json['name'] as String?); + +Map _$CityToJson(_City instance) => { + 'key': instance.key, + 'name': instance.name, +}; + +_GuildAreaActivity _$GuildAreaActivityFromJson(Map json) => + _GuildAreaActivity( + key: json['key'] as String?, + title: json['title'] as String?, + ); + +Map _$GuildAreaActivityToJson(_GuildAreaActivity instance) => + {'key': instance.key, 'title': instance.title}; + +_GuildTypeActivity _$GuildTypeActivityFromJson(Map json) => + _GuildTypeActivity( + key: json['key'] as String?, + title: json['title'] as String?, + ); + +Map _$GuildTypeActivityToJson(_GuildTypeActivity instance) => + {'key': instance.key, 'title': instance.title}; + +_GetPosStatus _$GetPosStatusFromJson(Map json) => + _GetPosStatus( + len_active_sessions: (json['len_active_sessions'] as num?)?.toInt(), + has_pons: json['has_pons'] as bool?, + has_active_pons: json['has_active_pons'] as bool?, + ); + +Map _$GetPosStatusToJson(_GetPosStatus instance) => + { + 'len_active_sessions': instance.len_active_sessions, + 'has_pons': instance.has_pons, + 'has_active_pons': instance.has_active_pons, + }; diff --git a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart new file mode 100644 index 0000000..17c6f77 --- /dev/null +++ b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart @@ -0,0 +1,298 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'imported_loads_model.freezed.dart'; +part 'imported_loads_model.g.dart'; + +@freezed +abstract class ImportedLoadsModel with _$ImportedLoadsModel { + const factory ImportedLoadsModel({ + int? id, + Product? product, + KillHouse? killHouse, + dynamic toKillHouse, + dynamic steward, + ToSteward? toSteward, + dynamic guilds, + dynamic toGuilds, + dynamic toColdHouse, + int? indexWeight, + int? dateTimestamp, + int? newState, + int? newReceiverState, + int? newAllocationState, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + int? numberOfCarcasses, + int? realNumberOfCarcasses, + int? receiverRealNumberOfCarcasses, + double? weightOfCarcasses, + double? realWeightOfCarcasses, + double? receiverRealWeightOfCarcasses, + double? weightLossOfCarcasses, + bool? finalRegistration, + String? sellType, + String? productName, + String? sellerType, + String? type, + String? saleType, + String? allocationType, + bool? systemRegistrationCode, + int? registrationCode, + int? amount, + int? totalAmount, + int? totalAmountPaid, + int? totalAmountRemain, + dynamic loggedRegistrationCode, + String? state, + String? receiverState, + String? allocationState, + String? date, + dynamic role, + dynamic stewardTempKey, + bool? approvedPriceStatus, + bool? calculateStatus, + bool? temporaryTrash, + bool? temporaryDeleted, + dynamic createdBy, + dynamic modifiedBy, + dynamic wareHouse, + dynamic stewardWareHouse, + dynamic car, + dynamic dispenser, + }) = _ImportedLoadsModel; + + factory ImportedLoadsModel.fromJson(Map json) => + _$ImportedLoadsModelFromJson(json); +} + +@freezed +abstract class Product with _$Product { + const factory Product({ + double? weightAverage, + }) = _Product; + + factory Product.fromJson(Map json) => + _$ProductFromJson(json); +} + +@freezed +abstract class KillHouse with _$KillHouse { + const factory KillHouse({ + String? key, + KillHouseOperator? killHouseOperator, + String? name, + bool? killer, + }) = _KillHouse; + + factory KillHouse.fromJson(Map json) => + _$KillHouseFromJson(json); +} + +@freezed +abstract class KillHouseOperator with _$KillHouseOperator { + const factory KillHouseOperator({ + User? user, + }) = _KillHouseOperator; + + factory KillHouseOperator.fromJson(Map json) => + _$KillHouseOperatorFromJson(json); +} + +@freezed +abstract class User with _$User { + const factory User({ + String? fullname, + String? firstName, + String? lastName, + int? baseOrder, + String? mobile, + String? nationalId, + String? nationalCode, + String? key, + City? city, + String? unitName, + String? unitNationalId, + String? unitRegistrationNumber, + String? unitEconomicalNumber, + String? unitProvince, + String? unitCity, + String? unitPostalCode, + String? unitAddress, + }) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} + +@freezed +abstract class City with _$City { + const factory City({ + int? id, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + int? provinceIdForeignKey, + int? cityIdKey, + String? name, + double? productPrice, + bool? provinceCenter, + int? cityNumber, + String? cityName, + int? provinceNumber, + String? provinceName, + dynamic createdBy, + dynamic modifiedBy, + int? province, + }) = _City; + + factory City.fromJson(Map json) => _$CityFromJson(json); +} + +@freezed +abstract class ToSteward with _$ToSteward { + const factory ToSteward({ + int? id, + ToStewardUser? user, + Address? address, + Activity? guildAreaActivity, + Activity? guildTypeActivity, + List? killHouse, + List? stewardKillHouse, + List? stewards, + PosStatus? getPosStatus, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + dynamic userIdForeignKey, + dynamic addressIdForeignKey, + dynamic userBankIdForeignKey, + dynamic walletIdForeignKey, + dynamic provincialGovernmentIdKey, + dynamic identityDocuments, + bool? active, + int? cityNumber, + String? cityName, + String? guildsId, + String? licenseNumber, + String? guildsName, + dynamic phone, + String? typeActivity, + String? areaActivity, + int? provinceNumber, + String? provinceName, + bool? steward, + bool? hasPos, + dynamic centersAllocation, + dynamic killHouseCentersAllocation, + dynamic allocationLimit, + bool? limitationAllocation, + dynamic registerarRole, + dynamic registerarFullname, + dynamic registerarMobile, + bool? killHouseRegister, + bool? stewardRegister, + bool? guildsRoomRegister, + bool? posCompanyRegister, + String? provinceAcceptState, + dynamic provinceMessage, + dynamic condition, + dynamic descriptionCondition, + bool? stewardActive, + dynamic stewardAllocationLimit, + bool? stewardLimitationAllocation, + bool? license, + dynamic licenseForm, + dynamic licenseFile, + dynamic reviewerRole, + dynamic reviewerFullname, + dynamic reviewerMobile, + dynamic checkerMessage, + bool? finalAccept, + bool? temporaryRegistration, + dynamic createdBy, + dynamic modifiedBy, + dynamic userBankInfo, + int? wallet, + List? cars, + List? userLevel, + }) = _ToSteward; + + factory ToSteward.fromJson(Map json) => + _$ToStewardFromJson(json); +} + +@freezed +abstract class ToStewardUser with _$ToStewardUser { + const factory ToStewardUser({ + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? nationalId, + String? city, + }) = _ToStewardUser; + + factory ToStewardUser.fromJson(Map json) => + _$ToStewardUserFromJson(json); +} + +@freezed +abstract class Address with _$Address { + const factory Address({ + Province? province, + CitySimple? city, + String? address, + String? postalCode, + }) = _Address; + + factory Address.fromJson(Map json) => + _$AddressFromJson(json); +} + +@freezed +abstract class Province with _$Province { + const factory Province({ + String? key, + String? name, + }) = _Province; + + factory Province.fromJson(Map json) => + _$ProvinceFromJson(json); +} + +@freezed +abstract class CitySimple with _$CitySimple { + const factory CitySimple({ + String? key, + String? name, + }) = _CitySimple; + + factory CitySimple.fromJson(Map json) => + _$CitySimpleFromJson(json); +} + +@freezed +abstract class Activity with _$Activity { + const factory Activity({ + String? key, + String? title, + }) = _Activity; + + factory Activity.fromJson(Map json) => + _$ActivityFromJson(json); +} + +@freezed +abstract class PosStatus with _$PosStatus { + const factory PosStatus({ + int? lenActiveSessions, + bool? hasPons, + bool? hasActivePons, + }) = _PosStatus; + + factory PosStatus.fromJson(Map json) => + _$PosStatusFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart new file mode 100644 index 0000000..296834a --- /dev/null +++ b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart @@ -0,0 +1,4283 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'imported_loads_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$ImportedLoadsModel { + + int? get id; Product? get product; KillHouse? get killHouse; dynamic get toKillHouse; dynamic get steward; ToSteward? get toSteward; dynamic get guilds; dynamic get toGuilds; dynamic get toColdHouse; int? get indexWeight; int? get dateTimestamp; int? get newState; int? get newReceiverState; int? get newAllocationState; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get numberOfCarcasses; int? get realNumberOfCarcasses; int? get receiverRealNumberOfCarcasses; double? get weightOfCarcasses; double? get realWeightOfCarcasses; double? get receiverRealWeightOfCarcasses; double? get weightLossOfCarcasses; bool? get finalRegistration; String? get sellType; String? get productName; String? get sellerType; String? get type; String? get saleType; String? get allocationType; bool? get systemRegistrationCode; int? get registrationCode; int? get amount; int? get totalAmount; int? get totalAmountPaid; int? get totalAmountRemain; dynamic get loggedRegistrationCode; String? get state; String? get receiverState; String? get allocationState; String? get date; dynamic get role; dynamic get stewardTempKey; bool? get approvedPriceStatus; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; dynamic get createdBy; dynamic get modifiedBy; dynamic get wareHouse; dynamic get stewardWareHouse; dynamic get car; dynamic get dispenser; +/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ImportedLoadsModelCopyWith get copyWith => _$ImportedLoadsModelCopyWithImpl(this as ImportedLoadsModel, _$identity); + + /// Serializes this ImportedLoadsModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ImportedLoadsModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&const DeepCollectionEquality().equals(other.steward, steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,product,killHouse,const DeepCollectionEquality().hash(toKillHouse),const DeepCollectionEquality().hash(steward),toSteward,const DeepCollectionEquality().hash(guilds),const DeepCollectionEquality().hash(toGuilds),const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,const DeepCollectionEquality().hash(loggedRegistrationCode),state,receiverState,allocationState,date,const DeepCollectionEquality().hash(role),const DeepCollectionEquality().hash(stewardTempKey),approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); + +@override +String toString() { + return 'ImportedLoadsModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; +} + + +} + +/// @nodoc +abstract mixin class $ImportedLoadsModelCopyWith<$Res> { + factory $ImportedLoadsModelCopyWith(ImportedLoadsModel value, $Res Function(ImportedLoadsModel) _then) = _$ImportedLoadsModelCopyWithImpl; +@useResult +$Res call({ + int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser +}); + + +$ProductCopyWith<$Res>? get product;$KillHouseCopyWith<$Res>? get killHouse;$ToStewardCopyWith<$Res>? get toSteward; + +} +/// @nodoc +class _$ImportedLoadsModelCopyWithImpl<$Res> + implements $ImportedLoadsModelCopyWith<$Res> { + _$ImportedLoadsModelCopyWithImpl(this._self, this._then); + + final ImportedLoadsModel _self; + final $Res Function(ImportedLoadsModel) _then; + +/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as Product?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as KillHouse?,toKillHouse: freezed == toKillHouse ? _self.toKillHouse : toKillHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as dynamic,toSteward: freezed == toSteward ? _self.toSteward : toSteward // ignore: cast_nullable_to_non_nullable +as ToSteward?,guilds: freezed == guilds ? _self.guilds : guilds // ignore: cast_nullable_to_non_nullable +as dynamic,toGuilds: freezed == toGuilds ? _self.toGuilds : toGuilds // ignore: cast_nullable_to_non_nullable +as dynamic,toColdHouse: freezed == toColdHouse ? _self.toColdHouse : toColdHouse // ignore: cast_nullable_to_non_nullable +as dynamic,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as int?,dateTimestamp: freezed == dateTimestamp ? _self.dateTimestamp : dateTimestamp // ignore: cast_nullable_to_non_nullable +as int?,newState: freezed == newState ? _self.newState : newState // ignore: cast_nullable_to_non_nullable +as int?,newReceiverState: freezed == newReceiverState ? _self.newReceiverState : newReceiverState // ignore: cast_nullable_to_non_nullable +as int?,newAllocationState: freezed == newAllocationState ? _self.newAllocationState : newAllocationState // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realNumberOfCarcasses: freezed == realNumberOfCarcasses ? _self.realNumberOfCarcasses : realNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,realWeightOfCarcasses: freezed == realWeightOfCarcasses ? _self.realWeightOfCarcasses : realWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,finalRegistration: freezed == finalRegistration ? _self.finalRegistration : finalRegistration // ignore: cast_nullable_to_non_nullable +as bool?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,productName: freezed == productName ? _self.productName : productName // ignore: cast_nullable_to_non_nullable +as String?,sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,saleType: freezed == saleType ? _self.saleType : saleType // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,systemRegistrationCode: freezed == systemRegistrationCode ? _self.systemRegistrationCode : systemRegistrationCode // ignore: cast_nullable_to_non_nullable +as bool?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,totalAmountPaid: freezed == totalAmountPaid ? _self.totalAmountPaid : totalAmountPaid // ignore: cast_nullable_to_non_nullable +as int?,totalAmountRemain: freezed == totalAmountRemain ? _self.totalAmountRemain : totalAmountRemain // ignore: cast_nullable_to_non_nullable +as int?,loggedRegistrationCode: freezed == loggedRegistrationCode ? _self.loggedRegistrationCode : loggedRegistrationCode // ignore: cast_nullable_to_non_nullable +as dynamic,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,receiverState: freezed == receiverState ? _self.receiverState : receiverState // ignore: cast_nullable_to_non_nullable +as String?,allocationState: freezed == allocationState ? _self.allocationState : allocationState // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as dynamic,stewardTempKey: freezed == stewardTempKey ? _self.stewardTempKey : stewardTempKey // ignore: cast_nullable_to_non_nullable +as dynamic,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,stewardWareHouse: freezed == stewardWareHouse ? _self.stewardWareHouse : stewardWareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} +/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +}/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseCopyWith<$Res>? get killHouse { + if (_self.killHouse == null) { + return null; + } + + return $KillHouseCopyWith<$Res>(_self.killHouse!, (value) { + return _then(_self.copyWith(killHouse: value)); + }); +}/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ToStewardCopyWith<$Res>? get toSteward { + if (_self.toSteward == null) { + return null; + } + + return $ToStewardCopyWith<$Res>(_self.toSteward!, (value) { + return _then(_self.copyWith(toSteward: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ImportedLoadsModel]. +extension ImportedLoadsModelPatterns on ImportedLoadsModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ImportedLoadsModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ImportedLoadsModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ImportedLoadsModel value) $default,){ +final _that = this; +switch (_that) { +case _ImportedLoadsModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ImportedLoadsModel value)? $default,){ +final _that = this; +switch (_that) { +case _ImportedLoadsModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ImportedLoadsModel() when $default != null: +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser) $default,) {final _that = this; +switch (_that) { +case _ImportedLoadsModel(): +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser)? $default,) {final _that = this; +switch (_that) { +case _ImportedLoadsModel() when $default != null: +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ImportedLoadsModel implements ImportedLoadsModel { + const _ImportedLoadsModel({this.id, this.product, this.killHouse, this.toKillHouse, this.steward, this.toSteward, this.guilds, this.toGuilds, this.toColdHouse, this.indexWeight, this.dateTimestamp, this.newState, this.newReceiverState, this.newAllocationState, this.key, this.createDate, this.modifyDate, this.trash, this.numberOfCarcasses, this.realNumberOfCarcasses, this.receiverRealNumberOfCarcasses, this.weightOfCarcasses, this.realWeightOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses, this.finalRegistration, this.sellType, this.productName, this.sellerType, this.type, this.saleType, this.allocationType, this.systemRegistrationCode, this.registrationCode, this.amount, this.totalAmount, this.totalAmountPaid, this.totalAmountRemain, this.loggedRegistrationCode, this.state, this.receiverState, this.allocationState, this.date, this.role, this.stewardTempKey, this.approvedPriceStatus, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy, this.wareHouse, this.stewardWareHouse, this.car, this.dispenser}); + factory _ImportedLoadsModel.fromJson(Map json) => _$ImportedLoadsModelFromJson(json); + +@override final int? id; +@override final Product? product; +@override final KillHouse? killHouse; +@override final dynamic toKillHouse; +@override final dynamic steward; +@override final ToSteward? toSteward; +@override final dynamic guilds; +@override final dynamic toGuilds; +@override final dynamic toColdHouse; +@override final int? indexWeight; +@override final int? dateTimestamp; +@override final int? newState; +@override final int? newReceiverState; +@override final int? newAllocationState; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final int? numberOfCarcasses; +@override final int? realNumberOfCarcasses; +@override final int? receiverRealNumberOfCarcasses; +@override final double? weightOfCarcasses; +@override final double? realWeightOfCarcasses; +@override final double? receiverRealWeightOfCarcasses; +@override final double? weightLossOfCarcasses; +@override final bool? finalRegistration; +@override final String? sellType; +@override final String? productName; +@override final String? sellerType; +@override final String? type; +@override final String? saleType; +@override final String? allocationType; +@override final bool? systemRegistrationCode; +@override final int? registrationCode; +@override final int? amount; +@override final int? totalAmount; +@override final int? totalAmountPaid; +@override final int? totalAmountRemain; +@override final dynamic loggedRegistrationCode; +@override final String? state; +@override final String? receiverState; +@override final String? allocationState; +@override final String? date; +@override final dynamic role; +@override final dynamic stewardTempKey; +@override final bool? approvedPriceStatus; +@override final bool? calculateStatus; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final dynamic wareHouse; +@override final dynamic stewardWareHouse; +@override final dynamic car; +@override final dynamic dispenser; + +/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ImportedLoadsModelCopyWith<_ImportedLoadsModel> get copyWith => __$ImportedLoadsModelCopyWithImpl<_ImportedLoadsModel>(this, _$identity); + +@override +Map toJson() { + return _$ImportedLoadsModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ImportedLoadsModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&const DeepCollectionEquality().equals(other.steward, steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,product,killHouse,const DeepCollectionEquality().hash(toKillHouse),const DeepCollectionEquality().hash(steward),toSteward,const DeepCollectionEquality().hash(guilds),const DeepCollectionEquality().hash(toGuilds),const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,const DeepCollectionEquality().hash(loggedRegistrationCode),state,receiverState,allocationState,date,const DeepCollectionEquality().hash(role),const DeepCollectionEquality().hash(stewardTempKey),approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); + +@override +String toString() { + return 'ImportedLoadsModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; +} + + +} + +/// @nodoc +abstract mixin class _$ImportedLoadsModelCopyWith<$Res> implements $ImportedLoadsModelCopyWith<$Res> { + factory _$ImportedLoadsModelCopyWith(_ImportedLoadsModel value, $Res Function(_ImportedLoadsModel) _then) = __$ImportedLoadsModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser +}); + + +@override $ProductCopyWith<$Res>? get product;@override $KillHouseCopyWith<$Res>? get killHouse;@override $ToStewardCopyWith<$Res>? get toSteward; + +} +/// @nodoc +class __$ImportedLoadsModelCopyWithImpl<$Res> + implements _$ImportedLoadsModelCopyWith<$Res> { + __$ImportedLoadsModelCopyWithImpl(this._self, this._then); + + final _ImportedLoadsModel _self; + final $Res Function(_ImportedLoadsModel) _then; + +/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { + return _then(_ImportedLoadsModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as Product?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as KillHouse?,toKillHouse: freezed == toKillHouse ? _self.toKillHouse : toKillHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as dynamic,toSteward: freezed == toSteward ? _self.toSteward : toSteward // ignore: cast_nullable_to_non_nullable +as ToSteward?,guilds: freezed == guilds ? _self.guilds : guilds // ignore: cast_nullable_to_non_nullable +as dynamic,toGuilds: freezed == toGuilds ? _self.toGuilds : toGuilds // ignore: cast_nullable_to_non_nullable +as dynamic,toColdHouse: freezed == toColdHouse ? _self.toColdHouse : toColdHouse // ignore: cast_nullable_to_non_nullable +as dynamic,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as int?,dateTimestamp: freezed == dateTimestamp ? _self.dateTimestamp : dateTimestamp // ignore: cast_nullable_to_non_nullable +as int?,newState: freezed == newState ? _self.newState : newState // ignore: cast_nullable_to_non_nullable +as int?,newReceiverState: freezed == newReceiverState ? _self.newReceiverState : newReceiverState // ignore: cast_nullable_to_non_nullable +as int?,newAllocationState: freezed == newAllocationState ? _self.newAllocationState : newAllocationState // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realNumberOfCarcasses: freezed == realNumberOfCarcasses ? _self.realNumberOfCarcasses : realNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,realWeightOfCarcasses: freezed == realWeightOfCarcasses ? _self.realWeightOfCarcasses : realWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,finalRegistration: freezed == finalRegistration ? _self.finalRegistration : finalRegistration // ignore: cast_nullable_to_non_nullable +as bool?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,productName: freezed == productName ? _self.productName : productName // ignore: cast_nullable_to_non_nullable +as String?,sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,saleType: freezed == saleType ? _self.saleType : saleType // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,systemRegistrationCode: freezed == systemRegistrationCode ? _self.systemRegistrationCode : systemRegistrationCode // ignore: cast_nullable_to_non_nullable +as bool?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,totalAmountPaid: freezed == totalAmountPaid ? _self.totalAmountPaid : totalAmountPaid // ignore: cast_nullable_to_non_nullable +as int?,totalAmountRemain: freezed == totalAmountRemain ? _self.totalAmountRemain : totalAmountRemain // ignore: cast_nullable_to_non_nullable +as int?,loggedRegistrationCode: freezed == loggedRegistrationCode ? _self.loggedRegistrationCode : loggedRegistrationCode // ignore: cast_nullable_to_non_nullable +as dynamic,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,receiverState: freezed == receiverState ? _self.receiverState : receiverState // ignore: cast_nullable_to_non_nullable +as String?,allocationState: freezed == allocationState ? _self.allocationState : allocationState // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as dynamic,stewardTempKey: freezed == stewardTempKey ? _self.stewardTempKey : stewardTempKey // ignore: cast_nullable_to_non_nullable +as dynamic,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,stewardWareHouse: freezed == stewardWareHouse ? _self.stewardWareHouse : stewardWareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} + +/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +}/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseCopyWith<$Res>? get killHouse { + if (_self.killHouse == null) { + return null; + } + + return $KillHouseCopyWith<$Res>(_self.killHouse!, (value) { + return _then(_self.copyWith(killHouse: value)); + }); +}/// Create a copy of ImportedLoadsModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ToStewardCopyWith<$Res>? get toSteward { + if (_self.toSteward == null) { + return null; + } + + return $ToStewardCopyWith<$Res>(_self.toSteward!, (value) { + return _then(_self.copyWith(toSteward: value)); + }); +} +} + + +/// @nodoc +mixin _$Product { + + double? get weightAverage; +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProductCopyWith get copyWith => _$ProductCopyWithImpl(this as Product, _$identity); + + /// Serializes this Product to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Product&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,weightAverage); + +@override +String toString() { + return 'Product(weightAverage: $weightAverage)'; +} + + +} + +/// @nodoc +abstract mixin class $ProductCopyWith<$Res> { + factory $ProductCopyWith(Product value, $Res Function(Product) _then) = _$ProductCopyWithImpl; +@useResult +$Res call({ + double? weightAverage +}); + + + + +} +/// @nodoc +class _$ProductCopyWithImpl<$Res> + implements $ProductCopyWith<$Res> { + _$ProductCopyWithImpl(this._self, this._then); + + final Product _self; + final $Res Function(Product) _then; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? weightAverage = freezed,}) { + return _then(_self.copyWith( +weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Product]. +extension ProductPatterns on Product { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Product value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Product value) $default,){ +final _that = this; +switch (_that) { +case _Product(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Product value)? $default,){ +final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? weightAverage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that.weightAverage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? weightAverage) $default,) {final _that = this; +switch (_that) { +case _Product(): +return $default(_that.weightAverage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? weightAverage)? $default,) {final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that.weightAverage);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Product implements Product { + const _Product({this.weightAverage}); + factory _Product.fromJson(Map json) => _$ProductFromJson(json); + +@override final double? weightAverage; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProductCopyWith<_Product> get copyWith => __$ProductCopyWithImpl<_Product>(this, _$identity); + +@override +Map toJson() { + return _$ProductToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Product&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,weightAverage); + +@override +String toString() { + return 'Product(weightAverage: $weightAverage)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProductCopyWith<$Res> implements $ProductCopyWith<$Res> { + factory _$ProductCopyWith(_Product value, $Res Function(_Product) _then) = __$ProductCopyWithImpl; +@override @useResult +$Res call({ + double? weightAverage +}); + + + + +} +/// @nodoc +class __$ProductCopyWithImpl<$Res> + implements _$ProductCopyWith<$Res> { + __$ProductCopyWithImpl(this._self, this._then); + + final _Product _self; + final $Res Function(_Product) _then; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? weightAverage = freezed,}) { + return _then(_Product( +weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + + +/// @nodoc +mixin _$KillHouse { + + String? get key; KillHouseOperator? get killHouseOperator; String? get name; bool? get killer; +/// Create a copy of KillHouse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseCopyWith get copyWith => _$KillHouseCopyWithImpl(this as KillHouse, _$identity); + + /// Serializes this KillHouse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouse&&(identical(other.key, key) || other.key == key)&&(identical(other.killHouseOperator, killHouseOperator) || other.killHouseOperator == killHouseOperator)&&(identical(other.name, name) || other.name == name)&&(identical(other.killer, killer) || other.killer == killer)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,killHouseOperator,name,killer); + +@override +String toString() { + return 'KillHouse(key: $key, killHouseOperator: $killHouseOperator, name: $name, killer: $killer)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseCopyWith<$Res> { + factory $KillHouseCopyWith(KillHouse value, $Res Function(KillHouse) _then) = _$KillHouseCopyWithImpl; +@useResult +$Res call({ + String? key, KillHouseOperator? killHouseOperator, String? name, bool? killer +}); + + +$KillHouseOperatorCopyWith<$Res>? get killHouseOperator; + +} +/// @nodoc +class _$KillHouseCopyWithImpl<$Res> + implements $KillHouseCopyWith<$Res> { + _$KillHouseCopyWithImpl(this._self, this._then); + + final KillHouse _self; + final $Res Function(KillHouse) _then; + +/// Create a copy of KillHouse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? killHouseOperator = freezed,Object? name = freezed,Object? killer = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,killHouseOperator: freezed == killHouseOperator ? _self.killHouseOperator : killHouseOperator // ignore: cast_nullable_to_non_nullable +as KillHouseOperator?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,killer: freezed == killer ? _self.killer : killer // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} +/// Create a copy of KillHouse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseOperatorCopyWith<$Res>? get killHouseOperator { + if (_self.killHouseOperator == null) { + return null; + } + + return $KillHouseOperatorCopyWith<$Res>(_self.killHouseOperator!, (value) { + return _then(_self.copyWith(killHouseOperator: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [KillHouse]. +extension KillHousePatterns on KillHouse { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _KillHouse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouse() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _KillHouse value) $default,){ +final _that = this; +switch (_that) { +case _KillHouse(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _KillHouse value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouse() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, KillHouseOperator? killHouseOperator, String? name, bool? killer)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouse() when $default != null: +return $default(_that.key,_that.killHouseOperator,_that.name,_that.killer);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, KillHouseOperator? killHouseOperator, String? name, bool? killer) $default,) {final _that = this; +switch (_that) { +case _KillHouse(): +return $default(_that.key,_that.killHouseOperator,_that.name,_that.killer);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, KillHouseOperator? killHouseOperator, String? name, bool? killer)? $default,) {final _that = this; +switch (_that) { +case _KillHouse() when $default != null: +return $default(_that.key,_that.killHouseOperator,_that.name,_that.killer);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouse implements KillHouse { + const _KillHouse({this.key, this.killHouseOperator, this.name, this.killer}); + factory _KillHouse.fromJson(Map json) => _$KillHouseFromJson(json); + +@override final String? key; +@override final KillHouseOperator? killHouseOperator; +@override final String? name; +@override final bool? killer; + +/// Create a copy of KillHouse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseCopyWith<_KillHouse> get copyWith => __$KillHouseCopyWithImpl<_KillHouse>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouse&&(identical(other.key, key) || other.key == key)&&(identical(other.killHouseOperator, killHouseOperator) || other.killHouseOperator == killHouseOperator)&&(identical(other.name, name) || other.name == name)&&(identical(other.killer, killer) || other.killer == killer)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,killHouseOperator,name,killer); + +@override +String toString() { + return 'KillHouse(key: $key, killHouseOperator: $killHouseOperator, name: $name, killer: $killer)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseCopyWith<$Res> implements $KillHouseCopyWith<$Res> { + factory _$KillHouseCopyWith(_KillHouse value, $Res Function(_KillHouse) _then) = __$KillHouseCopyWithImpl; +@override @useResult +$Res call({ + String? key, KillHouseOperator? killHouseOperator, String? name, bool? killer +}); + + +@override $KillHouseOperatorCopyWith<$Res>? get killHouseOperator; + +} +/// @nodoc +class __$KillHouseCopyWithImpl<$Res> + implements _$KillHouseCopyWith<$Res> { + __$KillHouseCopyWithImpl(this._self, this._then); + + final _KillHouse _self; + final $Res Function(_KillHouse) _then; + +/// Create a copy of KillHouse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? killHouseOperator = freezed,Object? name = freezed,Object? killer = freezed,}) { + return _then(_KillHouse( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,killHouseOperator: freezed == killHouseOperator ? _self.killHouseOperator : killHouseOperator // ignore: cast_nullable_to_non_nullable +as KillHouseOperator?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,killer: freezed == killer ? _self.killer : killer // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +/// Create a copy of KillHouse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseOperatorCopyWith<$Res>? get killHouseOperator { + if (_self.killHouseOperator == null) { + return null; + } + + return $KillHouseOperatorCopyWith<$Res>(_self.killHouseOperator!, (value) { + return _then(_self.copyWith(killHouseOperator: value)); + }); +} +} + + +/// @nodoc +mixin _$KillHouseOperator { + + User? get user; +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseOperatorCopyWith get copyWith => _$KillHouseOperatorCopyWithImpl(this as KillHouseOperator, _$identity); + + /// Serializes this KillHouseOperator to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseOperator&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user); + +@override +String toString() { + return 'KillHouseOperator(user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseOperatorCopyWith<$Res> { + factory $KillHouseOperatorCopyWith(KillHouseOperator value, $Res Function(KillHouseOperator) _then) = _$KillHouseOperatorCopyWithImpl; +@useResult +$Res call({ + User? user +}); + + +$UserCopyWith<$Res>? get user; + +} +/// @nodoc +class _$KillHouseOperatorCopyWithImpl<$Res> + implements $KillHouseOperatorCopyWith<$Res> { + _$KillHouseOperatorCopyWithImpl(this._self, this._then); + + final KillHouseOperator _self; + final $Res Function(KillHouseOperator) _then; + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? user = freezed,}) { + return _then(_self.copyWith( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?, + )); +} +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [KillHouseOperator]. +extension KillHouseOperatorPatterns on KillHouseOperator { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _KillHouseOperator value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseOperator() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _KillHouseOperator value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseOperator(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _KillHouseOperator value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseOperator() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( User? user)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseOperator() when $default != null: +return $default(_that.user);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( User? user) $default,) {final _that = this; +switch (_that) { +case _KillHouseOperator(): +return $default(_that.user);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( User? user)? $default,) {final _that = this; +switch (_that) { +case _KillHouseOperator() when $default != null: +return $default(_that.user);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseOperator implements KillHouseOperator { + const _KillHouseOperator({this.user}); + factory _KillHouseOperator.fromJson(Map json) => _$KillHouseOperatorFromJson(json); + +@override final User? user; + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseOperatorCopyWith<_KillHouseOperator> get copyWith => __$KillHouseOperatorCopyWithImpl<_KillHouseOperator>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseOperatorToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseOperator&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user); + +@override +String toString() { + return 'KillHouseOperator(user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseOperatorCopyWith<$Res> implements $KillHouseOperatorCopyWith<$Res> { + factory _$KillHouseOperatorCopyWith(_KillHouseOperator value, $Res Function(_KillHouseOperator) _then) = __$KillHouseOperatorCopyWithImpl; +@override @useResult +$Res call({ + User? user +}); + + +@override $UserCopyWith<$Res>? get user; + +} +/// @nodoc +class __$KillHouseOperatorCopyWithImpl<$Res> + implements _$KillHouseOperatorCopyWith<$Res> { + __$KillHouseOperatorCopyWithImpl(this._self, this._then); + + final _KillHouseOperator _self; + final $Res Function(_KillHouseOperator) _then; + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? user = freezed,}) { + return _then(_KillHouseOperator( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?, + )); +} + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get firstName; String? get lastName; int? get baseOrder; String? get mobile; String? get nationalId; String? get nationalCode; String? get key; City? get city; String? get unitName; String? get unitNationalId; String? get unitRegistrationNumber; String? get unitEconomicalNumber; String? get unitProvince; String? get unitCity; String? get unitPostalCode; String? get unitAddress; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.key, key) || other.key == key)&&(identical(other.city, city) || other.city == city)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,baseOrder,mobile,nationalId,nationalCode,key,city,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, baseOrder: $baseOrder, mobile: $mobile, nationalId: $nationalId, nationalCode: $nationalCode, key: $key, city: $city, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress +}); + + +$CityCopyWith<$Res>? get city; + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? baseOrder = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,Object? key = freezed,Object? city = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable +as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable +as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable +as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable +as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable +as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable +as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.baseOrder,_that.mobile,_that.nationalId,_that.nationalCode,_that.key,_that.city,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.baseOrder,_that.mobile,_that.nationalId,_that.nationalCode,_that.key,_that.city,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.baseOrder,_that.mobile,_that.nationalId,_that.nationalCode,_that.key,_that.city,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({this.fullname, this.firstName, this.lastName, this.baseOrder, this.mobile, this.nationalId, this.nationalCode, this.key, this.city, this.unitName, this.unitNationalId, this.unitRegistrationNumber, this.unitEconomicalNumber, this.unitProvince, this.unitCity, this.unitPostalCode, this.unitAddress}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final int? baseOrder; +@override final String? mobile; +@override final String? nationalId; +@override final String? nationalCode; +@override final String? key; +@override final City? city; +@override final String? unitName; +@override final String? unitNationalId; +@override final String? unitRegistrationNumber; +@override final String? unitEconomicalNumber; +@override final String? unitProvince; +@override final String? unitCity; +@override final String? unitPostalCode; +@override final String? unitAddress; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.key, key) || other.key == key)&&(identical(other.city, city) || other.city == city)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,baseOrder,mobile,nationalId,nationalCode,key,city,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, baseOrder: $baseOrder, mobile: $mobile, nationalId: $nationalId, nationalCode: $nationalCode, key: $key, city: $city, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress +}); + + +@override $CityCopyWith<$Res>? get city; + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? baseOrder = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,Object? key = freezed,Object? city = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable +as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable +as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable +as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable +as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable +as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable +as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$City { + + int? get id; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get provinceIdForeignKey; int? get cityIdKey; String? get name; double? get productPrice; bool? get provinceCenter; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; dynamic get createdBy; dynamic get modifiedBy; int? get province; +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityCopyWith get copyWith => _$CityCopyWithImpl(this as City, _$identity); + + /// Serializes this City to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is City&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.provinceIdForeignKey, provinceIdForeignKey) || other.provinceIdForeignKey == provinceIdForeignKey)&&(identical(other.cityIdKey, cityIdKey) || other.cityIdKey == cityIdKey)&&(identical(other.name, name) || other.name == name)&&(identical(other.productPrice, productPrice) || other.productPrice == productPrice)&&(identical(other.provinceCenter, provinceCenter) || other.provinceCenter == provinceCenter)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.province, province) || other.province == province)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,key,createDate,modifyDate,trash,provinceIdForeignKey,cityIdKey,name,productPrice,provinceCenter,cityNumber,cityName,provinceNumber,provinceName,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),province); + +@override +String toString() { + return 'City(id: $id, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, provinceIdForeignKey: $provinceIdForeignKey, cityIdKey: $cityIdKey, name: $name, productPrice: $productPrice, provinceCenter: $provinceCenter, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, createdBy: $createdBy, modifiedBy: $modifiedBy, province: $province)'; +} + + +} + +/// @nodoc +abstract mixin class $CityCopyWith<$Res> { + factory $CityCopyWith(City value, $Res Function(City) _then) = _$CityCopyWithImpl; +@useResult +$Res call({ + int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, dynamic createdBy, dynamic modifiedBy, int? province +}); + + + + +} +/// @nodoc +class _$CityCopyWithImpl<$Res> + implements $CityCopyWith<$Res> { + _$CityCopyWithImpl(this._self, this._then); + + final City _self; + final $Res Function(City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdKey = freezed,Object? name = freezed,Object? productPrice = freezed,Object? provinceCenter = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? province = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable +as int?,cityIdKey: freezed == cityIdKey ? _self.cityIdKey : cityIdKey // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,productPrice: freezed == productPrice ? _self.productPrice : productPrice // ignore: cast_nullable_to_non_nullable +as double?,provinceCenter: freezed == provinceCenter ? _self.provinceCenter : provinceCenter // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [City]. +extension CityPatterns on City { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _City value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _City value) $default,){ +final _that = this; +switch (_that) { +case _City(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _City value)? $default,){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, dynamic createdBy, dynamic modifiedBy, int? province)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.provinceIdForeignKey,_that.cityIdKey,_that.name,_that.productPrice,_that.provinceCenter,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.createdBy,_that.modifiedBy,_that.province);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, dynamic createdBy, dynamic modifiedBy, int? province) $default,) {final _that = this; +switch (_that) { +case _City(): +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.provinceIdForeignKey,_that.cityIdKey,_that.name,_that.productPrice,_that.provinceCenter,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.createdBy,_that.modifiedBy,_that.province);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, dynamic createdBy, dynamic modifiedBy, int? province)? $default,) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.provinceIdForeignKey,_that.cityIdKey,_that.name,_that.productPrice,_that.provinceCenter,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.createdBy,_that.modifiedBy,_that.province);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _City implements City { + const _City({this.id, this.key, this.createDate, this.modifyDate, this.trash, this.provinceIdForeignKey, this.cityIdKey, this.name, this.productPrice, this.provinceCenter, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.createdBy, this.modifiedBy, this.province}); + factory _City.fromJson(Map json) => _$CityFromJson(json); + +@override final int? id; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final int? provinceIdForeignKey; +@override final int? cityIdKey; +@override final String? name; +@override final double? productPrice; +@override final bool? provinceCenter; +@override final int? cityNumber; +@override final String? cityName; +@override final int? provinceNumber; +@override final String? provinceName; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final int? province; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CityCopyWith<_City> get copyWith => __$CityCopyWithImpl<_City>(this, _$identity); + +@override +Map toJson() { + return _$CityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _City&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.provinceIdForeignKey, provinceIdForeignKey) || other.provinceIdForeignKey == provinceIdForeignKey)&&(identical(other.cityIdKey, cityIdKey) || other.cityIdKey == cityIdKey)&&(identical(other.name, name) || other.name == name)&&(identical(other.productPrice, productPrice) || other.productPrice == productPrice)&&(identical(other.provinceCenter, provinceCenter) || other.provinceCenter == provinceCenter)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.province, province) || other.province == province)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,key,createDate,modifyDate,trash,provinceIdForeignKey,cityIdKey,name,productPrice,provinceCenter,cityNumber,cityName,provinceNumber,provinceName,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),province); + +@override +String toString() { + return 'City(id: $id, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, provinceIdForeignKey: $provinceIdForeignKey, cityIdKey: $cityIdKey, name: $name, productPrice: $productPrice, provinceCenter: $provinceCenter, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, createdBy: $createdBy, modifiedBy: $modifiedBy, province: $province)'; +} + + +} + +/// @nodoc +abstract mixin class _$CityCopyWith<$Res> implements $CityCopyWith<$Res> { + factory _$CityCopyWith(_City value, $Res Function(_City) _then) = __$CityCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, dynamic createdBy, dynamic modifiedBy, int? province +}); + + + + +} +/// @nodoc +class __$CityCopyWithImpl<$Res> + implements _$CityCopyWith<$Res> { + __$CityCopyWithImpl(this._self, this._then); + + final _City _self; + final $Res Function(_City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdKey = freezed,Object? name = freezed,Object? productPrice = freezed,Object? provinceCenter = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? province = freezed,}) { + return _then(_City( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable +as int?,cityIdKey: freezed == cityIdKey ? _self.cityIdKey : cityIdKey // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,productPrice: freezed == productPrice ? _self.productPrice : productPrice // ignore: cast_nullable_to_non_nullable +as double?,provinceCenter: freezed == provinceCenter ? _self.provinceCenter : provinceCenter // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$ToSteward { + + int? get id; ToStewardUser? get user; Address? get address; Activity? get guildAreaActivity; Activity? get guildTypeActivity; List? get killHouse; List? get stewardKillHouse; List? get stewards; PosStatus? get getPosStatus; String? get key; String? get createDate; String? get modifyDate; bool? get trash; dynamic get userIdForeignKey; dynamic get addressIdForeignKey; dynamic get userBankIdForeignKey; dynamic get walletIdForeignKey; dynamic get provincialGovernmentIdKey; dynamic get identityDocuments; bool? get active; int? get cityNumber; String? get cityName; String? get guildsId; String? get licenseNumber; String? get guildsName; dynamic get phone; String? get typeActivity; String? get areaActivity; int? get provinceNumber; String? get provinceName; bool? get steward; bool? get hasPos; dynamic get centersAllocation; dynamic get killHouseCentersAllocation; dynamic get allocationLimit; bool? get limitationAllocation; dynamic get registerarRole; dynamic get registerarFullname; dynamic get registerarMobile; bool? get killHouseRegister; bool? get stewardRegister; bool? get guildsRoomRegister; bool? get posCompanyRegister; String? get provinceAcceptState; dynamic get provinceMessage; dynamic get condition; dynamic get descriptionCondition; bool? get stewardActive; dynamic get stewardAllocationLimit; bool? get stewardLimitationAllocation; bool? get license; dynamic get licenseForm; dynamic get licenseFile; dynamic get reviewerRole; dynamic get reviewerFullname; dynamic get reviewerMobile; dynamic get checkerMessage; bool? get finalAccept; bool? get temporaryRegistration; dynamic get createdBy; dynamic get modifiedBy; dynamic get userBankInfo; int? get wallet; List? get cars; List? get userLevel; +/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ToStewardCopyWith get copyWith => _$ToStewardCopyWithImpl(this as ToSteward, _$identity); + + /// Serializes this ToSteward to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ToSteward&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&(identical(other.guildAreaActivity, guildAreaActivity) || other.guildAreaActivity == guildAreaActivity)&&(identical(other.guildTypeActivity, guildTypeActivity) || other.guildTypeActivity == guildTypeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.stewardKillHouse, stewardKillHouse)&&const DeepCollectionEquality().equals(other.stewards, stewards)&&(identical(other.getPosStatus, getPosStatus) || other.getPosStatus == getPosStatus)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&const DeepCollectionEquality().equals(other.userIdForeignKey, userIdForeignKey)&&const DeepCollectionEquality().equals(other.addressIdForeignKey, addressIdForeignKey)&&const DeepCollectionEquality().equals(other.userBankIdForeignKey, userBankIdForeignKey)&&const DeepCollectionEquality().equals(other.walletIdForeignKey, walletIdForeignKey)&&const DeepCollectionEquality().equals(other.provincialGovernmentIdKey, provincialGovernmentIdKey)&&const DeepCollectionEquality().equals(other.identityDocuments, identityDocuments)&&(identical(other.active, active) || other.active == active)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&const DeepCollectionEquality().equals(other.phone, phone)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.hasPos, hasPos) || other.hasPos == hasPos)&&const DeepCollectionEquality().equals(other.centersAllocation, centersAllocation)&&const DeepCollectionEquality().equals(other.killHouseCentersAllocation, killHouseCentersAllocation)&&const DeepCollectionEquality().equals(other.allocationLimit, allocationLimit)&&(identical(other.limitationAllocation, limitationAllocation) || other.limitationAllocation == limitationAllocation)&&const DeepCollectionEquality().equals(other.registerarRole, registerarRole)&&const DeepCollectionEquality().equals(other.registerarFullname, registerarFullname)&&const DeepCollectionEquality().equals(other.registerarMobile, registerarMobile)&&(identical(other.killHouseRegister, killHouseRegister) || other.killHouseRegister == killHouseRegister)&&(identical(other.stewardRegister, stewardRegister) || other.stewardRegister == stewardRegister)&&(identical(other.guildsRoomRegister, guildsRoomRegister) || other.guildsRoomRegister == guildsRoomRegister)&&(identical(other.posCompanyRegister, posCompanyRegister) || other.posCompanyRegister == posCompanyRegister)&&(identical(other.provinceAcceptState, provinceAcceptState) || other.provinceAcceptState == provinceAcceptState)&&const DeepCollectionEquality().equals(other.provinceMessage, provinceMessage)&&const DeepCollectionEquality().equals(other.condition, condition)&&const DeepCollectionEquality().equals(other.descriptionCondition, descriptionCondition)&&(identical(other.stewardActive, stewardActive) || other.stewardActive == stewardActive)&&const DeepCollectionEquality().equals(other.stewardAllocationLimit, stewardAllocationLimit)&&(identical(other.stewardLimitationAllocation, stewardLimitationAllocation) || other.stewardLimitationAllocation == stewardLimitationAllocation)&&(identical(other.license, license) || other.license == license)&&const DeepCollectionEquality().equals(other.licenseForm, licenseForm)&&const DeepCollectionEquality().equals(other.licenseFile, licenseFile)&&const DeepCollectionEquality().equals(other.reviewerRole, reviewerRole)&&const DeepCollectionEquality().equals(other.reviewerFullname, reviewerFullname)&&const DeepCollectionEquality().equals(other.reviewerMobile, reviewerMobile)&&const DeepCollectionEquality().equals(other.checkerMessage, checkerMessage)&&(identical(other.finalAccept, finalAccept) || other.finalAccept == finalAccept)&&(identical(other.temporaryRegistration, temporaryRegistration) || other.temporaryRegistration == temporaryRegistration)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.userBankInfo, userBankInfo)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other.cars, cars)&&const DeepCollectionEquality().equals(other.userLevel, userLevel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,guildAreaActivity,guildTypeActivity,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(stewardKillHouse),const DeepCollectionEquality().hash(stewards),getPosStatus,key,createDate,modifyDate,trash,const DeepCollectionEquality().hash(userIdForeignKey),const DeepCollectionEquality().hash(addressIdForeignKey),const DeepCollectionEquality().hash(userBankIdForeignKey),const DeepCollectionEquality().hash(walletIdForeignKey),const DeepCollectionEquality().hash(provincialGovernmentIdKey),const DeepCollectionEquality().hash(identityDocuments),active,cityNumber,cityName,guildsId,licenseNumber,guildsName,const DeepCollectionEquality().hash(phone),typeActivity,areaActivity,provinceNumber,provinceName,steward,hasPos,const DeepCollectionEquality().hash(centersAllocation),const DeepCollectionEquality().hash(killHouseCentersAllocation),const DeepCollectionEquality().hash(allocationLimit),limitationAllocation,const DeepCollectionEquality().hash(registerarRole),const DeepCollectionEquality().hash(registerarFullname),const DeepCollectionEquality().hash(registerarMobile),killHouseRegister,stewardRegister,guildsRoomRegister,posCompanyRegister,provinceAcceptState,const DeepCollectionEquality().hash(provinceMessage),const DeepCollectionEquality().hash(condition),const DeepCollectionEquality().hash(descriptionCondition),stewardActive,const DeepCollectionEquality().hash(stewardAllocationLimit),stewardLimitationAllocation,license,const DeepCollectionEquality().hash(licenseForm),const DeepCollectionEquality().hash(licenseFile),const DeepCollectionEquality().hash(reviewerRole),const DeepCollectionEquality().hash(reviewerFullname),const DeepCollectionEquality().hash(reviewerMobile),const DeepCollectionEquality().hash(checkerMessage),finalAccept,temporaryRegistration,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(userBankInfo),wallet,const DeepCollectionEquality().hash(cars),const DeepCollectionEquality().hash(userLevel)]); + +@override +String toString() { + return 'ToSteward(id: $id, user: $user, address: $address, guildAreaActivity: $guildAreaActivity, guildTypeActivity: $guildTypeActivity, killHouse: $killHouse, stewardKillHouse: $stewardKillHouse, stewards: $stewards, getPosStatus: $getPosStatus, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, userIdForeignKey: $userIdForeignKey, addressIdForeignKey: $addressIdForeignKey, userBankIdForeignKey: $userBankIdForeignKey, walletIdForeignKey: $walletIdForeignKey, provincialGovernmentIdKey: $provincialGovernmentIdKey, identityDocuments: $identityDocuments, active: $active, cityNumber: $cityNumber, cityName: $cityName, guildsId: $guildsId, licenseNumber: $licenseNumber, guildsName: $guildsName, phone: $phone, typeActivity: $typeActivity, areaActivity: $areaActivity, provinceNumber: $provinceNumber, provinceName: $provinceName, steward: $steward, hasPos: $hasPos, centersAllocation: $centersAllocation, killHouseCentersAllocation: $killHouseCentersAllocation, allocationLimit: $allocationLimit, limitationAllocation: $limitationAllocation, registerarRole: $registerarRole, registerarFullname: $registerarFullname, registerarMobile: $registerarMobile, killHouseRegister: $killHouseRegister, stewardRegister: $stewardRegister, guildsRoomRegister: $guildsRoomRegister, posCompanyRegister: $posCompanyRegister, provinceAcceptState: $provinceAcceptState, provinceMessage: $provinceMessage, condition: $condition, descriptionCondition: $descriptionCondition, stewardActive: $stewardActive, stewardAllocationLimit: $stewardAllocationLimit, stewardLimitationAllocation: $stewardLimitationAllocation, license: $license, licenseForm: $licenseForm, licenseFile: $licenseFile, reviewerRole: $reviewerRole, reviewerFullname: $reviewerFullname, reviewerMobile: $reviewerMobile, checkerMessage: $checkerMessage, finalAccept: $finalAccept, temporaryRegistration: $temporaryRegistration, createdBy: $createdBy, modifiedBy: $modifiedBy, userBankInfo: $userBankInfo, wallet: $wallet, cars: $cars, userLevel: $userLevel)'; +} + + +} + +/// @nodoc +abstract mixin class $ToStewardCopyWith<$Res> { + factory $ToStewardCopyWith(ToSteward value, $Res Function(ToSteward) _then) = _$ToStewardCopyWithImpl; +@useResult +$Res call({ + int? id, ToStewardUser? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, dynamic phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, dynamic registerarRole, dynamic registerarFullname, dynamic registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, dynamic provinceMessage, dynamic condition, dynamic descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, dynamic reviewerRole, dynamic reviewerFullname, dynamic reviewerMobile, dynamic checkerMessage, bool? finalAccept, bool? temporaryRegistration, dynamic createdBy, dynamic modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel +}); + + +$ToStewardUserCopyWith<$Res>? get user;$AddressCopyWith<$Res>? get address;$ActivityCopyWith<$Res>? get guildAreaActivity;$ActivityCopyWith<$Res>? get guildTypeActivity;$PosStatusCopyWith<$Res>? get getPosStatus; + +} +/// @nodoc +class _$ToStewardCopyWithImpl<$Res> + implements $ToStewardCopyWith<$Res> { + _$ToStewardCopyWithImpl(this._self, this._then); + + final ToSteward _self; + final $Res Function(ToSteward) _then; + +/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guildAreaActivity = freezed,Object? guildTypeActivity = freezed,Object? killHouse = freezed,Object? stewardKillHouse = freezed,Object? stewards = freezed,Object? getPosStatus = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? userIdForeignKey = freezed,Object? addressIdForeignKey = freezed,Object? userBankIdForeignKey = freezed,Object? walletIdForeignKey = freezed,Object? provincialGovernmentIdKey = freezed,Object? identityDocuments = freezed,Object? active = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? guildsId = freezed,Object? licenseNumber = freezed,Object? guildsName = freezed,Object? phone = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? steward = freezed,Object? hasPos = freezed,Object? centersAllocation = freezed,Object? killHouseCentersAllocation = freezed,Object? allocationLimit = freezed,Object? limitationAllocation = freezed,Object? registerarRole = freezed,Object? registerarFullname = freezed,Object? registerarMobile = freezed,Object? killHouseRegister = freezed,Object? stewardRegister = freezed,Object? guildsRoomRegister = freezed,Object? posCompanyRegister = freezed,Object? provinceAcceptState = freezed,Object? provinceMessage = freezed,Object? condition = freezed,Object? descriptionCondition = freezed,Object? stewardActive = freezed,Object? stewardAllocationLimit = freezed,Object? stewardLimitationAllocation = freezed,Object? license = freezed,Object? licenseForm = freezed,Object? licenseFile = freezed,Object? reviewerRole = freezed,Object? reviewerFullname = freezed,Object? reviewerMobile = freezed,Object? checkerMessage = freezed,Object? finalAccept = freezed,Object? temporaryRegistration = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? userBankInfo = freezed,Object? wallet = freezed,Object? cars = freezed,Object? userLevel = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as ToStewardUser?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,guildAreaActivity: freezed == guildAreaActivity ? _self.guildAreaActivity : guildAreaActivity // ignore: cast_nullable_to_non_nullable +as Activity?,guildTypeActivity: freezed == guildTypeActivity ? _self.guildTypeActivity : guildTypeActivity // ignore: cast_nullable_to_non_nullable +as Activity?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as List?,stewardKillHouse: freezed == stewardKillHouse ? _self.stewardKillHouse : stewardKillHouse // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self.stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,getPosStatus: freezed == getPosStatus ? _self.getPosStatus : getPosStatus // ignore: cast_nullable_to_non_nullable +as PosStatus?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,userIdForeignKey: freezed == userIdForeignKey ? _self.userIdForeignKey : userIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,addressIdForeignKey: freezed == addressIdForeignKey ? _self.addressIdForeignKey : addressIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,userBankIdForeignKey: freezed == userBankIdForeignKey ? _self.userBankIdForeignKey : userBankIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,walletIdForeignKey: freezed == walletIdForeignKey ? _self.walletIdForeignKey : walletIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,provincialGovernmentIdKey: freezed == provincialGovernmentIdKey ? _self.provincialGovernmentIdKey : provincialGovernmentIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,identityDocuments: freezed == identityDocuments ? _self.identityDocuments : identityDocuments // ignore: cast_nullable_to_non_nullable +as dynamic,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as dynamic,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,hasPos: freezed == hasPos ? _self.hasPos : hasPos // ignore: cast_nullable_to_non_nullable +as bool?,centersAllocation: freezed == centersAllocation ? _self.centersAllocation : centersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,killHouseCentersAllocation: freezed == killHouseCentersAllocation ? _self.killHouseCentersAllocation : killHouseCentersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,limitationAllocation: freezed == limitationAllocation ? _self.limitationAllocation : limitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,registerarRole: freezed == registerarRole ? _self.registerarRole : registerarRole // ignore: cast_nullable_to_non_nullable +as dynamic,registerarFullname: freezed == registerarFullname ? _self.registerarFullname : registerarFullname // ignore: cast_nullable_to_non_nullable +as dynamic,registerarMobile: freezed == registerarMobile ? _self.registerarMobile : registerarMobile // ignore: cast_nullable_to_non_nullable +as dynamic,killHouseRegister: freezed == killHouseRegister ? _self.killHouseRegister : killHouseRegister // ignore: cast_nullable_to_non_nullable +as bool?,stewardRegister: freezed == stewardRegister ? _self.stewardRegister : stewardRegister // ignore: cast_nullable_to_non_nullable +as bool?,guildsRoomRegister: freezed == guildsRoomRegister ? _self.guildsRoomRegister : guildsRoomRegister // ignore: cast_nullable_to_non_nullable +as bool?,posCompanyRegister: freezed == posCompanyRegister ? _self.posCompanyRegister : posCompanyRegister // ignore: cast_nullable_to_non_nullable +as bool?,provinceAcceptState: freezed == provinceAcceptState ? _self.provinceAcceptState : provinceAcceptState // ignore: cast_nullable_to_non_nullable +as String?,provinceMessage: freezed == provinceMessage ? _self.provinceMessage : provinceMessage // ignore: cast_nullable_to_non_nullable +as dynamic,condition: freezed == condition ? _self.condition : condition // ignore: cast_nullable_to_non_nullable +as dynamic,descriptionCondition: freezed == descriptionCondition ? _self.descriptionCondition : descriptionCondition // ignore: cast_nullable_to_non_nullable +as dynamic,stewardActive: freezed == stewardActive ? _self.stewardActive : stewardActive // ignore: cast_nullable_to_non_nullable +as bool?,stewardAllocationLimit: freezed == stewardAllocationLimit ? _self.stewardAllocationLimit : stewardAllocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,stewardLimitationAllocation: freezed == stewardLimitationAllocation ? _self.stewardLimitationAllocation : stewardLimitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,licenseForm: freezed == licenseForm ? _self.licenseForm : licenseForm // ignore: cast_nullable_to_non_nullable +as dynamic,licenseFile: freezed == licenseFile ? _self.licenseFile : licenseFile // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerRole: freezed == reviewerRole ? _self.reviewerRole : reviewerRole // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerFullname: freezed == reviewerFullname ? _self.reviewerFullname : reviewerFullname // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerMobile: freezed == reviewerMobile ? _self.reviewerMobile : reviewerMobile // ignore: cast_nullable_to_non_nullable +as dynamic,checkerMessage: freezed == checkerMessage ? _self.checkerMessage : checkerMessage // ignore: cast_nullable_to_non_nullable +as dynamic,finalAccept: freezed == finalAccept ? _self.finalAccept : finalAccept // ignore: cast_nullable_to_non_nullable +as bool?,temporaryRegistration: freezed == temporaryRegistration ? _self.temporaryRegistration : temporaryRegistration // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,userBankInfo: freezed == userBankInfo ? _self.userBankInfo : userBankInfo // ignore: cast_nullable_to_non_nullable +as dynamic,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self.cars : cars // ignore: cast_nullable_to_non_nullable +as List?,userLevel: freezed == userLevel ? _self.userLevel : userLevel // ignore: cast_nullable_to_non_nullable +as List?, + )); +} +/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ToStewardUserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $ToStewardUserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildAreaActivity { + if (_self.guildAreaActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildAreaActivity!, (value) { + return _then(_self.copyWith(guildAreaActivity: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildTypeActivity { + if (_self.guildTypeActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildTypeActivity!, (value) { + return _then(_self.copyWith(guildTypeActivity: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PosStatusCopyWith<$Res>? get getPosStatus { + if (_self.getPosStatus == null) { + return null; + } + + return $PosStatusCopyWith<$Res>(_self.getPosStatus!, (value) { + return _then(_self.copyWith(getPosStatus: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ToSteward]. +extension ToStewardPatterns on ToSteward { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ToSteward value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ToSteward() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ToSteward value) $default,){ +final _that = this; +switch (_that) { +case _ToSteward(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ToSteward value)? $default,){ +final _that = this; +switch (_that) { +case _ToSteward() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, ToStewardUser? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, dynamic phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, dynamic registerarRole, dynamic registerarFullname, dynamic registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, dynamic provinceMessage, dynamic condition, dynamic descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, dynamic reviewerRole, dynamic reviewerFullname, dynamic reviewerMobile, dynamic checkerMessage, bool? finalAccept, bool? temporaryRegistration, dynamic createdBy, dynamic modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ToSteward() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.userIdForeignKey,_that.addressIdForeignKey,_that.userBankIdForeignKey,_that.walletIdForeignKey,_that.provincialGovernmentIdKey,_that.identityDocuments,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.centersAllocation,_that.killHouseCentersAllocation,_that.allocationLimit,_that.limitationAllocation,_that.registerarRole,_that.registerarFullname,_that.registerarMobile,_that.killHouseRegister,_that.stewardRegister,_that.guildsRoomRegister,_that.posCompanyRegister,_that.provinceAcceptState,_that.provinceMessage,_that.condition,_that.descriptionCondition,_that.stewardActive,_that.stewardAllocationLimit,_that.stewardLimitationAllocation,_that.license,_that.licenseForm,_that.licenseFile,_that.reviewerRole,_that.reviewerFullname,_that.reviewerMobile,_that.checkerMessage,_that.finalAccept,_that.temporaryRegistration,_that.createdBy,_that.modifiedBy,_that.userBankInfo,_that.wallet,_that.cars,_that.userLevel);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, ToStewardUser? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, dynamic phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, dynamic registerarRole, dynamic registerarFullname, dynamic registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, dynamic provinceMessage, dynamic condition, dynamic descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, dynamic reviewerRole, dynamic reviewerFullname, dynamic reviewerMobile, dynamic checkerMessage, bool? finalAccept, bool? temporaryRegistration, dynamic createdBy, dynamic modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel) $default,) {final _that = this; +switch (_that) { +case _ToSteward(): +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.userIdForeignKey,_that.addressIdForeignKey,_that.userBankIdForeignKey,_that.walletIdForeignKey,_that.provincialGovernmentIdKey,_that.identityDocuments,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.centersAllocation,_that.killHouseCentersAllocation,_that.allocationLimit,_that.limitationAllocation,_that.registerarRole,_that.registerarFullname,_that.registerarMobile,_that.killHouseRegister,_that.stewardRegister,_that.guildsRoomRegister,_that.posCompanyRegister,_that.provinceAcceptState,_that.provinceMessage,_that.condition,_that.descriptionCondition,_that.stewardActive,_that.stewardAllocationLimit,_that.stewardLimitationAllocation,_that.license,_that.licenseForm,_that.licenseFile,_that.reviewerRole,_that.reviewerFullname,_that.reviewerMobile,_that.checkerMessage,_that.finalAccept,_that.temporaryRegistration,_that.createdBy,_that.modifiedBy,_that.userBankInfo,_that.wallet,_that.cars,_that.userLevel);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, ToStewardUser? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, dynamic phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, dynamic registerarRole, dynamic registerarFullname, dynamic registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, dynamic provinceMessage, dynamic condition, dynamic descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, dynamic reviewerRole, dynamic reviewerFullname, dynamic reviewerMobile, dynamic checkerMessage, bool? finalAccept, bool? temporaryRegistration, dynamic createdBy, dynamic modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel)? $default,) {final _that = this; +switch (_that) { +case _ToSteward() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.userIdForeignKey,_that.addressIdForeignKey,_that.userBankIdForeignKey,_that.walletIdForeignKey,_that.provincialGovernmentIdKey,_that.identityDocuments,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.centersAllocation,_that.killHouseCentersAllocation,_that.allocationLimit,_that.limitationAllocation,_that.registerarRole,_that.registerarFullname,_that.registerarMobile,_that.killHouseRegister,_that.stewardRegister,_that.guildsRoomRegister,_that.posCompanyRegister,_that.provinceAcceptState,_that.provinceMessage,_that.condition,_that.descriptionCondition,_that.stewardActive,_that.stewardAllocationLimit,_that.stewardLimitationAllocation,_that.license,_that.licenseForm,_that.licenseFile,_that.reviewerRole,_that.reviewerFullname,_that.reviewerMobile,_that.checkerMessage,_that.finalAccept,_that.temporaryRegistration,_that.createdBy,_that.modifiedBy,_that.userBankInfo,_that.wallet,_that.cars,_that.userLevel);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ToSteward implements ToSteward { + const _ToSteward({this.id, this.user, this.address, this.guildAreaActivity, this.guildTypeActivity, final List? killHouse, final List? stewardKillHouse, final List? stewards, this.getPosStatus, this.key, this.createDate, this.modifyDate, this.trash, this.userIdForeignKey, this.addressIdForeignKey, this.userBankIdForeignKey, this.walletIdForeignKey, this.provincialGovernmentIdKey, this.identityDocuments, this.active, this.cityNumber, this.cityName, this.guildsId, this.licenseNumber, this.guildsName, this.phone, this.typeActivity, this.areaActivity, this.provinceNumber, this.provinceName, this.steward, this.hasPos, this.centersAllocation, this.killHouseCentersAllocation, this.allocationLimit, this.limitationAllocation, this.registerarRole, this.registerarFullname, this.registerarMobile, this.killHouseRegister, this.stewardRegister, this.guildsRoomRegister, this.posCompanyRegister, this.provinceAcceptState, this.provinceMessage, this.condition, this.descriptionCondition, this.stewardActive, this.stewardAllocationLimit, this.stewardLimitationAllocation, this.license, this.licenseForm, this.licenseFile, this.reviewerRole, this.reviewerFullname, this.reviewerMobile, this.checkerMessage, this.finalAccept, this.temporaryRegistration, this.createdBy, this.modifiedBy, this.userBankInfo, this.wallet, final List? cars, final List? userLevel}): _killHouse = killHouse,_stewardKillHouse = stewardKillHouse,_stewards = stewards,_cars = cars,_userLevel = userLevel; + factory _ToSteward.fromJson(Map json) => _$ToStewardFromJson(json); + +@override final int? id; +@override final ToStewardUser? user; +@override final Address? address; +@override final Activity? guildAreaActivity; +@override final Activity? guildTypeActivity; + final List? _killHouse; +@override List? get killHouse { + final value = _killHouse; + if (value == null) return null; + if (_killHouse is EqualUnmodifiableListView) return _killHouse; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewardKillHouse; +@override List? get stewardKillHouse { + final value = _stewardKillHouse; + if (value == null) return null; + if (_stewardKillHouse is EqualUnmodifiableListView) return _stewardKillHouse; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewards; +@override List? get stewards { + final value = _stewards; + if (value == null) return null; + if (_stewards is EqualUnmodifiableListView) return _stewards; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final PosStatus? getPosStatus; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final dynamic userIdForeignKey; +@override final dynamic addressIdForeignKey; +@override final dynamic userBankIdForeignKey; +@override final dynamic walletIdForeignKey; +@override final dynamic provincialGovernmentIdKey; +@override final dynamic identityDocuments; +@override final bool? active; +@override final int? cityNumber; +@override final String? cityName; +@override final String? guildsId; +@override final String? licenseNumber; +@override final String? guildsName; +@override final dynamic phone; +@override final String? typeActivity; +@override final String? areaActivity; +@override final int? provinceNumber; +@override final String? provinceName; +@override final bool? steward; +@override final bool? hasPos; +@override final dynamic centersAllocation; +@override final dynamic killHouseCentersAllocation; +@override final dynamic allocationLimit; +@override final bool? limitationAllocation; +@override final dynamic registerarRole; +@override final dynamic registerarFullname; +@override final dynamic registerarMobile; +@override final bool? killHouseRegister; +@override final bool? stewardRegister; +@override final bool? guildsRoomRegister; +@override final bool? posCompanyRegister; +@override final String? provinceAcceptState; +@override final dynamic provinceMessage; +@override final dynamic condition; +@override final dynamic descriptionCondition; +@override final bool? stewardActive; +@override final dynamic stewardAllocationLimit; +@override final bool? stewardLimitationAllocation; +@override final bool? license; +@override final dynamic licenseForm; +@override final dynamic licenseFile; +@override final dynamic reviewerRole; +@override final dynamic reviewerFullname; +@override final dynamic reviewerMobile; +@override final dynamic checkerMessage; +@override final bool? finalAccept; +@override final bool? temporaryRegistration; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final dynamic userBankInfo; +@override final int? wallet; + final List? _cars; +@override List? get cars { + final value = _cars; + if (value == null) return null; + if (_cars is EqualUnmodifiableListView) return _cars; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _userLevel; +@override List? get userLevel { + final value = _userLevel; + if (value == null) return null; + if (_userLevel is EqualUnmodifiableListView) return _userLevel; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ToStewardCopyWith<_ToSteward> get copyWith => __$ToStewardCopyWithImpl<_ToSteward>(this, _$identity); + +@override +Map toJson() { + return _$ToStewardToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ToSteward&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&(identical(other.guildAreaActivity, guildAreaActivity) || other.guildAreaActivity == guildAreaActivity)&&(identical(other.guildTypeActivity, guildTypeActivity) || other.guildTypeActivity == guildTypeActivity)&&const DeepCollectionEquality().equals(other._killHouse, _killHouse)&&const DeepCollectionEquality().equals(other._stewardKillHouse, _stewardKillHouse)&&const DeepCollectionEquality().equals(other._stewards, _stewards)&&(identical(other.getPosStatus, getPosStatus) || other.getPosStatus == getPosStatus)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&const DeepCollectionEquality().equals(other.userIdForeignKey, userIdForeignKey)&&const DeepCollectionEquality().equals(other.addressIdForeignKey, addressIdForeignKey)&&const DeepCollectionEquality().equals(other.userBankIdForeignKey, userBankIdForeignKey)&&const DeepCollectionEquality().equals(other.walletIdForeignKey, walletIdForeignKey)&&const DeepCollectionEquality().equals(other.provincialGovernmentIdKey, provincialGovernmentIdKey)&&const DeepCollectionEquality().equals(other.identityDocuments, identityDocuments)&&(identical(other.active, active) || other.active == active)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&const DeepCollectionEquality().equals(other.phone, phone)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.hasPos, hasPos) || other.hasPos == hasPos)&&const DeepCollectionEquality().equals(other.centersAllocation, centersAllocation)&&const DeepCollectionEquality().equals(other.killHouseCentersAllocation, killHouseCentersAllocation)&&const DeepCollectionEquality().equals(other.allocationLimit, allocationLimit)&&(identical(other.limitationAllocation, limitationAllocation) || other.limitationAllocation == limitationAllocation)&&const DeepCollectionEquality().equals(other.registerarRole, registerarRole)&&const DeepCollectionEquality().equals(other.registerarFullname, registerarFullname)&&const DeepCollectionEquality().equals(other.registerarMobile, registerarMobile)&&(identical(other.killHouseRegister, killHouseRegister) || other.killHouseRegister == killHouseRegister)&&(identical(other.stewardRegister, stewardRegister) || other.stewardRegister == stewardRegister)&&(identical(other.guildsRoomRegister, guildsRoomRegister) || other.guildsRoomRegister == guildsRoomRegister)&&(identical(other.posCompanyRegister, posCompanyRegister) || other.posCompanyRegister == posCompanyRegister)&&(identical(other.provinceAcceptState, provinceAcceptState) || other.provinceAcceptState == provinceAcceptState)&&const DeepCollectionEquality().equals(other.provinceMessage, provinceMessage)&&const DeepCollectionEquality().equals(other.condition, condition)&&const DeepCollectionEquality().equals(other.descriptionCondition, descriptionCondition)&&(identical(other.stewardActive, stewardActive) || other.stewardActive == stewardActive)&&const DeepCollectionEquality().equals(other.stewardAllocationLimit, stewardAllocationLimit)&&(identical(other.stewardLimitationAllocation, stewardLimitationAllocation) || other.stewardLimitationAllocation == stewardLimitationAllocation)&&(identical(other.license, license) || other.license == license)&&const DeepCollectionEquality().equals(other.licenseForm, licenseForm)&&const DeepCollectionEquality().equals(other.licenseFile, licenseFile)&&const DeepCollectionEquality().equals(other.reviewerRole, reviewerRole)&&const DeepCollectionEquality().equals(other.reviewerFullname, reviewerFullname)&&const DeepCollectionEquality().equals(other.reviewerMobile, reviewerMobile)&&const DeepCollectionEquality().equals(other.checkerMessage, checkerMessage)&&(identical(other.finalAccept, finalAccept) || other.finalAccept == finalAccept)&&(identical(other.temporaryRegistration, temporaryRegistration) || other.temporaryRegistration == temporaryRegistration)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.userBankInfo, userBankInfo)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other._cars, _cars)&&const DeepCollectionEquality().equals(other._userLevel, _userLevel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,guildAreaActivity,guildTypeActivity,const DeepCollectionEquality().hash(_killHouse),const DeepCollectionEquality().hash(_stewardKillHouse),const DeepCollectionEquality().hash(_stewards),getPosStatus,key,createDate,modifyDate,trash,const DeepCollectionEquality().hash(userIdForeignKey),const DeepCollectionEquality().hash(addressIdForeignKey),const DeepCollectionEquality().hash(userBankIdForeignKey),const DeepCollectionEquality().hash(walletIdForeignKey),const DeepCollectionEquality().hash(provincialGovernmentIdKey),const DeepCollectionEquality().hash(identityDocuments),active,cityNumber,cityName,guildsId,licenseNumber,guildsName,const DeepCollectionEquality().hash(phone),typeActivity,areaActivity,provinceNumber,provinceName,steward,hasPos,const DeepCollectionEquality().hash(centersAllocation),const DeepCollectionEquality().hash(killHouseCentersAllocation),const DeepCollectionEquality().hash(allocationLimit),limitationAllocation,const DeepCollectionEquality().hash(registerarRole),const DeepCollectionEquality().hash(registerarFullname),const DeepCollectionEquality().hash(registerarMobile),killHouseRegister,stewardRegister,guildsRoomRegister,posCompanyRegister,provinceAcceptState,const DeepCollectionEquality().hash(provinceMessage),const DeepCollectionEquality().hash(condition),const DeepCollectionEquality().hash(descriptionCondition),stewardActive,const DeepCollectionEquality().hash(stewardAllocationLimit),stewardLimitationAllocation,license,const DeepCollectionEquality().hash(licenseForm),const DeepCollectionEquality().hash(licenseFile),const DeepCollectionEquality().hash(reviewerRole),const DeepCollectionEquality().hash(reviewerFullname),const DeepCollectionEquality().hash(reviewerMobile),const DeepCollectionEquality().hash(checkerMessage),finalAccept,temporaryRegistration,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(userBankInfo),wallet,const DeepCollectionEquality().hash(_cars),const DeepCollectionEquality().hash(_userLevel)]); + +@override +String toString() { + return 'ToSteward(id: $id, user: $user, address: $address, guildAreaActivity: $guildAreaActivity, guildTypeActivity: $guildTypeActivity, killHouse: $killHouse, stewardKillHouse: $stewardKillHouse, stewards: $stewards, getPosStatus: $getPosStatus, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, userIdForeignKey: $userIdForeignKey, addressIdForeignKey: $addressIdForeignKey, userBankIdForeignKey: $userBankIdForeignKey, walletIdForeignKey: $walletIdForeignKey, provincialGovernmentIdKey: $provincialGovernmentIdKey, identityDocuments: $identityDocuments, active: $active, cityNumber: $cityNumber, cityName: $cityName, guildsId: $guildsId, licenseNumber: $licenseNumber, guildsName: $guildsName, phone: $phone, typeActivity: $typeActivity, areaActivity: $areaActivity, provinceNumber: $provinceNumber, provinceName: $provinceName, steward: $steward, hasPos: $hasPos, centersAllocation: $centersAllocation, killHouseCentersAllocation: $killHouseCentersAllocation, allocationLimit: $allocationLimit, limitationAllocation: $limitationAllocation, registerarRole: $registerarRole, registerarFullname: $registerarFullname, registerarMobile: $registerarMobile, killHouseRegister: $killHouseRegister, stewardRegister: $stewardRegister, guildsRoomRegister: $guildsRoomRegister, posCompanyRegister: $posCompanyRegister, provinceAcceptState: $provinceAcceptState, provinceMessage: $provinceMessage, condition: $condition, descriptionCondition: $descriptionCondition, stewardActive: $stewardActive, stewardAllocationLimit: $stewardAllocationLimit, stewardLimitationAllocation: $stewardLimitationAllocation, license: $license, licenseForm: $licenseForm, licenseFile: $licenseFile, reviewerRole: $reviewerRole, reviewerFullname: $reviewerFullname, reviewerMobile: $reviewerMobile, checkerMessage: $checkerMessage, finalAccept: $finalAccept, temporaryRegistration: $temporaryRegistration, createdBy: $createdBy, modifiedBy: $modifiedBy, userBankInfo: $userBankInfo, wallet: $wallet, cars: $cars, userLevel: $userLevel)'; +} + + +} + +/// @nodoc +abstract mixin class _$ToStewardCopyWith<$Res> implements $ToStewardCopyWith<$Res> { + factory _$ToStewardCopyWith(_ToSteward value, $Res Function(_ToSteward) _then) = __$ToStewardCopyWithImpl; +@override @useResult +$Res call({ + int? id, ToStewardUser? user, Address? address, Activity? guildAreaActivity, Activity? guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, PosStatus? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, dynamic userIdForeignKey, dynamic addressIdForeignKey, dynamic userBankIdForeignKey, dynamic walletIdForeignKey, dynamic provincialGovernmentIdKey, dynamic identityDocuments, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, dynamic phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, dynamic centersAllocation, dynamic killHouseCentersAllocation, dynamic allocationLimit, bool? limitationAllocation, dynamic registerarRole, dynamic registerarFullname, dynamic registerarMobile, bool? killHouseRegister, bool? stewardRegister, bool? guildsRoomRegister, bool? posCompanyRegister, String? provinceAcceptState, dynamic provinceMessage, dynamic condition, dynamic descriptionCondition, bool? stewardActive, dynamic stewardAllocationLimit, bool? stewardLimitationAllocation, bool? license, dynamic licenseForm, dynamic licenseFile, dynamic reviewerRole, dynamic reviewerFullname, dynamic reviewerMobile, dynamic checkerMessage, bool? finalAccept, bool? temporaryRegistration, dynamic createdBy, dynamic modifiedBy, dynamic userBankInfo, int? wallet, List? cars, List? userLevel +}); + + +@override $ToStewardUserCopyWith<$Res>? get user;@override $AddressCopyWith<$Res>? get address;@override $ActivityCopyWith<$Res>? get guildAreaActivity;@override $ActivityCopyWith<$Res>? get guildTypeActivity;@override $PosStatusCopyWith<$Res>? get getPosStatus; + +} +/// @nodoc +class __$ToStewardCopyWithImpl<$Res> + implements _$ToStewardCopyWith<$Res> { + __$ToStewardCopyWithImpl(this._self, this._then); + + final _ToSteward _self; + final $Res Function(_ToSteward) _then; + +/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guildAreaActivity = freezed,Object? guildTypeActivity = freezed,Object? killHouse = freezed,Object? stewardKillHouse = freezed,Object? stewards = freezed,Object? getPosStatus = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? userIdForeignKey = freezed,Object? addressIdForeignKey = freezed,Object? userBankIdForeignKey = freezed,Object? walletIdForeignKey = freezed,Object? provincialGovernmentIdKey = freezed,Object? identityDocuments = freezed,Object? active = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? guildsId = freezed,Object? licenseNumber = freezed,Object? guildsName = freezed,Object? phone = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? steward = freezed,Object? hasPos = freezed,Object? centersAllocation = freezed,Object? killHouseCentersAllocation = freezed,Object? allocationLimit = freezed,Object? limitationAllocation = freezed,Object? registerarRole = freezed,Object? registerarFullname = freezed,Object? registerarMobile = freezed,Object? killHouseRegister = freezed,Object? stewardRegister = freezed,Object? guildsRoomRegister = freezed,Object? posCompanyRegister = freezed,Object? provinceAcceptState = freezed,Object? provinceMessage = freezed,Object? condition = freezed,Object? descriptionCondition = freezed,Object? stewardActive = freezed,Object? stewardAllocationLimit = freezed,Object? stewardLimitationAllocation = freezed,Object? license = freezed,Object? licenseForm = freezed,Object? licenseFile = freezed,Object? reviewerRole = freezed,Object? reviewerFullname = freezed,Object? reviewerMobile = freezed,Object? checkerMessage = freezed,Object? finalAccept = freezed,Object? temporaryRegistration = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? userBankInfo = freezed,Object? wallet = freezed,Object? cars = freezed,Object? userLevel = freezed,}) { + return _then(_ToSteward( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as ToStewardUser?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,guildAreaActivity: freezed == guildAreaActivity ? _self.guildAreaActivity : guildAreaActivity // ignore: cast_nullable_to_non_nullable +as Activity?,guildTypeActivity: freezed == guildTypeActivity ? _self.guildTypeActivity : guildTypeActivity // ignore: cast_nullable_to_non_nullable +as Activity?,killHouse: freezed == killHouse ? _self._killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as List?,stewardKillHouse: freezed == stewardKillHouse ? _self._stewardKillHouse : stewardKillHouse // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self._stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,getPosStatus: freezed == getPosStatus ? _self.getPosStatus : getPosStatus // ignore: cast_nullable_to_non_nullable +as PosStatus?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,userIdForeignKey: freezed == userIdForeignKey ? _self.userIdForeignKey : userIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,addressIdForeignKey: freezed == addressIdForeignKey ? _self.addressIdForeignKey : addressIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,userBankIdForeignKey: freezed == userBankIdForeignKey ? _self.userBankIdForeignKey : userBankIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,walletIdForeignKey: freezed == walletIdForeignKey ? _self.walletIdForeignKey : walletIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,provincialGovernmentIdKey: freezed == provincialGovernmentIdKey ? _self.provincialGovernmentIdKey : provincialGovernmentIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,identityDocuments: freezed == identityDocuments ? _self.identityDocuments : identityDocuments // ignore: cast_nullable_to_non_nullable +as dynamic,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as dynamic,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,hasPos: freezed == hasPos ? _self.hasPos : hasPos // ignore: cast_nullable_to_non_nullable +as bool?,centersAllocation: freezed == centersAllocation ? _self.centersAllocation : centersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,killHouseCentersAllocation: freezed == killHouseCentersAllocation ? _self.killHouseCentersAllocation : killHouseCentersAllocation // ignore: cast_nullable_to_non_nullable +as dynamic,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,limitationAllocation: freezed == limitationAllocation ? _self.limitationAllocation : limitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,registerarRole: freezed == registerarRole ? _self.registerarRole : registerarRole // ignore: cast_nullable_to_non_nullable +as dynamic,registerarFullname: freezed == registerarFullname ? _self.registerarFullname : registerarFullname // ignore: cast_nullable_to_non_nullable +as dynamic,registerarMobile: freezed == registerarMobile ? _self.registerarMobile : registerarMobile // ignore: cast_nullable_to_non_nullable +as dynamic,killHouseRegister: freezed == killHouseRegister ? _self.killHouseRegister : killHouseRegister // ignore: cast_nullable_to_non_nullable +as bool?,stewardRegister: freezed == stewardRegister ? _self.stewardRegister : stewardRegister // ignore: cast_nullable_to_non_nullable +as bool?,guildsRoomRegister: freezed == guildsRoomRegister ? _self.guildsRoomRegister : guildsRoomRegister // ignore: cast_nullable_to_non_nullable +as bool?,posCompanyRegister: freezed == posCompanyRegister ? _self.posCompanyRegister : posCompanyRegister // ignore: cast_nullable_to_non_nullable +as bool?,provinceAcceptState: freezed == provinceAcceptState ? _self.provinceAcceptState : provinceAcceptState // ignore: cast_nullable_to_non_nullable +as String?,provinceMessage: freezed == provinceMessage ? _self.provinceMessage : provinceMessage // ignore: cast_nullable_to_non_nullable +as dynamic,condition: freezed == condition ? _self.condition : condition // ignore: cast_nullable_to_non_nullable +as dynamic,descriptionCondition: freezed == descriptionCondition ? _self.descriptionCondition : descriptionCondition // ignore: cast_nullable_to_non_nullable +as dynamic,stewardActive: freezed == stewardActive ? _self.stewardActive : stewardActive // ignore: cast_nullable_to_non_nullable +as bool?,stewardAllocationLimit: freezed == stewardAllocationLimit ? _self.stewardAllocationLimit : stewardAllocationLimit // ignore: cast_nullable_to_non_nullable +as dynamic,stewardLimitationAllocation: freezed == stewardLimitationAllocation ? _self.stewardLimitationAllocation : stewardLimitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,licenseForm: freezed == licenseForm ? _self.licenseForm : licenseForm // ignore: cast_nullable_to_non_nullable +as dynamic,licenseFile: freezed == licenseFile ? _self.licenseFile : licenseFile // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerRole: freezed == reviewerRole ? _self.reviewerRole : reviewerRole // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerFullname: freezed == reviewerFullname ? _self.reviewerFullname : reviewerFullname // ignore: cast_nullable_to_non_nullable +as dynamic,reviewerMobile: freezed == reviewerMobile ? _self.reviewerMobile : reviewerMobile // ignore: cast_nullable_to_non_nullable +as dynamic,checkerMessage: freezed == checkerMessage ? _self.checkerMessage : checkerMessage // ignore: cast_nullable_to_non_nullable +as dynamic,finalAccept: freezed == finalAccept ? _self.finalAccept : finalAccept // ignore: cast_nullable_to_non_nullable +as bool?,temporaryRegistration: freezed == temporaryRegistration ? _self.temporaryRegistration : temporaryRegistration // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,userBankInfo: freezed == userBankInfo ? _self.userBankInfo : userBankInfo // ignore: cast_nullable_to_non_nullable +as dynamic,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self._cars : cars // ignore: cast_nullable_to_non_nullable +as List?,userLevel: freezed == userLevel ? _self._userLevel : userLevel // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ToStewardUserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $ToStewardUserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildAreaActivity { + if (_self.guildAreaActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildAreaActivity!, (value) { + return _then(_self.copyWith(guildAreaActivity: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActivityCopyWith<$Res>? get guildTypeActivity { + if (_self.guildTypeActivity == null) { + return null; + } + + return $ActivityCopyWith<$Res>(_self.guildTypeActivity!, (value) { + return _then(_self.copyWith(guildTypeActivity: value)); + }); +}/// Create a copy of ToSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PosStatusCopyWith<$Res>? get getPosStatus { + if (_self.getPosStatus == null) { + return null; + } + + return $PosStatusCopyWith<$Res>(_self.getPosStatus!, (value) { + return _then(_self.copyWith(getPosStatus: value)); + }); +} +} + + +/// @nodoc +mixin _$ToStewardUser { + + String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get nationalId; String? get city; +/// Create a copy of ToStewardUser +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ToStewardUserCopyWith get copyWith => _$ToStewardUserCopyWithImpl(this as ToStewardUser, _$identity); + + /// Serializes this ToStewardUser to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ToStewardUser&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'ToStewardUser(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $ToStewardUserCopyWith<$Res> { + factory $ToStewardUserCopyWith(ToStewardUser value, $Res Function(ToStewardUser) _then) = _$ToStewardUserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class _$ToStewardUserCopyWithImpl<$Res> + implements $ToStewardUserCopyWith<$Res> { + _$ToStewardUserCopyWithImpl(this._self, this._then); + + final ToStewardUser _self; + final $Res Function(ToStewardUser) _then; + +/// Create a copy of ToStewardUser +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ToStewardUser]. +extension ToStewardUserPatterns on ToStewardUser { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ToStewardUser value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ToStewardUser() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ToStewardUser value) $default,){ +final _that = this; +switch (_that) { +case _ToStewardUser(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ToStewardUser value)? $default,){ +final _that = this; +switch (_that) { +case _ToStewardUser() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ToStewardUser() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city) $default,) {final _that = this; +switch (_that) { +case _ToStewardUser(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,) {final _that = this; +switch (_that) { +case _ToStewardUser() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ToStewardUser implements ToStewardUser { + const _ToStewardUser({this.fullname, this.firstName, this.lastName, this.mobile, this.nationalId, this.city}); + factory _ToStewardUser.fromJson(Map json) => _$ToStewardUserFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? nationalId; +@override final String? city; + +/// Create a copy of ToStewardUser +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ToStewardUserCopyWith<_ToStewardUser> get copyWith => __$ToStewardUserCopyWithImpl<_ToStewardUser>(this, _$identity); + +@override +Map toJson() { + return _$ToStewardUserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ToStewardUser&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'ToStewardUser(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$ToStewardUserCopyWith<$Res> implements $ToStewardUserCopyWith<$Res> { + factory _$ToStewardUserCopyWith(_ToStewardUser value, $Res Function(_ToStewardUser) _then) = __$ToStewardUserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class __$ToStewardUserCopyWithImpl<$Res> + implements _$ToStewardUserCopyWith<$Res> { + __$ToStewardUserCopyWithImpl(this._self, this._then); + + final _ToStewardUser _self; + final $Res Function(_ToStewardUser) _then; + +/// Create a copy of ToStewardUser +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_ToStewardUser( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Address { + + Province? get province; CitySimple? get city; String? get address; String? get postalCode; +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressCopyWith
get copyWith => _$AddressCopyWithImpl
(this as Address, _$identity); + + /// Serializes this Address to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $AddressCopyWith<$Res> { + factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl; +@useResult +$Res call({ + Province? province, CitySimple? city, String? address, String? postalCode +}); + + +$ProvinceCopyWith<$Res>? get province;$CitySimpleCopyWith<$Res>? get city; + +} +/// @nodoc +class _$AddressCopyWithImpl<$Res> + implements $AddressCopyWith<$Res> { + _$AddressCopyWithImpl(this._self, this._then); + + final Address _self; + final $Res Function(Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as CitySimple?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CitySimpleCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CitySimpleCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Address]. +extension AddressPatterns on Address { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Address value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Address value) $default,){ +final _that = this; +switch (_that) { +case _Address(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Address value)? $default,){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Province? province, CitySimple? city, String? address, String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Province? province, CitySimple? city, String? address, String? postalCode) $default,) {final _that = this; +switch (_that) { +case _Address(): +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Province? province, CitySimple? city, String? address, String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Address implements Address { + const _Address({this.province, this.city, this.address, this.postalCode}); + factory _Address.fromJson(Map json) => _$AddressFromJson(json); + +@override final Province? province; +@override final CitySimple? city; +@override final String? address; +@override final String? postalCode; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity); + +@override +Map toJson() { + return _$AddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> { + factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl; +@override @useResult +$Res call({ + Province? province, CitySimple? city, String? address, String? postalCode +}); + + +@override $ProvinceCopyWith<$Res>? get province;@override $CitySimpleCopyWith<$Res>? get city; + +} +/// @nodoc +class __$AddressCopyWithImpl<$Res> + implements _$AddressCopyWith<$Res> { + __$AddressCopyWithImpl(this._self, this._then); + + final _Address _self; + final $Res Function(_Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_Address( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as CitySimple?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CitySimpleCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CitySimpleCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$Province { + + String? get key; String? get name; +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProvinceCopyWith get copyWith => _$ProvinceCopyWithImpl(this as Province, _$identity); + + /// Serializes this Province to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProvinceCopyWith<$Res> { + factory $ProvinceCopyWith(Province value, $Res Function(Province) _then) = _$ProvinceCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$ProvinceCopyWithImpl<$Res> + implements $ProvinceCopyWith<$Res> { + _$ProvinceCopyWithImpl(this._self, this._then); + + final Province _self; + final $Res Function(Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Province]. +extension ProvincePatterns on Province { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Province value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Province value) $default,){ +final _that = this; +switch (_that) { +case _Province(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Province value)? $default,){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _Province(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Province implements Province { + const _Province({this.key, this.name}); + factory _Province.fromJson(Map json) => _$ProvinceFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProvinceCopyWith<_Province> get copyWith => __$ProvinceCopyWithImpl<_Province>(this, _$identity); + +@override +Map toJson() { + return _$ProvinceToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProvinceCopyWith<$Res> implements $ProvinceCopyWith<$Res> { + factory _$ProvinceCopyWith(_Province value, $Res Function(_Province) _then) = __$ProvinceCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$ProvinceCopyWithImpl<$Res> + implements _$ProvinceCopyWith<$Res> { + __$ProvinceCopyWithImpl(this._self, this._then); + + final _Province _self; + final $Res Function(_Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_Province( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$CitySimple { + + String? get key; String? get name; +/// Create a copy of CitySimple +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CitySimpleCopyWith get copyWith => _$CitySimpleCopyWithImpl(this as CitySimple, _$identity); + + /// Serializes this CitySimple to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CitySimple&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'CitySimple(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $CitySimpleCopyWith<$Res> { + factory $CitySimpleCopyWith(CitySimple value, $Res Function(CitySimple) _then) = _$CitySimpleCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$CitySimpleCopyWithImpl<$Res> + implements $CitySimpleCopyWith<$Res> { + _$CitySimpleCopyWithImpl(this._self, this._then); + + final CitySimple _self; + final $Res Function(CitySimple) _then; + +/// Create a copy of CitySimple +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CitySimple]. +extension CitySimplePatterns on CitySimple { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CitySimple value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CitySimple() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CitySimple value) $default,){ +final _that = this; +switch (_that) { +case _CitySimple(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CitySimple value)? $default,){ +final _that = this; +switch (_that) { +case _CitySimple() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CitySimple() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _CitySimple(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _CitySimple() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CitySimple implements CitySimple { + const _CitySimple({this.key, this.name}); + factory _CitySimple.fromJson(Map json) => _$CitySimpleFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of CitySimple +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CitySimpleCopyWith<_CitySimple> get copyWith => __$CitySimpleCopyWithImpl<_CitySimple>(this, _$identity); + +@override +Map toJson() { + return _$CitySimpleToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CitySimple&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'CitySimple(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$CitySimpleCopyWith<$Res> implements $CitySimpleCopyWith<$Res> { + factory _$CitySimpleCopyWith(_CitySimple value, $Res Function(_CitySimple) _then) = __$CitySimpleCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$CitySimpleCopyWithImpl<$Res> + implements _$CitySimpleCopyWith<$Res> { + __$CitySimpleCopyWithImpl(this._self, this._then); + + final _CitySimple _self; + final $Res Function(_CitySimple) _then; + +/// Create a copy of CitySimple +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_CitySimple( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Activity { + + String? get key; String? get title; +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ActivityCopyWith get copyWith => _$ActivityCopyWithImpl(this as Activity, _$identity); + + /// Serializes this Activity to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Activity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'Activity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class $ActivityCopyWith<$Res> { + factory $ActivityCopyWith(Activity value, $Res Function(Activity) _then) = _$ActivityCopyWithImpl; +@useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class _$ActivityCopyWithImpl<$Res> + implements $ActivityCopyWith<$Res> { + _$ActivityCopyWithImpl(this._self, this._then); + + final Activity _self; + final $Res Function(Activity) _then; + +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Activity]. +extension ActivityPatterns on Activity { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Activity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Activity value) $default,){ +final _that = this; +switch (_that) { +case _Activity(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Activity value)? $default,){ +final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? title)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that.key,_that.title);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? title) $default,) {final _that = this; +switch (_that) { +case _Activity(): +return $default(_that.key,_that.title);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? title)? $default,) {final _that = this; +switch (_that) { +case _Activity() when $default != null: +return $default(_that.key,_that.title);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Activity implements Activity { + const _Activity({this.key, this.title}); + factory _Activity.fromJson(Map json) => _$ActivityFromJson(json); + +@override final String? key; +@override final String? title; + +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ActivityCopyWith<_Activity> get copyWith => __$ActivityCopyWithImpl<_Activity>(this, _$identity); + +@override +Map toJson() { + return _$ActivityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Activity&&(identical(other.key, key) || other.key == key)&&(identical(other.title, title) || other.title == title)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,title); + +@override +String toString() { + return 'Activity(key: $key, title: $title)'; +} + + +} + +/// @nodoc +abstract mixin class _$ActivityCopyWith<$Res> implements $ActivityCopyWith<$Res> { + factory _$ActivityCopyWith(_Activity value, $Res Function(_Activity) _then) = __$ActivityCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? title +}); + + + + +} +/// @nodoc +class __$ActivityCopyWithImpl<$Res> + implements _$ActivityCopyWith<$Res> { + __$ActivityCopyWithImpl(this._self, this._then); + + final _Activity _self; + final $Res Function(_Activity) _then; + +/// Create a copy of Activity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? title = freezed,}) { + return _then(_Activity( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$PosStatus { + + int? get lenActiveSessions; bool? get hasPons; bool? get hasActivePons; +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PosStatusCopyWith get copyWith => _$PosStatusCopyWithImpl(this as PosStatus, _$identity); + + /// Serializes this PosStatus to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PosStatus&&(identical(other.lenActiveSessions, lenActiveSessions) || other.lenActiveSessions == lenActiveSessions)&&(identical(other.hasPons, hasPons) || other.hasPons == hasPons)&&(identical(other.hasActivePons, hasActivePons) || other.hasActivePons == hasActivePons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lenActiveSessions,hasPons,hasActivePons); + +@override +String toString() { + return 'PosStatus(lenActiveSessions: $lenActiveSessions, hasPons: $hasPons, hasActivePons: $hasActivePons)'; +} + + +} + +/// @nodoc +abstract mixin class $PosStatusCopyWith<$Res> { + factory $PosStatusCopyWith(PosStatus value, $Res Function(PosStatus) _then) = _$PosStatusCopyWithImpl; +@useResult +$Res call({ + int? lenActiveSessions, bool? hasPons, bool? hasActivePons +}); + + + + +} +/// @nodoc +class _$PosStatusCopyWithImpl<$Res> + implements $PosStatusCopyWith<$Res> { + _$PosStatusCopyWithImpl(this._self, this._then); + + final PosStatus _self; + final $Res Function(PosStatus) _then; + +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? lenActiveSessions = freezed,Object? hasPons = freezed,Object? hasActivePons = freezed,}) { + return _then(_self.copyWith( +lenActiveSessions: freezed == lenActiveSessions ? _self.lenActiveSessions : lenActiveSessions // ignore: cast_nullable_to_non_nullable +as int?,hasPons: freezed == hasPons ? _self.hasPons : hasPons // ignore: cast_nullable_to_non_nullable +as bool?,hasActivePons: freezed == hasActivePons ? _self.hasActivePons : hasActivePons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PosStatus]. +extension PosStatusPatterns on PosStatus { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PosStatus value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PosStatus value) $default,){ +final _that = this; +switch (_that) { +case _PosStatus(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PosStatus value)? $default,){ +final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons) $default,) {final _that = this; +switch (_that) { +case _PosStatus(): +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons)? $default,) {final _that = this; +switch (_that) { +case _PosStatus() when $default != null: +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PosStatus implements PosStatus { + const _PosStatus({this.lenActiveSessions, this.hasPons, this.hasActivePons}); + factory _PosStatus.fromJson(Map json) => _$PosStatusFromJson(json); + +@override final int? lenActiveSessions; +@override final bool? hasPons; +@override final bool? hasActivePons; + +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PosStatusCopyWith<_PosStatus> get copyWith => __$PosStatusCopyWithImpl<_PosStatus>(this, _$identity); + +@override +Map toJson() { + return _$PosStatusToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PosStatus&&(identical(other.lenActiveSessions, lenActiveSessions) || other.lenActiveSessions == lenActiveSessions)&&(identical(other.hasPons, hasPons) || other.hasPons == hasPons)&&(identical(other.hasActivePons, hasActivePons) || other.hasActivePons == hasActivePons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lenActiveSessions,hasPons,hasActivePons); + +@override +String toString() { + return 'PosStatus(lenActiveSessions: $lenActiveSessions, hasPons: $hasPons, hasActivePons: $hasActivePons)'; +} + + +} + +/// @nodoc +abstract mixin class _$PosStatusCopyWith<$Res> implements $PosStatusCopyWith<$Res> { + factory _$PosStatusCopyWith(_PosStatus value, $Res Function(_PosStatus) _then) = __$PosStatusCopyWithImpl; +@override @useResult +$Res call({ + int? lenActiveSessions, bool? hasPons, bool? hasActivePons +}); + + + + +} +/// @nodoc +class __$PosStatusCopyWithImpl<$Res> + implements _$PosStatusCopyWith<$Res> { + __$PosStatusCopyWithImpl(this._self, this._then); + + final _PosStatus _self; + final $Res Function(_PosStatus) _then; + +/// Create a copy of PosStatus +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? lenActiveSessions = freezed,Object? hasPons = freezed,Object? hasActivePons = freezed,}) { + return _then(_PosStatus( +lenActiveSessions: freezed == lenActiveSessions ? _self.lenActiveSessions : lenActiveSessions // ignore: cast_nullable_to_non_nullable +as int?,hasPons: freezed == hasPons ? _self.hasPons : hasPons // ignore: cast_nullable_to_non_nullable +as bool?,hasActivePons: freezed == hasActivePons ? _self.hasActivePons : hasActivePons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart new file mode 100644 index 0000000..30d28f0 --- /dev/null +++ b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart @@ -0,0 +1,473 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'imported_loads_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_ImportedLoadsModel _$ImportedLoadsModelFromJson( + Map json, +) => _ImportedLoadsModel( + id: (json['id'] as num?)?.toInt(), + product: json['product'] == null + ? null + : Product.fromJson(json['product'] as Map), + killHouse: json['kill_house'] == null + ? null + : KillHouse.fromJson(json['kill_house'] as Map), + toKillHouse: json['to_kill_house'], + steward: json['steward'], + toSteward: json['to_steward'] == null + ? null + : ToSteward.fromJson(json['to_steward'] as Map), + guilds: json['guilds'], + toGuilds: json['to_guilds'], + toColdHouse: json['to_cold_house'], + indexWeight: (json['index_weight'] as num?)?.toInt(), + dateTimestamp: (json['date_timestamp'] as num?)?.toInt(), + newState: (json['new_state'] as num?)?.toInt(), + newReceiverState: (json['new_receiver_state'] as num?)?.toInt(), + newAllocationState: (json['new_allocation_state'] as num?)?.toInt(), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(), + receiverRealNumberOfCarcasses: + (json['receiver_real_number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(), + realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(), + receiverRealWeightOfCarcasses: + (json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(), + weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(), + finalRegistration: json['final_registration'] as bool?, + sellType: json['sell_type'] as String?, + productName: json['product_name'] as String?, + sellerType: json['seller_type'] as String?, + type: json['type'] as String?, + saleType: json['sale_type'] as String?, + allocationType: json['allocation_type'] as String?, + systemRegistrationCode: json['system_registration_code'] as bool?, + registrationCode: (json['registration_code'] as num?)?.toInt(), + amount: (json['amount'] as num?)?.toInt(), + totalAmount: (json['total_amount'] as num?)?.toInt(), + totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(), + totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(), + loggedRegistrationCode: json['logged_registration_code'], + state: json['state'] as String?, + receiverState: json['receiver_state'] as String?, + allocationState: json['allocation_state'] as String?, + date: json['date'] as String?, + role: json['role'], + stewardTempKey: json['steward_temp_key'], + approvedPriceStatus: json['approved_price_status'] as bool?, + calculateStatus: json['calculate_status'] as bool?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + wareHouse: json['ware_house'], + stewardWareHouse: json['steward_ware_house'], + car: json['car'], + dispenser: json['dispenser'], +); + +Map _$ImportedLoadsModelToJson( + _ImportedLoadsModel instance, +) => { + 'id': instance.id, + 'product': instance.product, + 'kill_house': instance.killHouse, + 'to_kill_house': instance.toKillHouse, + 'steward': instance.steward, + 'to_steward': instance.toSteward, + 'guilds': instance.guilds, + 'to_guilds': instance.toGuilds, + 'to_cold_house': instance.toColdHouse, + 'index_weight': instance.indexWeight, + 'date_timestamp': instance.dateTimestamp, + 'new_state': instance.newState, + 'new_receiver_state': instance.newReceiverState, + 'new_allocation_state': instance.newAllocationState, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'number_of_carcasses': instance.numberOfCarcasses, + 'real_number_of_carcasses': instance.realNumberOfCarcasses, + 'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'real_weight_of_carcasses': instance.realWeightOfCarcasses, + 'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses, + 'weight_loss_of_carcasses': instance.weightLossOfCarcasses, + 'final_registration': instance.finalRegistration, + 'sell_type': instance.sellType, + 'product_name': instance.productName, + 'seller_type': instance.sellerType, + 'type': instance.type, + 'sale_type': instance.saleType, + 'allocation_type': instance.allocationType, + 'system_registration_code': instance.systemRegistrationCode, + 'registration_code': instance.registrationCode, + 'amount': instance.amount, + 'total_amount': instance.totalAmount, + 'total_amount_paid': instance.totalAmountPaid, + 'total_amount_remain': instance.totalAmountRemain, + 'logged_registration_code': instance.loggedRegistrationCode, + 'state': instance.state, + 'receiver_state': instance.receiverState, + 'allocation_state': instance.allocationState, + 'date': instance.date, + 'role': instance.role, + 'steward_temp_key': instance.stewardTempKey, + 'approved_price_status': instance.approvedPriceStatus, + 'calculate_status': instance.calculateStatus, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'ware_house': instance.wareHouse, + 'steward_ware_house': instance.stewardWareHouse, + 'car': instance.car, + 'dispenser': instance.dispenser, +}; + +_Product _$ProductFromJson(Map json) => + _Product(weightAverage: (json['weight_average'] as num?)?.toDouble()); + +Map _$ProductToJson(_Product instance) => { + 'weight_average': instance.weightAverage, +}; + +_KillHouse _$KillHouseFromJson(Map json) => _KillHouse( + key: json['key'] as String?, + killHouseOperator: json['kill_house_operator'] == null + ? null + : KillHouseOperator.fromJson( + json['kill_house_operator'] as Map, + ), + name: json['name'] as String?, + killer: json['killer'] as bool?, +); + +Map _$KillHouseToJson(_KillHouse instance) => + { + 'key': instance.key, + 'kill_house_operator': instance.killHouseOperator, + 'name': instance.name, + 'killer': instance.killer, + }; + +_KillHouseOperator _$KillHouseOperatorFromJson(Map json) => + _KillHouseOperator( + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), + ); + +Map _$KillHouseOperatorToJson(_KillHouseOperator instance) => + {'user': instance.user}; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + baseOrder: (json['base_order'] as num?)?.toInt(), + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + nationalCode: json['national_code'] as String?, + key: json['key'] as String?, + city: json['city'] == null + ? null + : City.fromJson(json['city'] as Map), + unitName: json['unit_name'] as String?, + unitNationalId: json['unit_national_id'] as String?, + unitRegistrationNumber: json['unit_registration_number'] as String?, + unitEconomicalNumber: json['unit_economical_number'] as String?, + unitProvince: json['unit_province'] as String?, + unitCity: json['unit_city'] as String?, + unitPostalCode: json['unit_postal_code'] as String?, + unitAddress: json['unit_address'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'base_order': instance.baseOrder, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'national_code': instance.nationalCode, + 'key': instance.key, + 'city': instance.city, + 'unit_name': instance.unitName, + 'unit_national_id': instance.unitNationalId, + 'unit_registration_number': instance.unitRegistrationNumber, + 'unit_economical_number': instance.unitEconomicalNumber, + 'unit_province': instance.unitProvince, + 'unit_city': instance.unitCity, + 'unit_postal_code': instance.unitPostalCode, + 'unit_address': instance.unitAddress, +}; + +_City _$CityFromJson(Map json) => _City( + id: (json['id'] as num?)?.toInt(), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(), + cityIdKey: (json['city_id_key'] as num?)?.toInt(), + name: json['name'] as String?, + productPrice: (json['product_price'] as num?)?.toDouble(), + provinceCenter: json['province_center'] as bool?, + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + province: (json['province'] as num?)?.toInt(), +); + +Map _$CityToJson(_City instance) => { + 'id': instance.id, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'province_id_foreign_key': instance.provinceIdForeignKey, + 'city_id_key': instance.cityIdKey, + 'name': instance.name, + 'product_price': instance.productPrice, + 'province_center': instance.provinceCenter, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'province': instance.province, +}; + +_ToSteward _$ToStewardFromJson(Map json) => _ToSteward( + id: (json['id'] as num?)?.toInt(), + user: json['user'] == null + ? null + : ToStewardUser.fromJson(json['user'] as Map), + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + guildAreaActivity: json['guild_area_activity'] == null + ? null + : Activity.fromJson(json['guild_area_activity'] as Map), + guildTypeActivity: json['guild_type_activity'] == null + ? null + : Activity.fromJson(json['guild_type_activity'] as Map), + killHouse: json['kill_house'] as List?, + stewardKillHouse: json['steward_kill_house'] as List?, + stewards: json['stewards'] as List?, + getPosStatus: json['get_pos_status'] == null + ? null + : PosStatus.fromJson(json['get_pos_status'] as Map), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + userIdForeignKey: json['user_id_foreign_key'], + addressIdForeignKey: json['address_id_foreign_key'], + userBankIdForeignKey: json['user_bank_id_foreign_key'], + walletIdForeignKey: json['wallet_id_foreign_key'], + provincialGovernmentIdKey: json['provincial_government_id_key'], + identityDocuments: json['identity_documents'], + active: json['active'] as bool?, + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + guildsId: json['guilds_id'] as String?, + licenseNumber: json['license_number'] as String?, + guildsName: json['guilds_name'] as String?, + phone: json['phone'], + typeActivity: json['type_activity'] as String?, + areaActivity: json['area_activity'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + steward: json['steward'] as bool?, + hasPos: json['has_pos'] as bool?, + centersAllocation: json['centers_allocation'], + killHouseCentersAllocation: json['kill_house_centers_allocation'], + allocationLimit: json['allocation_limit'], + limitationAllocation: json['limitation_allocation'] as bool?, + registerarRole: json['registerar_role'], + registerarFullname: json['registerar_fullname'], + registerarMobile: json['registerar_mobile'], + killHouseRegister: json['kill_house_register'] as bool?, + stewardRegister: json['steward_register'] as bool?, + guildsRoomRegister: json['guilds_room_register'] as bool?, + posCompanyRegister: json['pos_company_register'] as bool?, + provinceAcceptState: json['province_accept_state'] as String?, + provinceMessage: json['province_message'], + condition: json['condition'], + descriptionCondition: json['description_condition'], + stewardActive: json['steward_active'] as bool?, + stewardAllocationLimit: json['steward_allocation_limit'], + stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?, + license: json['license'] as bool?, + licenseForm: json['license_form'], + licenseFile: json['license_file'], + reviewerRole: json['reviewer_role'], + reviewerFullname: json['reviewer_fullname'], + reviewerMobile: json['reviewer_mobile'], + checkerMessage: json['checker_message'], + finalAccept: json['final_accept'] as bool?, + temporaryRegistration: json['temporary_registration'] as bool?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + userBankInfo: json['user_bank_info'], + wallet: (json['wallet'] as num?)?.toInt(), + cars: json['cars'] as List?, + userLevel: json['user_level'] as List?, +); + +Map _$ToStewardToJson(_ToSteward instance) => + { + 'id': instance.id, + 'user': instance.user, + 'address': instance.address, + 'guild_area_activity': instance.guildAreaActivity, + 'guild_type_activity': instance.guildTypeActivity, + 'kill_house': instance.killHouse, + 'steward_kill_house': instance.stewardKillHouse, + 'stewards': instance.stewards, + 'get_pos_status': instance.getPosStatus, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'user_id_foreign_key': instance.userIdForeignKey, + 'address_id_foreign_key': instance.addressIdForeignKey, + 'user_bank_id_foreign_key': instance.userBankIdForeignKey, + 'wallet_id_foreign_key': instance.walletIdForeignKey, + 'provincial_government_id_key': instance.provincialGovernmentIdKey, + 'identity_documents': instance.identityDocuments, + 'active': instance.active, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'guilds_id': instance.guildsId, + 'license_number': instance.licenseNumber, + 'guilds_name': instance.guildsName, + 'phone': instance.phone, + 'type_activity': instance.typeActivity, + 'area_activity': instance.areaActivity, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'steward': instance.steward, + 'has_pos': instance.hasPos, + 'centers_allocation': instance.centersAllocation, + 'kill_house_centers_allocation': instance.killHouseCentersAllocation, + 'allocation_limit': instance.allocationLimit, + 'limitation_allocation': instance.limitationAllocation, + 'registerar_role': instance.registerarRole, + 'registerar_fullname': instance.registerarFullname, + 'registerar_mobile': instance.registerarMobile, + 'kill_house_register': instance.killHouseRegister, + 'steward_register': instance.stewardRegister, + 'guilds_room_register': instance.guildsRoomRegister, + 'pos_company_register': instance.posCompanyRegister, + 'province_accept_state': instance.provinceAcceptState, + 'province_message': instance.provinceMessage, + 'condition': instance.condition, + 'description_condition': instance.descriptionCondition, + 'steward_active': instance.stewardActive, + 'steward_allocation_limit': instance.stewardAllocationLimit, + 'steward_limitation_allocation': instance.stewardLimitationAllocation, + 'license': instance.license, + 'license_form': instance.licenseForm, + 'license_file': instance.licenseFile, + 'reviewer_role': instance.reviewerRole, + 'reviewer_fullname': instance.reviewerFullname, + 'reviewer_mobile': instance.reviewerMobile, + 'checker_message': instance.checkerMessage, + 'final_accept': instance.finalAccept, + 'temporary_registration': instance.temporaryRegistration, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'user_bank_info': instance.userBankInfo, + 'wallet': instance.wallet, + 'cars': instance.cars, + 'user_level': instance.userLevel, + }; + +_ToStewardUser _$ToStewardUserFromJson(Map json) => + _ToStewardUser( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + city: json['city'] as String?, + ); + +Map _$ToStewardUserToJson(_ToStewardUser instance) => + { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'city': instance.city, + }; + +_Address _$AddressFromJson(Map json) => _Address( + province: json['province'] == null + ? null + : Province.fromJson(json['province'] as Map), + city: json['city'] == null + ? null + : CitySimple.fromJson(json['city'] as Map), + address: json['address'] as String?, + postalCode: json['postal_code'] as String?, +); + +Map _$AddressToJson(_Address instance) => { + 'province': instance.province, + 'city': instance.city, + 'address': instance.address, + 'postal_code': instance.postalCode, +}; + +_Province _$ProvinceFromJson(Map json) => + _Province(key: json['key'] as String?, name: json['name'] as String?); + +Map _$ProvinceToJson(_Province instance) => { + 'key': instance.key, + 'name': instance.name, +}; + +_CitySimple _$CitySimpleFromJson(Map json) => + _CitySimple(key: json['key'] as String?, name: json['name'] as String?); + +Map _$CitySimpleToJson(_CitySimple instance) => + {'key': instance.key, 'name': instance.name}; + +_Activity _$ActivityFromJson(Map json) => + _Activity(key: json['key'] as String?, title: json['title'] as String?); + +Map _$ActivityToJson(_Activity instance) => { + 'key': instance.key, + 'title': instance.title, +}; + +_PosStatus _$PosStatusFromJson(Map json) => _PosStatus( + lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(), + hasPons: json['has_pons'] as bool?, + hasActivePons: json['has_active_pons'] as bool?, +); + +Map _$PosStatusToJson(_PosStatus instance) => + { + 'len_active_sessions': instance.lenActiveSessions, + 'has_pons': instance.hasPons, + 'has_active_pons': instance.hasActivePons, + }; diff --git a/packages/chicken/lib/data/models/response/inventory/inventory_model.dart b/packages/chicken/lib/data/models/response/inventory/inventory_model.dart new file mode 100644 index 0000000..b6ed7c6 --- /dev/null +++ b/packages/chicken/lib/data/models/response/inventory/inventory_model.dart @@ -0,0 +1,56 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'inventory_model.freezed.dart'; +part 'inventory_model.g.dart'; + +@freezed +abstract class InventoryModel with _$InventoryModel { + const factory InventoryModel({ + int? id, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + String? name, + int? provinceGovernmentalCarcassesQuantity, + int? provinceGovernmentalCarcassesWeight, + int? provinceFreeCarcassesQuantity, + int? provinceFreeCarcassesWeight, + int? receiveGovernmentalCarcassesQuantity, + int? receiveGovernmentalCarcassesWeight, + int? receiveFreeCarcassesQuantity, + int? receiveFreeCarcassesWeight, + int? freeBuyingCarcassesQuantity, + int? freeBuyingCarcassesWeight, + int? totalGovernmentalCarcassesQuantity, + int? totalGovernmentalCarcassesWeight, + int? totalFreeBarsCarcassesQuantity, + int? totalFreeBarsCarcassesWeight, + double? weightAverage, + int? totalCarcassesQuantity, + int? totalCarcassesWeight, + int? freezingQuantity, + int? freezingWeight, + int? lossWeight, + int? outProvinceAllocatedQuantity, + int? outProvinceAllocatedWeight, + int? provinceAllocatedQuantity, + int? provinceAllocatedWeight, + int? realAllocatedQuantity, + int? realAllocatedWeight, + int? coldHouseAllocatedWeight, + int? posAllocatedWeight, + int? segmentationWeight, + int? totalRemainQuantity, + int? totalRemainWeight, + int? freePrice, + int? approvedPrice, + bool? approvedPriceStatus, + int? parentProduct, + int? killHouse, + int? guild, + }) = _InventoryModel; // Changed to _InventoryModel + + factory InventoryModel.fromJson(Map json) => + _$InventoryModelFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/inventory/inventory_model.freezed.dart b/packages/chicken/lib/data/models/response/inventory/inventory_model.freezed.dart new file mode 100644 index 0000000..9c0ac0d --- /dev/null +++ b/packages/chicken/lib/data/models/response/inventory/inventory_model.freezed.dart @@ -0,0 +1,403 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'inventory_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$InventoryModel { + + int? get id; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get name; int? get provinceGovernmentalCarcassesQuantity; int? get provinceGovernmentalCarcassesWeight; int? get provinceFreeCarcassesQuantity; int? get provinceFreeCarcassesWeight; int? get receiveGovernmentalCarcassesQuantity; int? get receiveGovernmentalCarcassesWeight; int? get receiveFreeCarcassesQuantity; int? get receiveFreeCarcassesWeight; int? get freeBuyingCarcassesQuantity; int? get freeBuyingCarcassesWeight; int? get totalGovernmentalCarcassesQuantity; int? get totalGovernmentalCarcassesWeight; int? get totalFreeBarsCarcassesQuantity; int? get totalFreeBarsCarcassesWeight; double? get weightAverage; int? get totalCarcassesQuantity; int? get totalCarcassesWeight; int? get freezingQuantity; int? get freezingWeight; int? get lossWeight; int? get outProvinceAllocatedQuantity; int? get outProvinceAllocatedWeight; int? get provinceAllocatedQuantity; int? get provinceAllocatedWeight; int? get realAllocatedQuantity; int? get realAllocatedWeight; int? get coldHouseAllocatedWeight; int? get posAllocatedWeight; int? get segmentationWeight; int? get totalRemainQuantity; int? get totalRemainWeight; int? get freePrice; int? get approvedPrice; bool? get approvedPriceStatus; int? get parentProduct; int? get killHouse; int? get guild; +/// Create a copy of InventoryModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$InventoryModelCopyWith get copyWith => _$InventoryModelCopyWithImpl(this as InventoryModel, _$identity); + + /// Serializes this InventoryModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is InventoryModel&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.name, name) || other.name == name)&&(identical(other.provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesQuantity) || other.provinceGovernmentalCarcassesQuantity == provinceGovernmentalCarcassesQuantity)&&(identical(other.provinceGovernmentalCarcassesWeight, provinceGovernmentalCarcassesWeight) || other.provinceGovernmentalCarcassesWeight == provinceGovernmentalCarcassesWeight)&&(identical(other.provinceFreeCarcassesQuantity, provinceFreeCarcassesQuantity) || other.provinceFreeCarcassesQuantity == provinceFreeCarcassesQuantity)&&(identical(other.provinceFreeCarcassesWeight, provinceFreeCarcassesWeight) || other.provinceFreeCarcassesWeight == provinceFreeCarcassesWeight)&&(identical(other.receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesQuantity) || other.receiveGovernmentalCarcassesQuantity == receiveGovernmentalCarcassesQuantity)&&(identical(other.receiveGovernmentalCarcassesWeight, receiveGovernmentalCarcassesWeight) || other.receiveGovernmentalCarcassesWeight == receiveGovernmentalCarcassesWeight)&&(identical(other.receiveFreeCarcassesQuantity, receiveFreeCarcassesQuantity) || other.receiveFreeCarcassesQuantity == receiveFreeCarcassesQuantity)&&(identical(other.receiveFreeCarcassesWeight, receiveFreeCarcassesWeight) || other.receiveFreeCarcassesWeight == receiveFreeCarcassesWeight)&&(identical(other.freeBuyingCarcassesQuantity, freeBuyingCarcassesQuantity) || other.freeBuyingCarcassesQuantity == freeBuyingCarcassesQuantity)&&(identical(other.freeBuyingCarcassesWeight, freeBuyingCarcassesWeight) || other.freeBuyingCarcassesWeight == freeBuyingCarcassesWeight)&&(identical(other.totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesQuantity) || other.totalGovernmentalCarcassesQuantity == totalGovernmentalCarcassesQuantity)&&(identical(other.totalGovernmentalCarcassesWeight, totalGovernmentalCarcassesWeight) || other.totalGovernmentalCarcassesWeight == totalGovernmentalCarcassesWeight)&&(identical(other.totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesQuantity) || other.totalFreeBarsCarcassesQuantity == totalFreeBarsCarcassesQuantity)&&(identical(other.totalFreeBarsCarcassesWeight, totalFreeBarsCarcassesWeight) || other.totalFreeBarsCarcassesWeight == totalFreeBarsCarcassesWeight)&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)&&(identical(other.totalCarcassesQuantity, totalCarcassesQuantity) || other.totalCarcassesQuantity == totalCarcassesQuantity)&&(identical(other.totalCarcassesWeight, totalCarcassesWeight) || other.totalCarcassesWeight == totalCarcassesWeight)&&(identical(other.freezingQuantity, freezingQuantity) || other.freezingQuantity == freezingQuantity)&&(identical(other.freezingWeight, freezingWeight) || other.freezingWeight == freezingWeight)&&(identical(other.lossWeight, lossWeight) || other.lossWeight == lossWeight)&&(identical(other.outProvinceAllocatedQuantity, outProvinceAllocatedQuantity) || other.outProvinceAllocatedQuantity == outProvinceAllocatedQuantity)&&(identical(other.outProvinceAllocatedWeight, outProvinceAllocatedWeight) || other.outProvinceAllocatedWeight == outProvinceAllocatedWeight)&&(identical(other.provinceAllocatedQuantity, provinceAllocatedQuantity) || other.provinceAllocatedQuantity == provinceAllocatedQuantity)&&(identical(other.provinceAllocatedWeight, provinceAllocatedWeight) || other.provinceAllocatedWeight == provinceAllocatedWeight)&&(identical(other.realAllocatedQuantity, realAllocatedQuantity) || other.realAllocatedQuantity == realAllocatedQuantity)&&(identical(other.realAllocatedWeight, realAllocatedWeight) || other.realAllocatedWeight == realAllocatedWeight)&&(identical(other.coldHouseAllocatedWeight, coldHouseAllocatedWeight) || other.coldHouseAllocatedWeight == coldHouseAllocatedWeight)&&(identical(other.posAllocatedWeight, posAllocatedWeight) || other.posAllocatedWeight == posAllocatedWeight)&&(identical(other.segmentationWeight, segmentationWeight) || other.segmentationWeight == segmentationWeight)&&(identical(other.totalRemainQuantity, totalRemainQuantity) || other.totalRemainQuantity == totalRemainQuantity)&&(identical(other.totalRemainWeight, totalRemainWeight) || other.totalRemainWeight == totalRemainWeight)&&(identical(other.freePrice, freePrice) || other.freePrice == freePrice)&&(identical(other.approvedPrice, approvedPrice) || other.approvedPrice == approvedPrice)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.parentProduct, parentProduct) || other.parentProduct == parentProduct)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&(identical(other.guild, guild) || other.guild == guild)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,key,createDate,modifyDate,trash,name,provinceGovernmentalCarcassesQuantity,provinceGovernmentalCarcassesWeight,provinceFreeCarcassesQuantity,provinceFreeCarcassesWeight,receiveGovernmentalCarcassesQuantity,receiveGovernmentalCarcassesWeight,receiveFreeCarcassesQuantity,receiveFreeCarcassesWeight,freeBuyingCarcassesQuantity,freeBuyingCarcassesWeight,totalGovernmentalCarcassesQuantity,totalGovernmentalCarcassesWeight,totalFreeBarsCarcassesQuantity,totalFreeBarsCarcassesWeight,weightAverage,totalCarcassesQuantity,totalCarcassesWeight,freezingQuantity,freezingWeight,lossWeight,outProvinceAllocatedQuantity,outProvinceAllocatedWeight,provinceAllocatedQuantity,provinceAllocatedWeight,realAllocatedQuantity,realAllocatedWeight,coldHouseAllocatedWeight,posAllocatedWeight,segmentationWeight,totalRemainQuantity,totalRemainWeight,freePrice,approvedPrice,approvedPriceStatus,parentProduct,killHouse,guild]); + +@override +String toString() { + return 'InventoryModel(id: $id, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, name: $name, provinceGovernmentalCarcassesQuantity: $provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesWeight: $provinceGovernmentalCarcassesWeight, provinceFreeCarcassesQuantity: $provinceFreeCarcassesQuantity, provinceFreeCarcassesWeight: $provinceFreeCarcassesWeight, receiveGovernmentalCarcassesQuantity: $receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesWeight: $receiveGovernmentalCarcassesWeight, receiveFreeCarcassesQuantity: $receiveFreeCarcassesQuantity, receiveFreeCarcassesWeight: $receiveFreeCarcassesWeight, freeBuyingCarcassesQuantity: $freeBuyingCarcassesQuantity, freeBuyingCarcassesWeight: $freeBuyingCarcassesWeight, totalGovernmentalCarcassesQuantity: $totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesWeight: $totalGovernmentalCarcassesWeight, totalFreeBarsCarcassesQuantity: $totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesWeight: $totalFreeBarsCarcassesWeight, weightAverage: $weightAverage, totalCarcassesQuantity: $totalCarcassesQuantity, totalCarcassesWeight: $totalCarcassesWeight, freezingQuantity: $freezingQuantity, freezingWeight: $freezingWeight, lossWeight: $lossWeight, outProvinceAllocatedQuantity: $outProvinceAllocatedQuantity, outProvinceAllocatedWeight: $outProvinceAllocatedWeight, provinceAllocatedQuantity: $provinceAllocatedQuantity, provinceAllocatedWeight: $provinceAllocatedWeight, realAllocatedQuantity: $realAllocatedQuantity, realAllocatedWeight: $realAllocatedWeight, coldHouseAllocatedWeight: $coldHouseAllocatedWeight, posAllocatedWeight: $posAllocatedWeight, segmentationWeight: $segmentationWeight, totalRemainQuantity: $totalRemainQuantity, totalRemainWeight: $totalRemainWeight, freePrice: $freePrice, approvedPrice: $approvedPrice, approvedPriceStatus: $approvedPriceStatus, parentProduct: $parentProduct, killHouse: $killHouse, guild: $guild)'; +} + + +} + +/// @nodoc +abstract mixin class $InventoryModelCopyWith<$Res> { + factory $InventoryModelCopyWith(InventoryModel value, $Res Function(InventoryModel) _then) = _$InventoryModelCopyWithImpl; +@useResult +$Res call({ + int? id, String? key, String? createDate, String? modifyDate, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, int? parentProduct, int? killHouse, int? guild +}); + + + + +} +/// @nodoc +class _$InventoryModelCopyWithImpl<$Res> + implements $InventoryModelCopyWith<$Res> { + _$InventoryModelCopyWithImpl(this._self, this._then); + + final InventoryModel _self; + final $Res Function(InventoryModel) _then; + +/// Create a copy of InventoryModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? name = freezed,Object? provinceGovernmentalCarcassesQuantity = freezed,Object? provinceGovernmentalCarcassesWeight = freezed,Object? provinceFreeCarcassesQuantity = freezed,Object? provinceFreeCarcassesWeight = freezed,Object? receiveGovernmentalCarcassesQuantity = freezed,Object? receiveGovernmentalCarcassesWeight = freezed,Object? receiveFreeCarcassesQuantity = freezed,Object? receiveFreeCarcassesWeight = freezed,Object? freeBuyingCarcassesQuantity = freezed,Object? freeBuyingCarcassesWeight = freezed,Object? totalGovernmentalCarcassesQuantity = freezed,Object? totalGovernmentalCarcassesWeight = freezed,Object? totalFreeBarsCarcassesQuantity = freezed,Object? totalFreeBarsCarcassesWeight = freezed,Object? weightAverage = freezed,Object? totalCarcassesQuantity = freezed,Object? totalCarcassesWeight = freezed,Object? freezingQuantity = freezed,Object? freezingWeight = freezed,Object? lossWeight = freezed,Object? outProvinceAllocatedQuantity = freezed,Object? outProvinceAllocatedWeight = freezed,Object? provinceAllocatedQuantity = freezed,Object? provinceAllocatedWeight = freezed,Object? realAllocatedQuantity = freezed,Object? realAllocatedWeight = freezed,Object? coldHouseAllocatedWeight = freezed,Object? posAllocatedWeight = freezed,Object? segmentationWeight = freezed,Object? totalRemainQuantity = freezed,Object? totalRemainWeight = freezed,Object? freePrice = freezed,Object? approvedPrice = freezed,Object? approvedPriceStatus = freezed,Object? parentProduct = freezed,Object? killHouse = freezed,Object? guild = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,provinceGovernmentalCarcassesQuantity: freezed == provinceGovernmentalCarcassesQuantity ? _self.provinceGovernmentalCarcassesQuantity : provinceGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceGovernmentalCarcassesWeight: freezed == provinceGovernmentalCarcassesWeight ? _self.provinceGovernmentalCarcassesWeight : provinceGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesQuantity: freezed == provinceFreeCarcassesQuantity ? _self.provinceFreeCarcassesQuantity : provinceFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesWeight: freezed == provinceFreeCarcassesWeight ? _self.provinceFreeCarcassesWeight : provinceFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesQuantity: freezed == receiveGovernmentalCarcassesQuantity ? _self.receiveGovernmentalCarcassesQuantity : receiveGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesWeight: freezed == receiveGovernmentalCarcassesWeight ? _self.receiveGovernmentalCarcassesWeight : receiveGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesQuantity: freezed == receiveFreeCarcassesQuantity ? _self.receiveFreeCarcassesQuantity : receiveFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesWeight: freezed == receiveFreeCarcassesWeight ? _self.receiveFreeCarcassesWeight : receiveFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesQuantity: freezed == freeBuyingCarcassesQuantity ? _self.freeBuyingCarcassesQuantity : freeBuyingCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesWeight: freezed == freeBuyingCarcassesWeight ? _self.freeBuyingCarcassesWeight : freeBuyingCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesQuantity: freezed == totalGovernmentalCarcassesQuantity ? _self.totalGovernmentalCarcassesQuantity : totalGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesWeight: freezed == totalGovernmentalCarcassesWeight ? _self.totalGovernmentalCarcassesWeight : totalGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesQuantity: freezed == totalFreeBarsCarcassesQuantity ? _self.totalFreeBarsCarcassesQuantity : totalFreeBarsCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesWeight: freezed == totalFreeBarsCarcassesWeight ? _self.totalFreeBarsCarcassesWeight : totalFreeBarsCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?,totalCarcassesQuantity: freezed == totalCarcassesQuantity ? _self.totalCarcassesQuantity : totalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalCarcassesWeight: freezed == totalCarcassesWeight ? _self.totalCarcassesWeight : totalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freezingQuantity: freezed == freezingQuantity ? _self.freezingQuantity : freezingQuantity // ignore: cast_nullable_to_non_nullable +as int?,freezingWeight: freezed == freezingWeight ? _self.freezingWeight : freezingWeight // ignore: cast_nullable_to_non_nullable +as int?,lossWeight: freezed == lossWeight ? _self.lossWeight : lossWeight // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedQuantity: freezed == outProvinceAllocatedQuantity ? _self.outProvinceAllocatedQuantity : outProvinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedWeight: freezed == outProvinceAllocatedWeight ? _self.outProvinceAllocatedWeight : outProvinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedQuantity: freezed == provinceAllocatedQuantity ? _self.provinceAllocatedQuantity : provinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedWeight: freezed == provinceAllocatedWeight ? _self.provinceAllocatedWeight : provinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedQuantity: freezed == realAllocatedQuantity ? _self.realAllocatedQuantity : realAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedWeight: freezed == realAllocatedWeight ? _self.realAllocatedWeight : realAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,coldHouseAllocatedWeight: freezed == coldHouseAllocatedWeight ? _self.coldHouseAllocatedWeight : coldHouseAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,posAllocatedWeight: freezed == posAllocatedWeight ? _self.posAllocatedWeight : posAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,segmentationWeight: freezed == segmentationWeight ? _self.segmentationWeight : segmentationWeight // ignore: cast_nullable_to_non_nullable +as int?,totalRemainQuantity: freezed == totalRemainQuantity ? _self.totalRemainQuantity : totalRemainQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalRemainWeight: freezed == totalRemainWeight ? _self.totalRemainWeight : totalRemainWeight // ignore: cast_nullable_to_non_nullable +as int?,freePrice: freezed == freePrice ? _self.freePrice : freePrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPrice: freezed == approvedPrice ? _self.approvedPrice : approvedPrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,parentProduct: freezed == parentProduct ? _self.parentProduct : parentProduct // ignore: cast_nullable_to_non_nullable +as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as int?,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [InventoryModel]. +extension InventoryModelPatterns on InventoryModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _InventoryModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _InventoryModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _InventoryModel value) $default,){ +final _that = this; +switch (_that) { +case _InventoryModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _InventoryModel value)? $default,){ +final _that = this; +switch (_that) { +case _InventoryModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, int? parentProduct, int? killHouse, int? guild)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _InventoryModel() when $default != null: +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.name,_that.provinceGovernmentalCarcassesQuantity,_that.provinceGovernmentalCarcassesWeight,_that.provinceFreeCarcassesQuantity,_that.provinceFreeCarcassesWeight,_that.receiveGovernmentalCarcassesQuantity,_that.receiveGovernmentalCarcassesWeight,_that.receiveFreeCarcassesQuantity,_that.receiveFreeCarcassesWeight,_that.freeBuyingCarcassesQuantity,_that.freeBuyingCarcassesWeight,_that.totalGovernmentalCarcassesQuantity,_that.totalGovernmentalCarcassesWeight,_that.totalFreeBarsCarcassesQuantity,_that.totalFreeBarsCarcassesWeight,_that.weightAverage,_that.totalCarcassesQuantity,_that.totalCarcassesWeight,_that.freezingQuantity,_that.freezingWeight,_that.lossWeight,_that.outProvinceAllocatedQuantity,_that.outProvinceAllocatedWeight,_that.provinceAllocatedQuantity,_that.provinceAllocatedWeight,_that.realAllocatedQuantity,_that.realAllocatedWeight,_that.coldHouseAllocatedWeight,_that.posAllocatedWeight,_that.segmentationWeight,_that.totalRemainQuantity,_that.totalRemainWeight,_that.freePrice,_that.approvedPrice,_that.approvedPriceStatus,_that.parentProduct,_that.killHouse,_that.guild);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, int? parentProduct, int? killHouse, int? guild) $default,) {final _that = this; +switch (_that) { +case _InventoryModel(): +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.name,_that.provinceGovernmentalCarcassesQuantity,_that.provinceGovernmentalCarcassesWeight,_that.provinceFreeCarcassesQuantity,_that.provinceFreeCarcassesWeight,_that.receiveGovernmentalCarcassesQuantity,_that.receiveGovernmentalCarcassesWeight,_that.receiveFreeCarcassesQuantity,_that.receiveFreeCarcassesWeight,_that.freeBuyingCarcassesQuantity,_that.freeBuyingCarcassesWeight,_that.totalGovernmentalCarcassesQuantity,_that.totalGovernmentalCarcassesWeight,_that.totalFreeBarsCarcassesQuantity,_that.totalFreeBarsCarcassesWeight,_that.weightAverage,_that.totalCarcassesQuantity,_that.totalCarcassesWeight,_that.freezingQuantity,_that.freezingWeight,_that.lossWeight,_that.outProvinceAllocatedQuantity,_that.outProvinceAllocatedWeight,_that.provinceAllocatedQuantity,_that.provinceAllocatedWeight,_that.realAllocatedQuantity,_that.realAllocatedWeight,_that.coldHouseAllocatedWeight,_that.posAllocatedWeight,_that.segmentationWeight,_that.totalRemainQuantity,_that.totalRemainWeight,_that.freePrice,_that.approvedPrice,_that.approvedPriceStatus,_that.parentProduct,_that.killHouse,_that.guild);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, int? parentProduct, int? killHouse, int? guild)? $default,) {final _that = this; +switch (_that) { +case _InventoryModel() when $default != null: +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.name,_that.provinceGovernmentalCarcassesQuantity,_that.provinceGovernmentalCarcassesWeight,_that.provinceFreeCarcassesQuantity,_that.provinceFreeCarcassesWeight,_that.receiveGovernmentalCarcassesQuantity,_that.receiveGovernmentalCarcassesWeight,_that.receiveFreeCarcassesQuantity,_that.receiveFreeCarcassesWeight,_that.freeBuyingCarcassesQuantity,_that.freeBuyingCarcassesWeight,_that.totalGovernmentalCarcassesQuantity,_that.totalGovernmentalCarcassesWeight,_that.totalFreeBarsCarcassesQuantity,_that.totalFreeBarsCarcassesWeight,_that.weightAverage,_that.totalCarcassesQuantity,_that.totalCarcassesWeight,_that.freezingQuantity,_that.freezingWeight,_that.lossWeight,_that.outProvinceAllocatedQuantity,_that.outProvinceAllocatedWeight,_that.provinceAllocatedQuantity,_that.provinceAllocatedWeight,_that.realAllocatedQuantity,_that.realAllocatedWeight,_that.coldHouseAllocatedWeight,_that.posAllocatedWeight,_that.segmentationWeight,_that.totalRemainQuantity,_that.totalRemainWeight,_that.freePrice,_that.approvedPrice,_that.approvedPriceStatus,_that.parentProduct,_that.killHouse,_that.guild);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _InventoryModel implements InventoryModel { + const _InventoryModel({this.id, this.key, this.createDate, this.modifyDate, this.trash, this.name, this.provinceGovernmentalCarcassesQuantity, this.provinceGovernmentalCarcassesWeight, this.provinceFreeCarcassesQuantity, this.provinceFreeCarcassesWeight, this.receiveGovernmentalCarcassesQuantity, this.receiveGovernmentalCarcassesWeight, this.receiveFreeCarcassesQuantity, this.receiveFreeCarcassesWeight, this.freeBuyingCarcassesQuantity, this.freeBuyingCarcassesWeight, this.totalGovernmentalCarcassesQuantity, this.totalGovernmentalCarcassesWeight, this.totalFreeBarsCarcassesQuantity, this.totalFreeBarsCarcassesWeight, this.weightAverage, this.totalCarcassesQuantity, this.totalCarcassesWeight, this.freezingQuantity, this.freezingWeight, this.lossWeight, this.outProvinceAllocatedQuantity, this.outProvinceAllocatedWeight, this.provinceAllocatedQuantity, this.provinceAllocatedWeight, this.realAllocatedQuantity, this.realAllocatedWeight, this.coldHouseAllocatedWeight, this.posAllocatedWeight, this.segmentationWeight, this.totalRemainQuantity, this.totalRemainWeight, this.freePrice, this.approvedPrice, this.approvedPriceStatus, this.parentProduct, this.killHouse, this.guild}); + factory _InventoryModel.fromJson(Map json) => _$InventoryModelFromJson(json); + +@override final int? id; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final String? name; +@override final int? provinceGovernmentalCarcassesQuantity; +@override final int? provinceGovernmentalCarcassesWeight; +@override final int? provinceFreeCarcassesQuantity; +@override final int? provinceFreeCarcassesWeight; +@override final int? receiveGovernmentalCarcassesQuantity; +@override final int? receiveGovernmentalCarcassesWeight; +@override final int? receiveFreeCarcassesQuantity; +@override final int? receiveFreeCarcassesWeight; +@override final int? freeBuyingCarcassesQuantity; +@override final int? freeBuyingCarcassesWeight; +@override final int? totalGovernmentalCarcassesQuantity; +@override final int? totalGovernmentalCarcassesWeight; +@override final int? totalFreeBarsCarcassesQuantity; +@override final int? totalFreeBarsCarcassesWeight; +@override final double? weightAverage; +@override final int? totalCarcassesQuantity; +@override final int? totalCarcassesWeight; +@override final int? freezingQuantity; +@override final int? freezingWeight; +@override final int? lossWeight; +@override final int? outProvinceAllocatedQuantity; +@override final int? outProvinceAllocatedWeight; +@override final int? provinceAllocatedQuantity; +@override final int? provinceAllocatedWeight; +@override final int? realAllocatedQuantity; +@override final int? realAllocatedWeight; +@override final int? coldHouseAllocatedWeight; +@override final int? posAllocatedWeight; +@override final int? segmentationWeight; +@override final int? totalRemainQuantity; +@override final int? totalRemainWeight; +@override final int? freePrice; +@override final int? approvedPrice; +@override final bool? approvedPriceStatus; +@override final int? parentProduct; +@override final int? killHouse; +@override final int? guild; + +/// Create a copy of InventoryModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$InventoryModelCopyWith<_InventoryModel> get copyWith => __$InventoryModelCopyWithImpl<_InventoryModel>(this, _$identity); + +@override +Map toJson() { + return _$InventoryModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _InventoryModel&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.name, name) || other.name == name)&&(identical(other.provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesQuantity) || other.provinceGovernmentalCarcassesQuantity == provinceGovernmentalCarcassesQuantity)&&(identical(other.provinceGovernmentalCarcassesWeight, provinceGovernmentalCarcassesWeight) || other.provinceGovernmentalCarcassesWeight == provinceGovernmentalCarcassesWeight)&&(identical(other.provinceFreeCarcassesQuantity, provinceFreeCarcassesQuantity) || other.provinceFreeCarcassesQuantity == provinceFreeCarcassesQuantity)&&(identical(other.provinceFreeCarcassesWeight, provinceFreeCarcassesWeight) || other.provinceFreeCarcassesWeight == provinceFreeCarcassesWeight)&&(identical(other.receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesQuantity) || other.receiveGovernmentalCarcassesQuantity == receiveGovernmentalCarcassesQuantity)&&(identical(other.receiveGovernmentalCarcassesWeight, receiveGovernmentalCarcassesWeight) || other.receiveGovernmentalCarcassesWeight == receiveGovernmentalCarcassesWeight)&&(identical(other.receiveFreeCarcassesQuantity, receiveFreeCarcassesQuantity) || other.receiveFreeCarcassesQuantity == receiveFreeCarcassesQuantity)&&(identical(other.receiveFreeCarcassesWeight, receiveFreeCarcassesWeight) || other.receiveFreeCarcassesWeight == receiveFreeCarcassesWeight)&&(identical(other.freeBuyingCarcassesQuantity, freeBuyingCarcassesQuantity) || other.freeBuyingCarcassesQuantity == freeBuyingCarcassesQuantity)&&(identical(other.freeBuyingCarcassesWeight, freeBuyingCarcassesWeight) || other.freeBuyingCarcassesWeight == freeBuyingCarcassesWeight)&&(identical(other.totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesQuantity) || other.totalGovernmentalCarcassesQuantity == totalGovernmentalCarcassesQuantity)&&(identical(other.totalGovernmentalCarcassesWeight, totalGovernmentalCarcassesWeight) || other.totalGovernmentalCarcassesWeight == totalGovernmentalCarcassesWeight)&&(identical(other.totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesQuantity) || other.totalFreeBarsCarcassesQuantity == totalFreeBarsCarcassesQuantity)&&(identical(other.totalFreeBarsCarcassesWeight, totalFreeBarsCarcassesWeight) || other.totalFreeBarsCarcassesWeight == totalFreeBarsCarcassesWeight)&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)&&(identical(other.totalCarcassesQuantity, totalCarcassesQuantity) || other.totalCarcassesQuantity == totalCarcassesQuantity)&&(identical(other.totalCarcassesWeight, totalCarcassesWeight) || other.totalCarcassesWeight == totalCarcassesWeight)&&(identical(other.freezingQuantity, freezingQuantity) || other.freezingQuantity == freezingQuantity)&&(identical(other.freezingWeight, freezingWeight) || other.freezingWeight == freezingWeight)&&(identical(other.lossWeight, lossWeight) || other.lossWeight == lossWeight)&&(identical(other.outProvinceAllocatedQuantity, outProvinceAllocatedQuantity) || other.outProvinceAllocatedQuantity == outProvinceAllocatedQuantity)&&(identical(other.outProvinceAllocatedWeight, outProvinceAllocatedWeight) || other.outProvinceAllocatedWeight == outProvinceAllocatedWeight)&&(identical(other.provinceAllocatedQuantity, provinceAllocatedQuantity) || other.provinceAllocatedQuantity == provinceAllocatedQuantity)&&(identical(other.provinceAllocatedWeight, provinceAllocatedWeight) || other.provinceAllocatedWeight == provinceAllocatedWeight)&&(identical(other.realAllocatedQuantity, realAllocatedQuantity) || other.realAllocatedQuantity == realAllocatedQuantity)&&(identical(other.realAllocatedWeight, realAllocatedWeight) || other.realAllocatedWeight == realAllocatedWeight)&&(identical(other.coldHouseAllocatedWeight, coldHouseAllocatedWeight) || other.coldHouseAllocatedWeight == coldHouseAllocatedWeight)&&(identical(other.posAllocatedWeight, posAllocatedWeight) || other.posAllocatedWeight == posAllocatedWeight)&&(identical(other.segmentationWeight, segmentationWeight) || other.segmentationWeight == segmentationWeight)&&(identical(other.totalRemainQuantity, totalRemainQuantity) || other.totalRemainQuantity == totalRemainQuantity)&&(identical(other.totalRemainWeight, totalRemainWeight) || other.totalRemainWeight == totalRemainWeight)&&(identical(other.freePrice, freePrice) || other.freePrice == freePrice)&&(identical(other.approvedPrice, approvedPrice) || other.approvedPrice == approvedPrice)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.parentProduct, parentProduct) || other.parentProduct == parentProduct)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&(identical(other.guild, guild) || other.guild == guild)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,key,createDate,modifyDate,trash,name,provinceGovernmentalCarcassesQuantity,provinceGovernmentalCarcassesWeight,provinceFreeCarcassesQuantity,provinceFreeCarcassesWeight,receiveGovernmentalCarcassesQuantity,receiveGovernmentalCarcassesWeight,receiveFreeCarcassesQuantity,receiveFreeCarcassesWeight,freeBuyingCarcassesQuantity,freeBuyingCarcassesWeight,totalGovernmentalCarcassesQuantity,totalGovernmentalCarcassesWeight,totalFreeBarsCarcassesQuantity,totalFreeBarsCarcassesWeight,weightAverage,totalCarcassesQuantity,totalCarcassesWeight,freezingQuantity,freezingWeight,lossWeight,outProvinceAllocatedQuantity,outProvinceAllocatedWeight,provinceAllocatedQuantity,provinceAllocatedWeight,realAllocatedQuantity,realAllocatedWeight,coldHouseAllocatedWeight,posAllocatedWeight,segmentationWeight,totalRemainQuantity,totalRemainWeight,freePrice,approvedPrice,approvedPriceStatus,parentProduct,killHouse,guild]); + +@override +String toString() { + return 'InventoryModel(id: $id, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, name: $name, provinceGovernmentalCarcassesQuantity: $provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesWeight: $provinceGovernmentalCarcassesWeight, provinceFreeCarcassesQuantity: $provinceFreeCarcassesQuantity, provinceFreeCarcassesWeight: $provinceFreeCarcassesWeight, receiveGovernmentalCarcassesQuantity: $receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesWeight: $receiveGovernmentalCarcassesWeight, receiveFreeCarcassesQuantity: $receiveFreeCarcassesQuantity, receiveFreeCarcassesWeight: $receiveFreeCarcassesWeight, freeBuyingCarcassesQuantity: $freeBuyingCarcassesQuantity, freeBuyingCarcassesWeight: $freeBuyingCarcassesWeight, totalGovernmentalCarcassesQuantity: $totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesWeight: $totalGovernmentalCarcassesWeight, totalFreeBarsCarcassesQuantity: $totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesWeight: $totalFreeBarsCarcassesWeight, weightAverage: $weightAverage, totalCarcassesQuantity: $totalCarcassesQuantity, totalCarcassesWeight: $totalCarcassesWeight, freezingQuantity: $freezingQuantity, freezingWeight: $freezingWeight, lossWeight: $lossWeight, outProvinceAllocatedQuantity: $outProvinceAllocatedQuantity, outProvinceAllocatedWeight: $outProvinceAllocatedWeight, provinceAllocatedQuantity: $provinceAllocatedQuantity, provinceAllocatedWeight: $provinceAllocatedWeight, realAllocatedQuantity: $realAllocatedQuantity, realAllocatedWeight: $realAllocatedWeight, coldHouseAllocatedWeight: $coldHouseAllocatedWeight, posAllocatedWeight: $posAllocatedWeight, segmentationWeight: $segmentationWeight, totalRemainQuantity: $totalRemainQuantity, totalRemainWeight: $totalRemainWeight, freePrice: $freePrice, approvedPrice: $approvedPrice, approvedPriceStatus: $approvedPriceStatus, parentProduct: $parentProduct, killHouse: $killHouse, guild: $guild)'; +} + + +} + +/// @nodoc +abstract mixin class _$InventoryModelCopyWith<$Res> implements $InventoryModelCopyWith<$Res> { + factory _$InventoryModelCopyWith(_InventoryModel value, $Res Function(_InventoryModel) _then) = __$InventoryModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? key, String? createDate, String? modifyDate, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, int? parentProduct, int? killHouse, int? guild +}); + + + + +} +/// @nodoc +class __$InventoryModelCopyWithImpl<$Res> + implements _$InventoryModelCopyWith<$Res> { + __$InventoryModelCopyWithImpl(this._self, this._then); + + final _InventoryModel _self; + final $Res Function(_InventoryModel) _then; + +/// Create a copy of InventoryModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? name = freezed,Object? provinceGovernmentalCarcassesQuantity = freezed,Object? provinceGovernmentalCarcassesWeight = freezed,Object? provinceFreeCarcassesQuantity = freezed,Object? provinceFreeCarcassesWeight = freezed,Object? receiveGovernmentalCarcassesQuantity = freezed,Object? receiveGovernmentalCarcassesWeight = freezed,Object? receiveFreeCarcassesQuantity = freezed,Object? receiveFreeCarcassesWeight = freezed,Object? freeBuyingCarcassesQuantity = freezed,Object? freeBuyingCarcassesWeight = freezed,Object? totalGovernmentalCarcassesQuantity = freezed,Object? totalGovernmentalCarcassesWeight = freezed,Object? totalFreeBarsCarcassesQuantity = freezed,Object? totalFreeBarsCarcassesWeight = freezed,Object? weightAverage = freezed,Object? totalCarcassesQuantity = freezed,Object? totalCarcassesWeight = freezed,Object? freezingQuantity = freezed,Object? freezingWeight = freezed,Object? lossWeight = freezed,Object? outProvinceAllocatedQuantity = freezed,Object? outProvinceAllocatedWeight = freezed,Object? provinceAllocatedQuantity = freezed,Object? provinceAllocatedWeight = freezed,Object? realAllocatedQuantity = freezed,Object? realAllocatedWeight = freezed,Object? coldHouseAllocatedWeight = freezed,Object? posAllocatedWeight = freezed,Object? segmentationWeight = freezed,Object? totalRemainQuantity = freezed,Object? totalRemainWeight = freezed,Object? freePrice = freezed,Object? approvedPrice = freezed,Object? approvedPriceStatus = freezed,Object? parentProduct = freezed,Object? killHouse = freezed,Object? guild = freezed,}) { + return _then(_InventoryModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,provinceGovernmentalCarcassesQuantity: freezed == provinceGovernmentalCarcassesQuantity ? _self.provinceGovernmentalCarcassesQuantity : provinceGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceGovernmentalCarcassesWeight: freezed == provinceGovernmentalCarcassesWeight ? _self.provinceGovernmentalCarcassesWeight : provinceGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesQuantity: freezed == provinceFreeCarcassesQuantity ? _self.provinceFreeCarcassesQuantity : provinceFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesWeight: freezed == provinceFreeCarcassesWeight ? _self.provinceFreeCarcassesWeight : provinceFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesQuantity: freezed == receiveGovernmentalCarcassesQuantity ? _self.receiveGovernmentalCarcassesQuantity : receiveGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesWeight: freezed == receiveGovernmentalCarcassesWeight ? _self.receiveGovernmentalCarcassesWeight : receiveGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesQuantity: freezed == receiveFreeCarcassesQuantity ? _self.receiveFreeCarcassesQuantity : receiveFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesWeight: freezed == receiveFreeCarcassesWeight ? _self.receiveFreeCarcassesWeight : receiveFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesQuantity: freezed == freeBuyingCarcassesQuantity ? _self.freeBuyingCarcassesQuantity : freeBuyingCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesWeight: freezed == freeBuyingCarcassesWeight ? _self.freeBuyingCarcassesWeight : freeBuyingCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesQuantity: freezed == totalGovernmentalCarcassesQuantity ? _self.totalGovernmentalCarcassesQuantity : totalGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesWeight: freezed == totalGovernmentalCarcassesWeight ? _self.totalGovernmentalCarcassesWeight : totalGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesQuantity: freezed == totalFreeBarsCarcassesQuantity ? _self.totalFreeBarsCarcassesQuantity : totalFreeBarsCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesWeight: freezed == totalFreeBarsCarcassesWeight ? _self.totalFreeBarsCarcassesWeight : totalFreeBarsCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?,totalCarcassesQuantity: freezed == totalCarcassesQuantity ? _self.totalCarcassesQuantity : totalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalCarcassesWeight: freezed == totalCarcassesWeight ? _self.totalCarcassesWeight : totalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freezingQuantity: freezed == freezingQuantity ? _self.freezingQuantity : freezingQuantity // ignore: cast_nullable_to_non_nullable +as int?,freezingWeight: freezed == freezingWeight ? _self.freezingWeight : freezingWeight // ignore: cast_nullable_to_non_nullable +as int?,lossWeight: freezed == lossWeight ? _self.lossWeight : lossWeight // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedQuantity: freezed == outProvinceAllocatedQuantity ? _self.outProvinceAllocatedQuantity : outProvinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedWeight: freezed == outProvinceAllocatedWeight ? _self.outProvinceAllocatedWeight : outProvinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedQuantity: freezed == provinceAllocatedQuantity ? _self.provinceAllocatedQuantity : provinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedWeight: freezed == provinceAllocatedWeight ? _self.provinceAllocatedWeight : provinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedQuantity: freezed == realAllocatedQuantity ? _self.realAllocatedQuantity : realAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedWeight: freezed == realAllocatedWeight ? _self.realAllocatedWeight : realAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,coldHouseAllocatedWeight: freezed == coldHouseAllocatedWeight ? _self.coldHouseAllocatedWeight : coldHouseAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,posAllocatedWeight: freezed == posAllocatedWeight ? _self.posAllocatedWeight : posAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,segmentationWeight: freezed == segmentationWeight ? _self.segmentationWeight : segmentationWeight // ignore: cast_nullable_to_non_nullable +as int?,totalRemainQuantity: freezed == totalRemainQuantity ? _self.totalRemainQuantity : totalRemainQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalRemainWeight: freezed == totalRemainWeight ? _self.totalRemainWeight : totalRemainWeight // ignore: cast_nullable_to_non_nullable +as int?,freePrice: freezed == freePrice ? _self.freePrice : freePrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPrice: freezed == approvedPrice ? _self.approvedPrice : approvedPrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,parentProduct: freezed == parentProduct ? _self.parentProduct : parentProduct // ignore: cast_nullable_to_non_nullable +as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as int?,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/inventory/inventory_model.g.dart b/packages/chicken/lib/data/models/response/inventory/inventory_model.g.dart new file mode 100644 index 0000000..6bf5ba2 --- /dev/null +++ b/packages/chicken/lib/data/models/response/inventory/inventory_model.g.dart @@ -0,0 +1,127 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'inventory_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_InventoryModel _$InventoryModelFromJson( + Map json, +) => _InventoryModel( + id: (json['id'] as num?)?.toInt(), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + name: json['name'] as String?, + provinceGovernmentalCarcassesQuantity: + (json['province_governmental_carcasses_quantity'] as num?)?.toInt(), + provinceGovernmentalCarcassesWeight: + (json['province_governmental_carcasses_weight'] as num?)?.toInt(), + provinceFreeCarcassesQuantity: + (json['province_free_carcasses_quantity'] as num?)?.toInt(), + provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?) + ?.toInt(), + receiveGovernmentalCarcassesQuantity: + (json['receive_governmental_carcasses_quantity'] as num?)?.toInt(), + receiveGovernmentalCarcassesWeight: + (json['receive_governmental_carcasses_weight'] as num?)?.toInt(), + receiveFreeCarcassesQuantity: + (json['receive_free_carcasses_quantity'] as num?)?.toInt(), + receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?) + ?.toInt(), + freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?) + ?.toInt(), + freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?) + ?.toInt(), + totalGovernmentalCarcassesQuantity: + (json['total_governmental_carcasses_quantity'] as num?)?.toInt(), + totalGovernmentalCarcassesWeight: + (json['total_governmental_carcasses_weight'] as num?)?.toInt(), + totalFreeBarsCarcassesQuantity: + (json['total_free_bars_carcasses_quantity'] as num?)?.toInt(), + totalFreeBarsCarcassesWeight: + (json['total_free_bars_carcasses_weight'] as num?)?.toInt(), + weightAverage: (json['weight_average'] as num?)?.toDouble(), + totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(), + totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(), + freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(), + freezingWeight: (json['freezing_weight'] as num?)?.toInt(), + lossWeight: (json['loss_weight'] as num?)?.toInt(), + outProvinceAllocatedQuantity: + (json['out_province_allocated_quantity'] as num?)?.toInt(), + outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?) + ?.toInt(), + provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?) + ?.toInt(), + provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(), + realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(), + realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(), + coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?) + ?.toInt(), + posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(), + segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(), + totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(), + totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(), + freePrice: (json['free_price'] as num?)?.toInt(), + approvedPrice: (json['approved_price'] as num?)?.toInt(), + approvedPriceStatus: json['approved_price_status'] as bool?, + parentProduct: (json['parent_product'] as num?)?.toInt(), + killHouse: (json['kill_house'] as num?)?.toInt(), + guild: (json['guild'] as num?)?.toInt(), +); + +Map _$InventoryModelToJson( + _InventoryModel instance, +) => { + 'id': instance.id, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'name': instance.name, + 'province_governmental_carcasses_quantity': + instance.provinceGovernmentalCarcassesQuantity, + 'province_governmental_carcasses_weight': + instance.provinceGovernmentalCarcassesWeight, + 'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity, + 'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight, + 'receive_governmental_carcasses_quantity': + instance.receiveGovernmentalCarcassesQuantity, + 'receive_governmental_carcasses_weight': + instance.receiveGovernmentalCarcassesWeight, + 'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity, + 'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight, + 'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity, + 'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight, + 'total_governmental_carcasses_quantity': + instance.totalGovernmentalCarcassesQuantity, + 'total_governmental_carcasses_weight': + instance.totalGovernmentalCarcassesWeight, + 'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity, + 'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight, + 'weight_average': instance.weightAverage, + 'total_carcasses_quantity': instance.totalCarcassesQuantity, + 'total_carcasses_weight': instance.totalCarcassesWeight, + 'freezing_quantity': instance.freezingQuantity, + 'freezing_weight': instance.freezingWeight, + 'loss_weight': instance.lossWeight, + 'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity, + 'out_province_allocated_weight': instance.outProvinceAllocatedWeight, + 'province_allocated_quantity': instance.provinceAllocatedQuantity, + 'province_allocated_weight': instance.provinceAllocatedWeight, + 'real_allocated_quantity': instance.realAllocatedQuantity, + 'real_allocated_weight': instance.realAllocatedWeight, + 'cold_house_allocated_weight': instance.coldHouseAllocatedWeight, + 'pos_allocated_weight': instance.posAllocatedWeight, + 'segmentation_weight': instance.segmentationWeight, + 'total_remain_quantity': instance.totalRemainQuantity, + 'total_remain_weight': instance.totalRemainWeight, + 'free_price': instance.freePrice, + 'approved_price': instance.approvedPrice, + 'approved_price_status': instance.approvedPriceStatus, + 'parent_product': instance.parentProduct, + 'kill_house': instance.killHouse, + 'guild': instance.guild, +}; diff --git a/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.dart b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.dart new file mode 100644 index 0000000..f46a8f5 --- /dev/null +++ b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.dart @@ -0,0 +1,16 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'iran_province_city_model.freezed.dart'; +part 'iran_province_city_model.g.dart'; + + +@freezed +abstract class IranProvinceCityModel with _$IranProvinceCityModel { + const factory IranProvinceCityModel({ + int? id, + String? name, + }) = _IranProvinceCityModel; + + factory IranProvinceCityModel.fromJson(Map json) => + _$IranProvinceCityModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.freezed.dart b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.freezed.dart new file mode 100644 index 0000000..0375bbb --- /dev/null +++ b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.freezed.dart @@ -0,0 +1,280 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'iran_province_city_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$IranProvinceCityModel { + + int? get id; String? get name; +/// Create a copy of IranProvinceCityModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IranProvinceCityModelCopyWith get copyWith => _$IranProvinceCityModelCopyWithImpl(this as IranProvinceCityModel, _$identity); + + /// Serializes this IranProvinceCityModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IranProvinceCityModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,name); + +@override +String toString() { + return 'IranProvinceCityModel(id: $id, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $IranProvinceCityModelCopyWith<$Res> { + factory $IranProvinceCityModelCopyWith(IranProvinceCityModel value, $Res Function(IranProvinceCityModel) _then) = _$IranProvinceCityModelCopyWithImpl; +@useResult +$Res call({ + int? id, String? name +}); + + + + +} +/// @nodoc +class _$IranProvinceCityModelCopyWithImpl<$Res> + implements $IranProvinceCityModelCopyWith<$Res> { + _$IranProvinceCityModelCopyWithImpl(this._self, this._then); + + final IranProvinceCityModel _self; + final $Res Function(IranProvinceCityModel) _then; + +/// Create a copy of IranProvinceCityModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [IranProvinceCityModel]. +extension IranProvinceCityModelPatterns on IranProvinceCityModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IranProvinceCityModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IranProvinceCityModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IranProvinceCityModel value) $default,){ +final _that = this; +switch (_that) { +case _IranProvinceCityModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IranProvinceCityModel value)? $default,){ +final _that = this; +switch (_that) { +case _IranProvinceCityModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IranProvinceCityModel() when $default != null: +return $default(_that.id,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? name) $default,) {final _that = this; +switch (_that) { +case _IranProvinceCityModel(): +return $default(_that.id,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? name)? $default,) {final _that = this; +switch (_that) { +case _IranProvinceCityModel() when $default != null: +return $default(_that.id,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _IranProvinceCityModel implements IranProvinceCityModel { + const _IranProvinceCityModel({this.id, this.name}); + factory _IranProvinceCityModel.fromJson(Map json) => _$IranProvinceCityModelFromJson(json); + +@override final int? id; +@override final String? name; + +/// Create a copy of IranProvinceCityModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IranProvinceCityModelCopyWith<_IranProvinceCityModel> get copyWith => __$IranProvinceCityModelCopyWithImpl<_IranProvinceCityModel>(this, _$identity); + +@override +Map toJson() { + return _$IranProvinceCityModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IranProvinceCityModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,name); + +@override +String toString() { + return 'IranProvinceCityModel(id: $id, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$IranProvinceCityModelCopyWith<$Res> implements $IranProvinceCityModelCopyWith<$Res> { + factory _$IranProvinceCityModelCopyWith(_IranProvinceCityModel value, $Res Function(_IranProvinceCityModel) _then) = __$IranProvinceCityModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? name +}); + + + + +} +/// @nodoc +class __$IranProvinceCityModelCopyWithImpl<$Res> + implements _$IranProvinceCityModelCopyWith<$Res> { + __$IranProvinceCityModelCopyWithImpl(this._self, this._then); + + final _IranProvinceCityModel _self; + final $Res Function(_IranProvinceCityModel) _then; + +/// Create a copy of IranProvinceCityModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? name = freezed,}) { + return _then(_IranProvinceCityModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.g.dart b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.g.dart new file mode 100644 index 0000000..89f2c4a --- /dev/null +++ b/packages/chicken/lib/data/models/response/iran_province_city/iran_province_city_model.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'iran_province_city_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_IranProvinceCityModel _$IranProvinceCityModelFromJson( + Map json, +) => _IranProvinceCityModel( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String?, +); + +Map _$IranProvinceCityModelToJson( + _IranProvinceCityModel instance, +) => {'id': instance.id, 'name': instance.name}; diff --git a/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart b/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart new file mode 100644 index 0000000..4a0c85c --- /dev/null +++ b/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart @@ -0,0 +1,15 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'kill_house_distribution_info.freezed.dart'; +part 'kill_house_distribution_info.g.dart'; + +@freezed +abstract class KillHouseDistributionInfo with _$KillHouseDistributionInfo { + const factory KillHouseDistributionInfo({ + double? stewardAllocationsWeight, + double? freeSalesWeight, + }) = _KillHouseDistributionInfo; + + factory KillHouseDistributionInfo.fromJson(Map json) => + _$KillHouseDistributionInfoFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.freezed.dart b/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.freezed.dart new file mode 100644 index 0000000..ad8d047 --- /dev/null +++ b/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.freezed.dart @@ -0,0 +1,280 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'kill_house_distribution_info.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$KillHouseDistributionInfo { + + double? get stewardAllocationsWeight; double? get freeSalesWeight; +/// Create a copy of KillHouseDistributionInfo +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseDistributionInfoCopyWith get copyWith => _$KillHouseDistributionInfoCopyWithImpl(this as KillHouseDistributionInfo, _$identity); + + /// Serializes this KillHouseDistributionInfo to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight); + +@override +String toString() { + return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseDistributionInfoCopyWith<$Res> { + factory $KillHouseDistributionInfoCopyWith(KillHouseDistributionInfo value, $Res Function(KillHouseDistributionInfo) _then) = _$KillHouseDistributionInfoCopyWithImpl; +@useResult +$Res call({ + double? stewardAllocationsWeight, double? freeSalesWeight +}); + + + + +} +/// @nodoc +class _$KillHouseDistributionInfoCopyWithImpl<$Res> + implements $KillHouseDistributionInfoCopyWith<$Res> { + _$KillHouseDistributionInfoCopyWithImpl(this._self, this._then); + + final KillHouseDistributionInfo _self; + final $Res Function(KillHouseDistributionInfo) _then; + +/// Create a copy of KillHouseDistributionInfo +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) { + return _then(_self.copyWith( +stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable +as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [KillHouseDistributionInfo]. +extension KillHouseDistributionInfoPatterns on KillHouseDistributionInfo { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _KillHouseDistributionInfo value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseDistributionInfo() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _KillHouseDistributionInfo value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseDistributionInfo(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _KillHouseDistributionInfo value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseDistributionInfo() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? stewardAllocationsWeight, double? freeSalesWeight)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseDistributionInfo() when $default != null: +return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? stewardAllocationsWeight, double? freeSalesWeight) $default,) {final _that = this; +switch (_that) { +case _KillHouseDistributionInfo(): +return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? stewardAllocationsWeight, double? freeSalesWeight)? $default,) {final _that = this; +switch (_that) { +case _KillHouseDistributionInfo() when $default != null: +return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseDistributionInfo implements KillHouseDistributionInfo { + const _KillHouseDistributionInfo({this.stewardAllocationsWeight, this.freeSalesWeight}); + factory _KillHouseDistributionInfo.fromJson(Map json) => _$KillHouseDistributionInfoFromJson(json); + +@override final double? stewardAllocationsWeight; +@override final double? freeSalesWeight; + +/// Create a copy of KillHouseDistributionInfo +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseDistributionInfoCopyWith<_KillHouseDistributionInfo> get copyWith => __$KillHouseDistributionInfoCopyWithImpl<_KillHouseDistributionInfo>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseDistributionInfoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight); + +@override +String toString() { + return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseDistributionInfoCopyWith<$Res> implements $KillHouseDistributionInfoCopyWith<$Res> { + factory _$KillHouseDistributionInfoCopyWith(_KillHouseDistributionInfo value, $Res Function(_KillHouseDistributionInfo) _then) = __$KillHouseDistributionInfoCopyWithImpl; +@override @useResult +$Res call({ + double? stewardAllocationsWeight, double? freeSalesWeight +}); + + + + +} +/// @nodoc +class __$KillHouseDistributionInfoCopyWithImpl<$Res> + implements _$KillHouseDistributionInfoCopyWith<$Res> { + __$KillHouseDistributionInfoCopyWithImpl(this._self, this._then); + + final _KillHouseDistributionInfo _self; + final $Res Function(_KillHouseDistributionInfo) _then; + +/// Create a copy of KillHouseDistributionInfo +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) { + return _then(_KillHouseDistributionInfo( +stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable +as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.g.dart b/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.g.dart new file mode 100644 index 0000000..f9c0d1a --- /dev/null +++ b/packages/chicken/lib/data/models/response/kill_house_distribution_info/kill_house_distribution_info.g.dart @@ -0,0 +1,22 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'kill_house_distribution_info.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_KillHouseDistributionInfo _$KillHouseDistributionInfoFromJson( + Map json, +) => _KillHouseDistributionInfo( + stewardAllocationsWeight: (json['steward_allocations_weight'] as num?) + ?.toDouble(), + freeSalesWeight: (json['free_sales_weight'] as num?)?.toDouble(), +); + +Map _$KillHouseDistributionInfoToJson( + _KillHouseDistributionInfo instance, +) => { + 'steward_allocations_weight': instance.stewardAllocationsWeight, + 'free_sales_weight': instance.freeSalesWeight, +}; diff --git a/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.dart b/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.dart new file mode 100644 index 0000000..ce20daa --- /dev/null +++ b/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.dart @@ -0,0 +1,71 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'kill_house_free_bar.freezed.dart'; +part 'kill_house_free_bar.g.dart'; + +@freezed +abstract class KillHouseFreeBar with _$KillHouseFreeBar { + const factory KillHouseFreeBar({ + int? id, + dynamic killHouse, + dynamic exclusiveKiller, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + String? poultryName, + String? poultryMobile, + String? sellerName, + String? sellerMobile, + String? province, + String? city, + String? vetFarmName, + String? vetFarmMobile, + String? driverName, + String? driverMobile, + String? car, + String? clearanceCode, + String? barClearanceCode, + int? quantity, + int? numberOfCarcasses, + int? weightOfCarcasses, + int? killHouseVetQuantity, + int? killHouseVetWeight, + String? killHouseVetState, + String? dateOfAcceptReject, + dynamic acceptorRejector, + int? liveWeight, + String? barImage, + String? buyType, + bool? wareHouse, + String? date, + int? wage, + int? totalWageAmount, + int? unionShare, + int? unionSharePercent, + int? companyShare, + int? companySharePercent, + int? guildsShare, + int? guildsSharePercent, + int? cityShare, + int? citySharePercent, + int? walletShare, + int? walletSharePercent, + int? otherShare, + int? otherSharePercent, + bool? archiveWage, + int? weightLoss, + bool? calculateStatus, + bool? temporaryTrash, + bool? temporaryDeleted, + String? enteredMessage, + int? barCode, + String? registerType, + dynamic createdBy, + dynamic modifiedBy, + int? product, + }) = _KillHouseFreeBar; + + factory KillHouseFreeBar.fromJson(Map json) => + _$KillHouseFreeBarFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.freezed.dart b/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.freezed.dart new file mode 100644 index 0000000..f6ae691 --- /dev/null +++ b/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.freezed.dart @@ -0,0 +1,448 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'kill_house_free_bar.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$KillHouseFreeBar { + + int? get id; dynamic get killHouse; dynamic get exclusiveKiller; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get poultryName; String? get poultryMobile; String? get sellerName; String? get sellerMobile; String? get province; String? get city; String? get vetFarmName; String? get vetFarmMobile; String? get driverName; String? get driverMobile; String? get car; String? get clearanceCode; String? get barClearanceCode; int? get quantity; int? get numberOfCarcasses; int? get weightOfCarcasses; int? get killHouseVetQuantity; int? get killHouseVetWeight; String? get killHouseVetState; String? get dateOfAcceptReject; dynamic get acceptorRejector; int? get liveWeight; String? get barImage; String? get buyType; bool? get wareHouse; String? get date; int? get wage; int? get totalWageAmount; int? get unionShare; int? get unionSharePercent; int? get companyShare; int? get companySharePercent; int? get guildsShare; int? get guildsSharePercent; int? get cityShare; int? get citySharePercent; int? get walletShare; int? get walletSharePercent; int? get otherShare; int? get otherSharePercent; bool? get archiveWage; int? get weightLoss; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; String? get enteredMessage; int? get barCode; String? get registerType; dynamic get createdBy; dynamic get modifiedBy; int? get product; +/// Create a copy of KillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseFreeBarCopyWith get copyWith => _$KillHouseFreeBarCopyWithImpl(this as KillHouseFreeBar, _$identity); + + /// Serializes this KillHouseFreeBar to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseFreeBar&&(identical(other.id, id) || other.id == id)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.exclusiveKiller, exclusiveKiller)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.sellerName, sellerName) || other.sellerName == sellerName)&&(identical(other.sellerMobile, sellerMobile) || other.sellerMobile == sellerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.vetFarmName, vetFarmName) || other.vetFarmName == vetFarmName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.car, car) || other.car == car)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.killHouseVetQuantity, killHouseVetQuantity) || other.killHouseVetQuantity == killHouseVetQuantity)&&(identical(other.killHouseVetWeight, killHouseVetWeight) || other.killHouseVetWeight == killHouseVetWeight)&&(identical(other.killHouseVetState, killHouseVetState) || other.killHouseVetState == killHouseVetState)&&(identical(other.dateOfAcceptReject, dateOfAcceptReject) || other.dateOfAcceptReject == dateOfAcceptReject)&&const DeepCollectionEquality().equals(other.acceptorRejector, acceptorRejector)&&(identical(other.liveWeight, liveWeight) || other.liveWeight == liveWeight)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.wareHouse, wareHouse) || other.wareHouse == wareHouse)&&(identical(other.date, date) || other.date == date)&&(identical(other.wage, wage) || other.wage == wage)&&(identical(other.totalWageAmount, totalWageAmount) || other.totalWageAmount == totalWageAmount)&&(identical(other.unionShare, unionShare) || other.unionShare == unionShare)&&(identical(other.unionSharePercent, unionSharePercent) || other.unionSharePercent == unionSharePercent)&&(identical(other.companyShare, companyShare) || other.companyShare == companyShare)&&(identical(other.companySharePercent, companySharePercent) || other.companySharePercent == companySharePercent)&&(identical(other.guildsShare, guildsShare) || other.guildsShare == guildsShare)&&(identical(other.guildsSharePercent, guildsSharePercent) || other.guildsSharePercent == guildsSharePercent)&&(identical(other.cityShare, cityShare) || other.cityShare == cityShare)&&(identical(other.citySharePercent, citySharePercent) || other.citySharePercent == citySharePercent)&&(identical(other.walletShare, walletShare) || other.walletShare == walletShare)&&(identical(other.walletSharePercent, walletSharePercent) || other.walletSharePercent == walletSharePercent)&&(identical(other.otherShare, otherShare) || other.otherShare == otherShare)&&(identical(other.otherSharePercent, otherSharePercent) || other.otherSharePercent == otherSharePercent)&&(identical(other.archiveWage, archiveWage) || other.archiveWage == archiveWage)&&(identical(other.weightLoss, weightLoss) || other.weightLoss == weightLoss)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.enteredMessage, enteredMessage) || other.enteredMessage == enteredMessage)&&(identical(other.barCode, barCode) || other.barCode == barCode)&&(identical(other.registerType, registerType) || other.registerType == registerType)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.product, product) || other.product == product)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(exclusiveKiller),key,createDate,modifyDate,trash,poultryName,poultryMobile,sellerName,sellerMobile,province,city,vetFarmName,vetFarmMobile,driverName,driverMobile,car,clearanceCode,barClearanceCode,quantity,numberOfCarcasses,weightOfCarcasses,killHouseVetQuantity,killHouseVetWeight,killHouseVetState,dateOfAcceptReject,const DeepCollectionEquality().hash(acceptorRejector),liveWeight,barImage,buyType,wareHouse,date,wage,totalWageAmount,unionShare,unionSharePercent,companyShare,companySharePercent,guildsShare,guildsSharePercent,cityShare,citySharePercent,walletShare,walletSharePercent,otherShare,otherSharePercent,archiveWage,weightLoss,calculateStatus,temporaryTrash,temporaryDeleted,enteredMessage,barCode,registerType,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),product]); + +@override +String toString() { + return 'KillHouseFreeBar(id: $id, killHouse: $killHouse, exclusiveKiller: $exclusiveKiller, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, poultryName: $poultryName, poultryMobile: $poultryMobile, sellerName: $sellerName, sellerMobile: $sellerMobile, province: $province, city: $city, vetFarmName: $vetFarmName, vetFarmMobile: $vetFarmMobile, driverName: $driverName, driverMobile: $driverMobile, car: $car, clearanceCode: $clearanceCode, barClearanceCode: $barClearanceCode, quantity: $quantity, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, killHouseVetQuantity: $killHouseVetQuantity, killHouseVetWeight: $killHouseVetWeight, killHouseVetState: $killHouseVetState, dateOfAcceptReject: $dateOfAcceptReject, acceptorRejector: $acceptorRejector, liveWeight: $liveWeight, barImage: $barImage, buyType: $buyType, wareHouse: $wareHouse, date: $date, wage: $wage, totalWageAmount: $totalWageAmount, unionShare: $unionShare, unionSharePercent: $unionSharePercent, companyShare: $companyShare, companySharePercent: $companySharePercent, guildsShare: $guildsShare, guildsSharePercent: $guildsSharePercent, cityShare: $cityShare, citySharePercent: $citySharePercent, walletShare: $walletShare, walletSharePercent: $walletSharePercent, otherShare: $otherShare, otherSharePercent: $otherSharePercent, archiveWage: $archiveWage, weightLoss: $weightLoss, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, enteredMessage: $enteredMessage, barCode: $barCode, registerType: $registerType, createdBy: $createdBy, modifiedBy: $modifiedBy, product: $product)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseFreeBarCopyWith<$Res> { + factory $KillHouseFreeBarCopyWith(KillHouseFreeBar value, $Res Function(KillHouseFreeBar) _then) = _$KillHouseFreeBarCopyWithImpl; +@useResult +$Res call({ + int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product +}); + + + + +} +/// @nodoc +class _$KillHouseFreeBarCopyWithImpl<$Res> + implements $KillHouseFreeBarCopyWith<$Res> { + _$KillHouseFreeBarCopyWithImpl(this._self, this._then); + + final KillHouseFreeBar _self; + final $Res Function(KillHouseFreeBar) _then; + +/// Create a copy of KillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? killHouse = freezed,Object? exclusiveKiller = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? sellerName = freezed,Object? sellerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? vetFarmName = freezed,Object? vetFarmMobile = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? clearanceCode = freezed,Object? barClearanceCode = freezed,Object? quantity = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? killHouseVetQuantity = freezed,Object? killHouseVetWeight = freezed,Object? killHouseVetState = freezed,Object? dateOfAcceptReject = freezed,Object? acceptorRejector = freezed,Object? liveWeight = freezed,Object? barImage = freezed,Object? buyType = freezed,Object? wareHouse = freezed,Object? date = freezed,Object? wage = freezed,Object? totalWageAmount = freezed,Object? unionShare = freezed,Object? unionSharePercent = freezed,Object? companyShare = freezed,Object? companySharePercent = freezed,Object? guildsShare = freezed,Object? guildsSharePercent = freezed,Object? cityShare = freezed,Object? citySharePercent = freezed,Object? walletShare = freezed,Object? walletSharePercent = freezed,Object? otherShare = freezed,Object? otherSharePercent = freezed,Object? archiveWage = freezed,Object? weightLoss = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? enteredMessage = freezed,Object? barCode = freezed,Object? registerType = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? product = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,exclusiveKiller: freezed == exclusiveKiller ? _self.exclusiveKiller : exclusiveKiller // ignore: cast_nullable_to_non_nullable +as dynamic,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable +as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable +as String?,sellerName: freezed == sellerName ? _self.sellerName : sellerName // ignore: cast_nullable_to_non_nullable +as String?,sellerMobile: freezed == sellerMobile ? _self.sellerMobile : sellerMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,vetFarmName: freezed == vetFarmName ? _self.vetFarmName : vetFarmName // ignore: cast_nullable_to_non_nullable +as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable +as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable +as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable +as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable +as int?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,killHouseVetQuantity: freezed == killHouseVetQuantity ? _self.killHouseVetQuantity : killHouseVetQuantity // ignore: cast_nullable_to_non_nullable +as int?,killHouseVetWeight: freezed == killHouseVetWeight ? _self.killHouseVetWeight : killHouseVetWeight // ignore: cast_nullable_to_non_nullable +as int?,killHouseVetState: freezed == killHouseVetState ? _self.killHouseVetState : killHouseVetState // ignore: cast_nullable_to_non_nullable +as String?,dateOfAcceptReject: freezed == dateOfAcceptReject ? _self.dateOfAcceptReject : dateOfAcceptReject // ignore: cast_nullable_to_non_nullable +as String?,acceptorRejector: freezed == acceptorRejector ? _self.acceptorRejector : acceptorRejector // ignore: cast_nullable_to_non_nullable +as dynamic,liveWeight: freezed == liveWeight ? _self.liveWeight : liveWeight // ignore: cast_nullable_to_non_nullable +as int?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable +as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,wage: freezed == wage ? _self.wage : wage // ignore: cast_nullable_to_non_nullable +as int?,totalWageAmount: freezed == totalWageAmount ? _self.totalWageAmount : totalWageAmount // ignore: cast_nullable_to_non_nullable +as int?,unionShare: freezed == unionShare ? _self.unionShare : unionShare // ignore: cast_nullable_to_non_nullable +as int?,unionSharePercent: freezed == unionSharePercent ? _self.unionSharePercent : unionSharePercent // ignore: cast_nullable_to_non_nullable +as int?,companyShare: freezed == companyShare ? _self.companyShare : companyShare // ignore: cast_nullable_to_non_nullable +as int?,companySharePercent: freezed == companySharePercent ? _self.companySharePercent : companySharePercent // ignore: cast_nullable_to_non_nullable +as int?,guildsShare: freezed == guildsShare ? _self.guildsShare : guildsShare // ignore: cast_nullable_to_non_nullable +as int?,guildsSharePercent: freezed == guildsSharePercent ? _self.guildsSharePercent : guildsSharePercent // ignore: cast_nullable_to_non_nullable +as int?,cityShare: freezed == cityShare ? _self.cityShare : cityShare // ignore: cast_nullable_to_non_nullable +as int?,citySharePercent: freezed == citySharePercent ? _self.citySharePercent : citySharePercent // ignore: cast_nullable_to_non_nullable +as int?,walletShare: freezed == walletShare ? _self.walletShare : walletShare // ignore: cast_nullable_to_non_nullable +as int?,walletSharePercent: freezed == walletSharePercent ? _self.walletSharePercent : walletSharePercent // ignore: cast_nullable_to_non_nullable +as int?,otherShare: freezed == otherShare ? _self.otherShare : otherShare // ignore: cast_nullable_to_non_nullable +as int?,otherSharePercent: freezed == otherSharePercent ? _self.otherSharePercent : otherSharePercent // ignore: cast_nullable_to_non_nullable +as int?,archiveWage: freezed == archiveWage ? _self.archiveWage : archiveWage // ignore: cast_nullable_to_non_nullable +as bool?,weightLoss: freezed == weightLoss ? _self.weightLoss : weightLoss // ignore: cast_nullable_to_non_nullable +as int?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,enteredMessage: freezed == enteredMessage ? _self.enteredMessage : enteredMessage // ignore: cast_nullable_to_non_nullable +as String?,barCode: freezed == barCode ? _self.barCode : barCode // ignore: cast_nullable_to_non_nullable +as int?,registerType: freezed == registerType ? _self.registerType : registerType // ignore: cast_nullable_to_non_nullable +as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [KillHouseFreeBar]. +extension KillHouseFreeBarPatterns on KillHouseFreeBar { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _KillHouseFreeBar value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseFreeBar() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _KillHouseFreeBar value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseFreeBar(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _KillHouseFreeBar value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseFreeBar() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseFreeBar() when $default != null: +return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product) $default,) {final _that = this; +switch (_that) { +case _KillHouseFreeBar(): +return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product)? $default,) {final _that = this; +switch (_that) { +case _KillHouseFreeBar() when $default != null: +return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseFreeBar implements KillHouseFreeBar { + const _KillHouseFreeBar({this.id, this.killHouse, this.exclusiveKiller, this.key, this.createDate, this.modifyDate, this.trash, this.poultryName, this.poultryMobile, this.sellerName, this.sellerMobile, this.province, this.city, this.vetFarmName, this.vetFarmMobile, this.driverName, this.driverMobile, this.car, this.clearanceCode, this.barClearanceCode, this.quantity, this.numberOfCarcasses, this.weightOfCarcasses, this.killHouseVetQuantity, this.killHouseVetWeight, this.killHouseVetState, this.dateOfAcceptReject, this.acceptorRejector, this.liveWeight, this.barImage, this.buyType, this.wareHouse, this.date, this.wage, this.totalWageAmount, this.unionShare, this.unionSharePercent, this.companyShare, this.companySharePercent, this.guildsShare, this.guildsSharePercent, this.cityShare, this.citySharePercent, this.walletShare, this.walletSharePercent, this.otherShare, this.otherSharePercent, this.archiveWage, this.weightLoss, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.enteredMessage, this.barCode, this.registerType, this.createdBy, this.modifiedBy, this.product}); + factory _KillHouseFreeBar.fromJson(Map json) => _$KillHouseFreeBarFromJson(json); + +@override final int? id; +@override final dynamic killHouse; +@override final dynamic exclusiveKiller; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final String? poultryName; +@override final String? poultryMobile; +@override final String? sellerName; +@override final String? sellerMobile; +@override final String? province; +@override final String? city; +@override final String? vetFarmName; +@override final String? vetFarmMobile; +@override final String? driverName; +@override final String? driverMobile; +@override final String? car; +@override final String? clearanceCode; +@override final String? barClearanceCode; +@override final int? quantity; +@override final int? numberOfCarcasses; +@override final int? weightOfCarcasses; +@override final int? killHouseVetQuantity; +@override final int? killHouseVetWeight; +@override final String? killHouseVetState; +@override final String? dateOfAcceptReject; +@override final dynamic acceptorRejector; +@override final int? liveWeight; +@override final String? barImage; +@override final String? buyType; +@override final bool? wareHouse; +@override final String? date; +@override final int? wage; +@override final int? totalWageAmount; +@override final int? unionShare; +@override final int? unionSharePercent; +@override final int? companyShare; +@override final int? companySharePercent; +@override final int? guildsShare; +@override final int? guildsSharePercent; +@override final int? cityShare; +@override final int? citySharePercent; +@override final int? walletShare; +@override final int? walletSharePercent; +@override final int? otherShare; +@override final int? otherSharePercent; +@override final bool? archiveWage; +@override final int? weightLoss; +@override final bool? calculateStatus; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final String? enteredMessage; +@override final int? barCode; +@override final String? registerType; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final int? product; + +/// Create a copy of KillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseFreeBarCopyWith<_KillHouseFreeBar> get copyWith => __$KillHouseFreeBarCopyWithImpl<_KillHouseFreeBar>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseFreeBarToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseFreeBar&&(identical(other.id, id) || other.id == id)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.exclusiveKiller, exclusiveKiller)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.sellerName, sellerName) || other.sellerName == sellerName)&&(identical(other.sellerMobile, sellerMobile) || other.sellerMobile == sellerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.vetFarmName, vetFarmName) || other.vetFarmName == vetFarmName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.car, car) || other.car == car)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.killHouseVetQuantity, killHouseVetQuantity) || other.killHouseVetQuantity == killHouseVetQuantity)&&(identical(other.killHouseVetWeight, killHouseVetWeight) || other.killHouseVetWeight == killHouseVetWeight)&&(identical(other.killHouseVetState, killHouseVetState) || other.killHouseVetState == killHouseVetState)&&(identical(other.dateOfAcceptReject, dateOfAcceptReject) || other.dateOfAcceptReject == dateOfAcceptReject)&&const DeepCollectionEquality().equals(other.acceptorRejector, acceptorRejector)&&(identical(other.liveWeight, liveWeight) || other.liveWeight == liveWeight)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.wareHouse, wareHouse) || other.wareHouse == wareHouse)&&(identical(other.date, date) || other.date == date)&&(identical(other.wage, wage) || other.wage == wage)&&(identical(other.totalWageAmount, totalWageAmount) || other.totalWageAmount == totalWageAmount)&&(identical(other.unionShare, unionShare) || other.unionShare == unionShare)&&(identical(other.unionSharePercent, unionSharePercent) || other.unionSharePercent == unionSharePercent)&&(identical(other.companyShare, companyShare) || other.companyShare == companyShare)&&(identical(other.companySharePercent, companySharePercent) || other.companySharePercent == companySharePercent)&&(identical(other.guildsShare, guildsShare) || other.guildsShare == guildsShare)&&(identical(other.guildsSharePercent, guildsSharePercent) || other.guildsSharePercent == guildsSharePercent)&&(identical(other.cityShare, cityShare) || other.cityShare == cityShare)&&(identical(other.citySharePercent, citySharePercent) || other.citySharePercent == citySharePercent)&&(identical(other.walletShare, walletShare) || other.walletShare == walletShare)&&(identical(other.walletSharePercent, walletSharePercent) || other.walletSharePercent == walletSharePercent)&&(identical(other.otherShare, otherShare) || other.otherShare == otherShare)&&(identical(other.otherSharePercent, otherSharePercent) || other.otherSharePercent == otherSharePercent)&&(identical(other.archiveWage, archiveWage) || other.archiveWage == archiveWage)&&(identical(other.weightLoss, weightLoss) || other.weightLoss == weightLoss)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.enteredMessage, enteredMessage) || other.enteredMessage == enteredMessage)&&(identical(other.barCode, barCode) || other.barCode == barCode)&&(identical(other.registerType, registerType) || other.registerType == registerType)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.product, product) || other.product == product)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(exclusiveKiller),key,createDate,modifyDate,trash,poultryName,poultryMobile,sellerName,sellerMobile,province,city,vetFarmName,vetFarmMobile,driverName,driverMobile,car,clearanceCode,barClearanceCode,quantity,numberOfCarcasses,weightOfCarcasses,killHouseVetQuantity,killHouseVetWeight,killHouseVetState,dateOfAcceptReject,const DeepCollectionEquality().hash(acceptorRejector),liveWeight,barImage,buyType,wareHouse,date,wage,totalWageAmount,unionShare,unionSharePercent,companyShare,companySharePercent,guildsShare,guildsSharePercent,cityShare,citySharePercent,walletShare,walletSharePercent,otherShare,otherSharePercent,archiveWage,weightLoss,calculateStatus,temporaryTrash,temporaryDeleted,enteredMessage,barCode,registerType,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),product]); + +@override +String toString() { + return 'KillHouseFreeBar(id: $id, killHouse: $killHouse, exclusiveKiller: $exclusiveKiller, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, poultryName: $poultryName, poultryMobile: $poultryMobile, sellerName: $sellerName, sellerMobile: $sellerMobile, province: $province, city: $city, vetFarmName: $vetFarmName, vetFarmMobile: $vetFarmMobile, driverName: $driverName, driverMobile: $driverMobile, car: $car, clearanceCode: $clearanceCode, barClearanceCode: $barClearanceCode, quantity: $quantity, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, killHouseVetQuantity: $killHouseVetQuantity, killHouseVetWeight: $killHouseVetWeight, killHouseVetState: $killHouseVetState, dateOfAcceptReject: $dateOfAcceptReject, acceptorRejector: $acceptorRejector, liveWeight: $liveWeight, barImage: $barImage, buyType: $buyType, wareHouse: $wareHouse, date: $date, wage: $wage, totalWageAmount: $totalWageAmount, unionShare: $unionShare, unionSharePercent: $unionSharePercent, companyShare: $companyShare, companySharePercent: $companySharePercent, guildsShare: $guildsShare, guildsSharePercent: $guildsSharePercent, cityShare: $cityShare, citySharePercent: $citySharePercent, walletShare: $walletShare, walletSharePercent: $walletSharePercent, otherShare: $otherShare, otherSharePercent: $otherSharePercent, archiveWage: $archiveWage, weightLoss: $weightLoss, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, enteredMessage: $enteredMessage, barCode: $barCode, registerType: $registerType, createdBy: $createdBy, modifiedBy: $modifiedBy, product: $product)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseFreeBarCopyWith<$Res> implements $KillHouseFreeBarCopyWith<$Res> { + factory _$KillHouseFreeBarCopyWith(_KillHouseFreeBar value, $Res Function(_KillHouseFreeBar) _then) = __$KillHouseFreeBarCopyWithImpl; +@override @useResult +$Res call({ + int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product +}); + + + + +} +/// @nodoc +class __$KillHouseFreeBarCopyWithImpl<$Res> + implements _$KillHouseFreeBarCopyWith<$Res> { + __$KillHouseFreeBarCopyWithImpl(this._self, this._then); + + final _KillHouseFreeBar _self; + final $Res Function(_KillHouseFreeBar) _then; + +/// Create a copy of KillHouseFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? killHouse = freezed,Object? exclusiveKiller = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? sellerName = freezed,Object? sellerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? vetFarmName = freezed,Object? vetFarmMobile = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? clearanceCode = freezed,Object? barClearanceCode = freezed,Object? quantity = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? killHouseVetQuantity = freezed,Object? killHouseVetWeight = freezed,Object? killHouseVetState = freezed,Object? dateOfAcceptReject = freezed,Object? acceptorRejector = freezed,Object? liveWeight = freezed,Object? barImage = freezed,Object? buyType = freezed,Object? wareHouse = freezed,Object? date = freezed,Object? wage = freezed,Object? totalWageAmount = freezed,Object? unionShare = freezed,Object? unionSharePercent = freezed,Object? companyShare = freezed,Object? companySharePercent = freezed,Object? guildsShare = freezed,Object? guildsSharePercent = freezed,Object? cityShare = freezed,Object? citySharePercent = freezed,Object? walletShare = freezed,Object? walletSharePercent = freezed,Object? otherShare = freezed,Object? otherSharePercent = freezed,Object? archiveWage = freezed,Object? weightLoss = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? enteredMessage = freezed,Object? barCode = freezed,Object? registerType = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? product = freezed,}) { + return _then(_KillHouseFreeBar( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,exclusiveKiller: freezed == exclusiveKiller ? _self.exclusiveKiller : exclusiveKiller // ignore: cast_nullable_to_non_nullable +as dynamic,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable +as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable +as String?,sellerName: freezed == sellerName ? _self.sellerName : sellerName // ignore: cast_nullable_to_non_nullable +as String?,sellerMobile: freezed == sellerMobile ? _self.sellerMobile : sellerMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,vetFarmName: freezed == vetFarmName ? _self.vetFarmName : vetFarmName // ignore: cast_nullable_to_non_nullable +as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable +as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable +as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable +as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable +as int?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,killHouseVetQuantity: freezed == killHouseVetQuantity ? _self.killHouseVetQuantity : killHouseVetQuantity // ignore: cast_nullable_to_non_nullable +as int?,killHouseVetWeight: freezed == killHouseVetWeight ? _self.killHouseVetWeight : killHouseVetWeight // ignore: cast_nullable_to_non_nullable +as int?,killHouseVetState: freezed == killHouseVetState ? _self.killHouseVetState : killHouseVetState // ignore: cast_nullable_to_non_nullable +as String?,dateOfAcceptReject: freezed == dateOfAcceptReject ? _self.dateOfAcceptReject : dateOfAcceptReject // ignore: cast_nullable_to_non_nullable +as String?,acceptorRejector: freezed == acceptorRejector ? _self.acceptorRejector : acceptorRejector // ignore: cast_nullable_to_non_nullable +as dynamic,liveWeight: freezed == liveWeight ? _self.liveWeight : liveWeight // ignore: cast_nullable_to_non_nullable +as int?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable +as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,wage: freezed == wage ? _self.wage : wage // ignore: cast_nullable_to_non_nullable +as int?,totalWageAmount: freezed == totalWageAmount ? _self.totalWageAmount : totalWageAmount // ignore: cast_nullable_to_non_nullable +as int?,unionShare: freezed == unionShare ? _self.unionShare : unionShare // ignore: cast_nullable_to_non_nullable +as int?,unionSharePercent: freezed == unionSharePercent ? _self.unionSharePercent : unionSharePercent // ignore: cast_nullable_to_non_nullable +as int?,companyShare: freezed == companyShare ? _self.companyShare : companyShare // ignore: cast_nullable_to_non_nullable +as int?,companySharePercent: freezed == companySharePercent ? _self.companySharePercent : companySharePercent // ignore: cast_nullable_to_non_nullable +as int?,guildsShare: freezed == guildsShare ? _self.guildsShare : guildsShare // ignore: cast_nullable_to_non_nullable +as int?,guildsSharePercent: freezed == guildsSharePercent ? _self.guildsSharePercent : guildsSharePercent // ignore: cast_nullable_to_non_nullable +as int?,cityShare: freezed == cityShare ? _self.cityShare : cityShare // ignore: cast_nullable_to_non_nullable +as int?,citySharePercent: freezed == citySharePercent ? _self.citySharePercent : citySharePercent // ignore: cast_nullable_to_non_nullable +as int?,walletShare: freezed == walletShare ? _self.walletShare : walletShare // ignore: cast_nullable_to_non_nullable +as int?,walletSharePercent: freezed == walletSharePercent ? _self.walletSharePercent : walletSharePercent // ignore: cast_nullable_to_non_nullable +as int?,otherShare: freezed == otherShare ? _self.otherShare : otherShare // ignore: cast_nullable_to_non_nullable +as int?,otherSharePercent: freezed == otherSharePercent ? _self.otherSharePercent : otherSharePercent // ignore: cast_nullable_to_non_nullable +as int?,archiveWage: freezed == archiveWage ? _self.archiveWage : archiveWage // ignore: cast_nullable_to_non_nullable +as bool?,weightLoss: freezed == weightLoss ? _self.weightLoss : weightLoss // ignore: cast_nullable_to_non_nullable +as int?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,enteredMessage: freezed == enteredMessage ? _self.enteredMessage : enteredMessage // ignore: cast_nullable_to_non_nullable +as String?,barCode: freezed == barCode ? _self.barCode : barCode // ignore: cast_nullable_to_non_nullable +as int?,registerType: freezed == registerType ? _self.registerType : registerType // ignore: cast_nullable_to_non_nullable +as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.g.dart b/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.g.dart new file mode 100644 index 0000000..c808032 --- /dev/null +++ b/packages/chicken/lib/data/models/response/kill_house_free_bar/kill_house_free_bar.g.dart @@ -0,0 +1,131 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'kill_house_free_bar.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_KillHouseFreeBar _$KillHouseFreeBarFromJson(Map json) => + _KillHouseFreeBar( + id: (json['id'] as num?)?.toInt(), + killHouse: json['kill_house'], + exclusiveKiller: json['exclusive_killer'], + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + poultryName: json['poultry_name'] as String?, + poultryMobile: json['poultry_mobile'] as String?, + sellerName: json['seller_name'] as String?, + sellerMobile: json['seller_mobile'] as String?, + province: json['province'] as String?, + city: json['city'] as String?, + vetFarmName: json['vet_farm_name'] as String?, + vetFarmMobile: json['vet_farm_mobile'] as String?, + driverName: json['driver_name'] as String?, + driverMobile: json['driver_mobile'] as String?, + car: json['car'] as String?, + clearanceCode: json['clearance_code'] as String?, + barClearanceCode: json['bar_clearance_code'] as String?, + quantity: (json['quantity'] as num?)?.toInt(), + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(), + killHouseVetQuantity: (json['kill_house_vet_quantity'] as num?)?.toInt(), + killHouseVetWeight: (json['kill_house_vet_weight'] as num?)?.toInt(), + killHouseVetState: json['kill_house_vet_state'] as String?, + dateOfAcceptReject: json['date_of_accept_reject'] as String?, + acceptorRejector: json['acceptor_rejector'], + liveWeight: (json['live_weight'] as num?)?.toInt(), + barImage: json['bar_image'] as String?, + buyType: json['buy_type'] as String?, + wareHouse: json['ware_house'] as bool?, + date: json['date'] as String?, + wage: (json['wage'] as num?)?.toInt(), + totalWageAmount: (json['total_wage_amount'] as num?)?.toInt(), + unionShare: (json['union_share'] as num?)?.toInt(), + unionSharePercent: (json['union_share_percent'] as num?)?.toInt(), + companyShare: (json['company_share'] as num?)?.toInt(), + companySharePercent: (json['company_share_percent'] as num?)?.toInt(), + guildsShare: (json['guilds_share'] as num?)?.toInt(), + guildsSharePercent: (json['guilds_share_percent'] as num?)?.toInt(), + cityShare: (json['city_share'] as num?)?.toInt(), + citySharePercent: (json['city_share_percent'] as num?)?.toInt(), + walletShare: (json['wallet_share'] as num?)?.toInt(), + walletSharePercent: (json['wallet_share_percent'] as num?)?.toInt(), + otherShare: (json['other_share'] as num?)?.toInt(), + otherSharePercent: (json['other_share_percent'] as num?)?.toInt(), + archiveWage: json['archive_wage'] as bool?, + weightLoss: (json['weight_loss'] as num?)?.toInt(), + calculateStatus: json['calculate_status'] as bool?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + enteredMessage: json['entered_message'] as String?, + barCode: (json['bar_code'] as num?)?.toInt(), + registerType: json['register_type'] as String?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + product: (json['product'] as num?)?.toInt(), + ); + +Map _$KillHouseFreeBarToJson(_KillHouseFreeBar instance) => + { + 'id': instance.id, + 'kill_house': instance.killHouse, + 'exclusive_killer': instance.exclusiveKiller, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'poultry_name': instance.poultryName, + 'poultry_mobile': instance.poultryMobile, + 'seller_name': instance.sellerName, + 'seller_mobile': instance.sellerMobile, + 'province': instance.province, + 'city': instance.city, + 'vet_farm_name': instance.vetFarmName, + 'vet_farm_mobile': instance.vetFarmMobile, + 'driver_name': instance.driverName, + 'driver_mobile': instance.driverMobile, + 'car': instance.car, + 'clearance_code': instance.clearanceCode, + 'bar_clearance_code': instance.barClearanceCode, + 'quantity': instance.quantity, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'kill_house_vet_quantity': instance.killHouseVetQuantity, + 'kill_house_vet_weight': instance.killHouseVetWeight, + 'kill_house_vet_state': instance.killHouseVetState, + 'date_of_accept_reject': instance.dateOfAcceptReject, + 'acceptor_rejector': instance.acceptorRejector, + 'live_weight': instance.liveWeight, + 'bar_image': instance.barImage, + 'buy_type': instance.buyType, + 'ware_house': instance.wareHouse, + 'date': instance.date, + 'wage': instance.wage, + 'total_wage_amount': instance.totalWageAmount, + 'union_share': instance.unionShare, + 'union_share_percent': instance.unionSharePercent, + 'company_share': instance.companyShare, + 'company_share_percent': instance.companySharePercent, + 'guilds_share': instance.guildsShare, + 'guilds_share_percent': instance.guildsSharePercent, + 'city_share': instance.cityShare, + 'city_share_percent': instance.citySharePercent, + 'wallet_share': instance.walletShare, + 'wallet_share_percent': instance.walletSharePercent, + 'other_share': instance.otherShare, + 'other_share_percent': instance.otherSharePercent, + 'archive_wage': instance.archiveWage, + 'weight_loss': instance.weightLoss, + 'calculate_status': instance.calculateStatus, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'entered_message': instance.enteredMessage, + 'bar_code': instance.barCode, + 'register_type': instance.registerType, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'product': instance.product, + }; diff --git a/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart b/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart new file mode 100644 index 0000000..ea48447 --- /dev/null +++ b/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart @@ -0,0 +1,60 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'out_province_carcasses_buyer.freezed.dart'; +part 'out_province_carcasses_buyer.g.dart'; + +@freezed +abstract class OutProvinceCarcassesBuyer with _$OutProvinceCarcassesBuyer { + const factory OutProvinceCarcassesBuyer({ + Buyer? buyer, + RequestsInfo? requestsInfo, + String? key, + bool? trash, + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? unitName, + String? city, + String? province, + String? role, + bool? active, + String? typeActivity, + dynamic killHouse, + int? steward, + }) = _OutProvinceCarcassesBuyer; + + factory OutProvinceCarcassesBuyer.fromJson(Map json) => + _$OutProvinceCarcassesBuyerFromJson(json); +} + +@freezed +abstract class Buyer with _$Buyer { + const factory Buyer({ + String? key, + bool? trash, + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? unitName, + String? city, + String? province, + bool? active, + int? user, + }) = _Buyer; + + factory Buyer.fromJson(Map json) => _$BuyerFromJson(json); +} + +@freezed +abstract class RequestsInfo with _$RequestsInfo { + const factory RequestsInfo({ + int? numberOfRequests, + int? totalQuantity, + double? totalWeight, + }) = _RequestsInfo; + + factory RequestsInfo.fromJson(Map json) => + _$RequestsInfoFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.freezed.dart b/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.freezed.dart new file mode 100644 index 0000000..a7d87ec --- /dev/null +++ b/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.freezed.dart @@ -0,0 +1,932 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'out_province_carcasses_buyer.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$OutProvinceCarcassesBuyer { + + Buyer? get buyer; RequestsInfo? get requestsInfo; String? get key; bool? get trash; String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get unitName; String? get city; String? get province; String? get role; bool? get active; String? get typeActivity; dynamic get killHouse; int? get steward; +/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$OutProvinceCarcassesBuyerCopyWith get copyWith => _$OutProvinceCarcassesBuyerCopyWithImpl(this as OutProvinceCarcassesBuyer, _$identity); + + /// Serializes this OutProvinceCarcassesBuyer to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is OutProvinceCarcassesBuyer&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.requestsInfo, requestsInfo) || other.requestsInfo == requestsInfo)&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.role, role) || other.role == role)&&(identical(other.active, active) || other.active == active)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&(identical(other.steward, steward) || other.steward == steward)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,buyer,requestsInfo,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,role,active,typeActivity,const DeepCollectionEquality().hash(killHouse),steward); + +@override +String toString() { + return 'OutProvinceCarcassesBuyer(buyer: $buyer, requestsInfo: $requestsInfo, key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, role: $role, active: $active, typeActivity: $typeActivity, killHouse: $killHouse, steward: $steward)'; +} + + +} + +/// @nodoc +abstract mixin class $OutProvinceCarcassesBuyerCopyWith<$Res> { + factory $OutProvinceCarcassesBuyerCopyWith(OutProvinceCarcassesBuyer value, $Res Function(OutProvinceCarcassesBuyer) _then) = _$OutProvinceCarcassesBuyerCopyWithImpl; +@useResult +$Res call({ + Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward +}); + + +$BuyerCopyWith<$Res>? get buyer;$RequestsInfoCopyWith<$Res>? get requestsInfo; + +} +/// @nodoc +class _$OutProvinceCarcassesBuyerCopyWithImpl<$Res> + implements $OutProvinceCarcassesBuyerCopyWith<$Res> { + _$OutProvinceCarcassesBuyerCopyWithImpl(this._self, this._then); + + final OutProvinceCarcassesBuyer _self; + final $Res Function(OutProvinceCarcassesBuyer) _then; + +/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? buyer = freezed,Object? requestsInfo = freezed,Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? role = freezed,Object? active = freezed,Object? typeActivity = freezed,Object? killHouse = freezed,Object? steward = freezed,}) { + return _then(_self.copyWith( +buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable +as Buyer?,requestsInfo: freezed == requestsInfo ? _self.requestsInfo : requestsInfo // ignore: cast_nullable_to_non_nullable +as RequestsInfo?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as int?, + )); +} +/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerCopyWith<$Res>? get buyer { + if (_self.buyer == null) { + return null; + } + + return $BuyerCopyWith<$Res>(_self.buyer!, (value) { + return _then(_self.copyWith(buyer: value)); + }); +}/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RequestsInfoCopyWith<$Res>? get requestsInfo { + if (_self.requestsInfo == null) { + return null; + } + + return $RequestsInfoCopyWith<$Res>(_self.requestsInfo!, (value) { + return _then(_self.copyWith(requestsInfo: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [OutProvinceCarcassesBuyer]. +extension OutProvinceCarcassesBuyerPatterns on OutProvinceCarcassesBuyer { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _OutProvinceCarcassesBuyer value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _OutProvinceCarcassesBuyer() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _OutProvinceCarcassesBuyer value) $default,){ +final _that = this; +switch (_that) { +case _OutProvinceCarcassesBuyer(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _OutProvinceCarcassesBuyer value)? $default,){ +final _that = this; +switch (_that) { +case _OutProvinceCarcassesBuyer() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _OutProvinceCarcassesBuyer() when $default != null: +return $default(_that.buyer,_that.requestsInfo,_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.role,_that.active,_that.typeActivity,_that.killHouse,_that.steward);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward) $default,) {final _that = this; +switch (_that) { +case _OutProvinceCarcassesBuyer(): +return $default(_that.buyer,_that.requestsInfo,_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.role,_that.active,_that.typeActivity,_that.killHouse,_that.steward);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward)? $default,) {final _that = this; +switch (_that) { +case _OutProvinceCarcassesBuyer() when $default != null: +return $default(_that.buyer,_that.requestsInfo,_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.role,_that.active,_that.typeActivity,_that.killHouse,_that.steward);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _OutProvinceCarcassesBuyer implements OutProvinceCarcassesBuyer { + const _OutProvinceCarcassesBuyer({this.buyer, this.requestsInfo, this.key, this.trash, this.fullname, this.firstName, this.lastName, this.mobile, this.unitName, this.city, this.province, this.role, this.active, this.typeActivity, this.killHouse, this.steward}); + factory _OutProvinceCarcassesBuyer.fromJson(Map json) => _$OutProvinceCarcassesBuyerFromJson(json); + +@override final Buyer? buyer; +@override final RequestsInfo? requestsInfo; +@override final String? key; +@override final bool? trash; +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? unitName; +@override final String? city; +@override final String? province; +@override final String? role; +@override final bool? active; +@override final String? typeActivity; +@override final dynamic killHouse; +@override final int? steward; + +/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$OutProvinceCarcassesBuyerCopyWith<_OutProvinceCarcassesBuyer> get copyWith => __$OutProvinceCarcassesBuyerCopyWithImpl<_OutProvinceCarcassesBuyer>(this, _$identity); + +@override +Map toJson() { + return _$OutProvinceCarcassesBuyerToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _OutProvinceCarcassesBuyer&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.requestsInfo, requestsInfo) || other.requestsInfo == requestsInfo)&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.role, role) || other.role == role)&&(identical(other.active, active) || other.active == active)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&(identical(other.steward, steward) || other.steward == steward)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,buyer,requestsInfo,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,role,active,typeActivity,const DeepCollectionEquality().hash(killHouse),steward); + +@override +String toString() { + return 'OutProvinceCarcassesBuyer(buyer: $buyer, requestsInfo: $requestsInfo, key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, role: $role, active: $active, typeActivity: $typeActivity, killHouse: $killHouse, steward: $steward)'; +} + + +} + +/// @nodoc +abstract mixin class _$OutProvinceCarcassesBuyerCopyWith<$Res> implements $OutProvinceCarcassesBuyerCopyWith<$Res> { + factory _$OutProvinceCarcassesBuyerCopyWith(_OutProvinceCarcassesBuyer value, $Res Function(_OutProvinceCarcassesBuyer) _then) = __$OutProvinceCarcassesBuyerCopyWithImpl; +@override @useResult +$Res call({ + Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward +}); + + +@override $BuyerCopyWith<$Res>? get buyer;@override $RequestsInfoCopyWith<$Res>? get requestsInfo; + +} +/// @nodoc +class __$OutProvinceCarcassesBuyerCopyWithImpl<$Res> + implements _$OutProvinceCarcassesBuyerCopyWith<$Res> { + __$OutProvinceCarcassesBuyerCopyWithImpl(this._self, this._then); + + final _OutProvinceCarcassesBuyer _self; + final $Res Function(_OutProvinceCarcassesBuyer) _then; + +/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? buyer = freezed,Object? requestsInfo = freezed,Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? role = freezed,Object? active = freezed,Object? typeActivity = freezed,Object? killHouse = freezed,Object? steward = freezed,}) { + return _then(_OutProvinceCarcassesBuyer( +buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable +as Buyer?,requestsInfo: freezed == requestsInfo ? _self.requestsInfo : requestsInfo // ignore: cast_nullable_to_non_nullable +as RequestsInfo?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerCopyWith<$Res>? get buyer { + if (_self.buyer == null) { + return null; + } + + return $BuyerCopyWith<$Res>(_self.buyer!, (value) { + return _then(_self.copyWith(buyer: value)); + }); +}/// Create a copy of OutProvinceCarcassesBuyer +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RequestsInfoCopyWith<$Res>? get requestsInfo { + if (_self.requestsInfo == null) { + return null; + } + + return $RequestsInfoCopyWith<$Res>(_self.requestsInfo!, (value) { + return _then(_self.copyWith(requestsInfo: value)); + }); +} +} + + +/// @nodoc +mixin _$Buyer { + + String? get key; bool? get trash; String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get unitName; String? get city; String? get province; bool? get active; int? get user; +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BuyerCopyWith get copyWith => _$BuyerCopyWithImpl(this as Buyer, _$identity); + + /// Serializes this Buyer to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Buyer&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.active, active) || other.active == active)&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,active,user); + +@override +String toString() { + return 'Buyer(key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, active: $active, user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class $BuyerCopyWith<$Res> { + factory $BuyerCopyWith(Buyer value, $Res Function(Buyer) _then) = _$BuyerCopyWithImpl; +@useResult +$Res call({ + String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user +}); + + + + +} +/// @nodoc +class _$BuyerCopyWithImpl<$Res> + implements $BuyerCopyWith<$Res> { + _$BuyerCopyWithImpl(this._self, this._then); + + final Buyer _self; + final $Res Function(Buyer) _then; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? active = freezed,Object? user = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Buyer]. +extension BuyerPatterns on Buyer { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Buyer value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Buyer value) $default,){ +final _that = this; +switch (_that) { +case _Buyer(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Buyer value)? $default,){ +final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.user);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user) $default,) {final _that = this; +switch (_that) { +case _Buyer(): +return $default(_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.user);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user)? $default,) {final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.user);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Buyer implements Buyer { + const _Buyer({this.key, this.trash, this.fullname, this.firstName, this.lastName, this.mobile, this.unitName, this.city, this.province, this.active, this.user}); + factory _Buyer.fromJson(Map json) => _$BuyerFromJson(json); + +@override final String? key; +@override final bool? trash; +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? unitName; +@override final String? city; +@override final String? province; +@override final bool? active; +@override final int? user; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BuyerCopyWith<_Buyer> get copyWith => __$BuyerCopyWithImpl<_Buyer>(this, _$identity); + +@override +Map toJson() { + return _$BuyerToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Buyer&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.active, active) || other.active == active)&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,active,user); + +@override +String toString() { + return 'Buyer(key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, active: $active, user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class _$BuyerCopyWith<$Res> implements $BuyerCopyWith<$Res> { + factory _$BuyerCopyWith(_Buyer value, $Res Function(_Buyer) _then) = __$BuyerCopyWithImpl; +@override @useResult +$Res call({ + String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user +}); + + + + +} +/// @nodoc +class __$BuyerCopyWithImpl<$Res> + implements _$BuyerCopyWith<$Res> { + __$BuyerCopyWithImpl(this._self, this._then); + + final _Buyer _self; + final $Res Function(_Buyer) _then; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? active = freezed,Object? user = freezed,}) { + return _then(_Buyer( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$RequestsInfo { + + int? get numberOfRequests; int? get totalQuantity; double? get totalWeight; +/// Create a copy of RequestsInfo +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RequestsInfoCopyWith get copyWith => _$RequestsInfoCopyWithImpl(this as RequestsInfo, _$identity); + + /// Serializes this RequestsInfo to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RequestsInfo&&(identical(other.numberOfRequests, numberOfRequests) || other.numberOfRequests == numberOfRequests)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&(identical(other.totalWeight, totalWeight) || other.totalWeight == totalWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,numberOfRequests,totalQuantity,totalWeight); + +@override +String toString() { + return 'RequestsInfo(numberOfRequests: $numberOfRequests, totalQuantity: $totalQuantity, totalWeight: $totalWeight)'; +} + + +} + +/// @nodoc +abstract mixin class $RequestsInfoCopyWith<$Res> { + factory $RequestsInfoCopyWith(RequestsInfo value, $Res Function(RequestsInfo) _then) = _$RequestsInfoCopyWithImpl; +@useResult +$Res call({ + int? numberOfRequests, int? totalQuantity, double? totalWeight +}); + + + + +} +/// @nodoc +class _$RequestsInfoCopyWithImpl<$Res> + implements $RequestsInfoCopyWith<$Res> { + _$RequestsInfoCopyWithImpl(this._self, this._then); + + final RequestsInfo _self; + final $Res Function(RequestsInfo) _then; + +/// Create a copy of RequestsInfo +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? numberOfRequests = freezed,Object? totalQuantity = freezed,Object? totalWeight = freezed,}) { + return _then(_self.copyWith( +numberOfRequests: freezed == numberOfRequests ? _self.numberOfRequests : numberOfRequests // ignore: cast_nullable_to_non_nullable +as int?,totalQuantity: freezed == totalQuantity ? _self.totalQuantity : totalQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalWeight: freezed == totalWeight ? _self.totalWeight : totalWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [RequestsInfo]. +extension RequestsInfoPatterns on RequestsInfo { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _RequestsInfo value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _RequestsInfo() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _RequestsInfo value) $default,){ +final _that = this; +switch (_that) { +case _RequestsInfo(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _RequestsInfo value)? $default,){ +final _that = this; +switch (_that) { +case _RequestsInfo() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? numberOfRequests, int? totalQuantity, double? totalWeight)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _RequestsInfo() when $default != null: +return $default(_that.numberOfRequests,_that.totalQuantity,_that.totalWeight);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? numberOfRequests, int? totalQuantity, double? totalWeight) $default,) {final _that = this; +switch (_that) { +case _RequestsInfo(): +return $default(_that.numberOfRequests,_that.totalQuantity,_that.totalWeight);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? numberOfRequests, int? totalQuantity, double? totalWeight)? $default,) {final _that = this; +switch (_that) { +case _RequestsInfo() when $default != null: +return $default(_that.numberOfRequests,_that.totalQuantity,_that.totalWeight);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _RequestsInfo implements RequestsInfo { + const _RequestsInfo({this.numberOfRequests, this.totalQuantity, this.totalWeight}); + factory _RequestsInfo.fromJson(Map json) => _$RequestsInfoFromJson(json); + +@override final int? numberOfRequests; +@override final int? totalQuantity; +@override final double? totalWeight; + +/// Create a copy of RequestsInfo +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RequestsInfoCopyWith<_RequestsInfo> get copyWith => __$RequestsInfoCopyWithImpl<_RequestsInfo>(this, _$identity); + +@override +Map toJson() { + return _$RequestsInfoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RequestsInfo&&(identical(other.numberOfRequests, numberOfRequests) || other.numberOfRequests == numberOfRequests)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&(identical(other.totalWeight, totalWeight) || other.totalWeight == totalWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,numberOfRequests,totalQuantity,totalWeight); + +@override +String toString() { + return 'RequestsInfo(numberOfRequests: $numberOfRequests, totalQuantity: $totalQuantity, totalWeight: $totalWeight)'; +} + + +} + +/// @nodoc +abstract mixin class _$RequestsInfoCopyWith<$Res> implements $RequestsInfoCopyWith<$Res> { + factory _$RequestsInfoCopyWith(_RequestsInfo value, $Res Function(_RequestsInfo) _then) = __$RequestsInfoCopyWithImpl; +@override @useResult +$Res call({ + int? numberOfRequests, int? totalQuantity, double? totalWeight +}); + + + + +} +/// @nodoc +class __$RequestsInfoCopyWithImpl<$Res> + implements _$RequestsInfoCopyWith<$Res> { + __$RequestsInfoCopyWithImpl(this._self, this._then); + + final _RequestsInfo _self; + final $Res Function(_RequestsInfo) _then; + +/// Create a copy of RequestsInfo +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? numberOfRequests = freezed,Object? totalQuantity = freezed,Object? totalWeight = freezed,}) { + return _then(_RequestsInfo( +numberOfRequests: freezed == numberOfRequests ? _self.numberOfRequests : numberOfRequests // ignore: cast_nullable_to_non_nullable +as int?,totalQuantity: freezed == totalQuantity ? _self.totalQuantity : totalQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalWeight: freezed == totalWeight ? _self.totalWeight : totalWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.g.dart b/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.g.dart new file mode 100644 index 0000000..c042f9f --- /dev/null +++ b/packages/chicken/lib/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.g.dart @@ -0,0 +1,95 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'out_province_carcasses_buyer.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_OutProvinceCarcassesBuyer _$OutProvinceCarcassesBuyerFromJson( + Map json, +) => _OutProvinceCarcassesBuyer( + buyer: json['buyer'] == null + ? null + : Buyer.fromJson(json['buyer'] as Map), + requestsInfo: json['requests_info'] == null + ? null + : RequestsInfo.fromJson(json['requests_info'] as Map), + key: json['key'] as String?, + trash: json['trash'] as bool?, + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + unitName: json['unit_name'] as String?, + city: json['city'] as String?, + province: json['province'] as String?, + role: json['role'] as String?, + active: json['active'] as bool?, + typeActivity: json['type_activity'] as String?, + killHouse: json['kill_house'], + steward: (json['steward'] as num?)?.toInt(), +); + +Map _$OutProvinceCarcassesBuyerToJson( + _OutProvinceCarcassesBuyer instance, +) => { + 'buyer': instance.buyer, + 'requests_info': instance.requestsInfo, + 'key': instance.key, + 'trash': instance.trash, + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'unit_name': instance.unitName, + 'city': instance.city, + 'province': instance.province, + 'role': instance.role, + 'active': instance.active, + 'type_activity': instance.typeActivity, + 'kill_house': instance.killHouse, + 'steward': instance.steward, +}; + +_Buyer _$BuyerFromJson(Map json) => _Buyer( + key: json['key'] as String?, + trash: json['trash'] as bool?, + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + unitName: json['unit_name'] as String?, + city: json['city'] as String?, + province: json['province'] as String?, + active: json['active'] as bool?, + user: (json['user'] as num?)?.toInt(), +); + +Map _$BuyerToJson(_Buyer instance) => { + 'key': instance.key, + 'trash': instance.trash, + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'unit_name': instance.unitName, + 'city': instance.city, + 'province': instance.province, + 'active': instance.active, + 'user': instance.user, +}; + +_RequestsInfo _$RequestsInfoFromJson(Map json) => + _RequestsInfo( + numberOfRequests: (json['number_of_requests'] as num?)?.toInt(), + totalQuantity: (json['total_quantity'] as num?)?.toInt(), + totalWeight: (json['total_weight'] as num?)?.toDouble(), + ); + +Map _$RequestsInfoToJson(_RequestsInfo instance) => + { + 'number_of_requests': instance.numberOfRequests, + 'total_quantity': instance.totalQuantity, + 'total_weight': instance.totalWeight, + }; diff --git a/packages/chicken/lib/data/models/response/roles_products/roles_products.dart b/packages/chicken/lib/data/models/response/roles_products/roles_products.dart new file mode 100644 index 0000000..34b30f0 --- /dev/null +++ b/packages/chicken/lib/data/models/response/roles_products/roles_products.dart @@ -0,0 +1,67 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'roles_products.freezed.dart'; +part 'roles_products.g.dart'; + +@freezed +abstract class RolesProductsModel with _$RolesProductsModel { + factory RolesProductsModel({required List products}) = + _RolesProductsModel; + + factory RolesProductsModel.fromJson(Map json) => + _$RolesProductsModelFromJson(json); +} + +@freezed +abstract class ProductModel with _$ProductModel { + factory ProductModel({ + int? id, + String? key, + String? create_date, // Changed from createDate, removed @JsonKey + String? modify_date, // Changed from modifyDate, removed @JsonKey + bool? trash, + String? name, + int? provinceGovernmentalCarcassesQuantity, + int? provinceGovernmentalCarcassesWeight, + int? provinceFreeCarcassesQuantity, + int? provinceFreeCarcassesWeight, + int? receiveGovernmentalCarcassesQuantity, + int? receiveGovernmentalCarcassesWeight, + int? receiveFreeCarcassesQuantity, + int? receiveFreeCarcassesWeight, + int? freeBuyingCarcassesQuantity, + int? freeBuyingCarcassesWeight, + int? totalGovernmentalCarcassesQuantity, + int? totalGovernmentalCarcassesWeight, + int? totalFreeBarsCarcassesQuantity, + int? totalFreeBarsCarcassesWeight, + double? weightAverage, + int? totalCarcassesQuantity, + int? totalCarcassesWeight, + int? freezingQuantity, + int? freezingWeight, + int? lossWeight, + int? outProvinceAllocatedQuantity, + int? outProvinceAllocatedWeight, + int? provinceAllocatedQuantity, + int? provinceAllocatedWeight, + int? realAllocatedQuantity, + int? realAllocatedWeight, + int? coldHouseAllocatedWeight, + int? posAllocatedWeight, + int? segmentationWeight, + int? totalRemainQuantity, + int? totalRemainWeight, + int? freePrice, + int? approvedPrice, + bool? approvedPriceStatus, + dynamic createdBy, + dynamic modifiedBy, + int? parentProduct, + dynamic killHouse, + int? guild, + }) = _ProductModel; + + factory ProductModel.fromJson(Map json) => + _$ProductModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/roles_products/roles_products.freezed.dart b/packages/chicken/lib/data/models/response/roles_products/roles_products.freezed.dart new file mode 100644 index 0000000..714a49d --- /dev/null +++ b/packages/chicken/lib/data/models/response/roles_products/roles_products.freezed.dart @@ -0,0 +1,682 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'roles_products.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$RolesProductsModel { + + List get products; +/// Create a copy of RolesProductsModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RolesProductsModelCopyWith get copyWith => _$RolesProductsModelCopyWithImpl(this as RolesProductsModel, _$identity); + + /// Serializes this RolesProductsModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RolesProductsModel&&const DeepCollectionEquality().equals(other.products, products)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(products)); + +@override +String toString() { + return 'RolesProductsModel(products: $products)'; +} + + +} + +/// @nodoc +abstract mixin class $RolesProductsModelCopyWith<$Res> { + factory $RolesProductsModelCopyWith(RolesProductsModel value, $Res Function(RolesProductsModel) _then) = _$RolesProductsModelCopyWithImpl; +@useResult +$Res call({ + List products +}); + + + + +} +/// @nodoc +class _$RolesProductsModelCopyWithImpl<$Res> + implements $RolesProductsModelCopyWith<$Res> { + _$RolesProductsModelCopyWithImpl(this._self, this._then); + + final RolesProductsModel _self; + final $Res Function(RolesProductsModel) _then; + +/// Create a copy of RolesProductsModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? products = null,}) { + return _then(_self.copyWith( +products: null == products ? _self.products : products // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [RolesProductsModel]. +extension RolesProductsModelPatterns on RolesProductsModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _RolesProductsModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _RolesProductsModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _RolesProductsModel value) $default,){ +final _that = this; +switch (_that) { +case _RolesProductsModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _RolesProductsModel value)? $default,){ +final _that = this; +switch (_that) { +case _RolesProductsModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( List products)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _RolesProductsModel() when $default != null: +return $default(_that.products);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( List products) $default,) {final _that = this; +switch (_that) { +case _RolesProductsModel(): +return $default(_that.products);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( List products)? $default,) {final _that = this; +switch (_that) { +case _RolesProductsModel() when $default != null: +return $default(_that.products);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _RolesProductsModel implements RolesProductsModel { + _RolesProductsModel({required final List products}): _products = products; + factory _RolesProductsModel.fromJson(Map json) => _$RolesProductsModelFromJson(json); + + final List _products; +@override List get products { + if (_products is EqualUnmodifiableListView) return _products; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_products); +} + + +/// Create a copy of RolesProductsModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RolesProductsModelCopyWith<_RolesProductsModel> get copyWith => __$RolesProductsModelCopyWithImpl<_RolesProductsModel>(this, _$identity); + +@override +Map toJson() { + return _$RolesProductsModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RolesProductsModel&&const DeepCollectionEquality().equals(other._products, _products)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_products)); + +@override +String toString() { + return 'RolesProductsModel(products: $products)'; +} + + +} + +/// @nodoc +abstract mixin class _$RolesProductsModelCopyWith<$Res> implements $RolesProductsModelCopyWith<$Res> { + factory _$RolesProductsModelCopyWith(_RolesProductsModel value, $Res Function(_RolesProductsModel) _then) = __$RolesProductsModelCopyWithImpl; +@override @useResult +$Res call({ + List products +}); + + + + +} +/// @nodoc +class __$RolesProductsModelCopyWithImpl<$Res> + implements _$RolesProductsModelCopyWith<$Res> { + __$RolesProductsModelCopyWithImpl(this._self, this._then); + + final _RolesProductsModel _self; + final $Res Function(_RolesProductsModel) _then; + +/// Create a copy of RolesProductsModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? products = null,}) { + return _then(_RolesProductsModel( +products: null == products ? _self._products : products // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + + +/// @nodoc +mixin _$ProductModel { + + int? get id; String? get key; String? get create_date;// Changed from createDate, removed @JsonKey + String? get modify_date;// Changed from modifyDate, removed @JsonKey + bool? get trash; String? get name; int? get provinceGovernmentalCarcassesQuantity; int? get provinceGovernmentalCarcassesWeight; int? get provinceFreeCarcassesQuantity; int? get provinceFreeCarcassesWeight; int? get receiveGovernmentalCarcassesQuantity; int? get receiveGovernmentalCarcassesWeight; int? get receiveFreeCarcassesQuantity; int? get receiveFreeCarcassesWeight; int? get freeBuyingCarcassesQuantity; int? get freeBuyingCarcassesWeight; int? get totalGovernmentalCarcassesQuantity; int? get totalGovernmentalCarcassesWeight; int? get totalFreeBarsCarcassesQuantity; int? get totalFreeBarsCarcassesWeight; double? get weightAverage; int? get totalCarcassesQuantity; int? get totalCarcassesWeight; int? get freezingQuantity; int? get freezingWeight; int? get lossWeight; int? get outProvinceAllocatedQuantity; int? get outProvinceAllocatedWeight; int? get provinceAllocatedQuantity; int? get provinceAllocatedWeight; int? get realAllocatedQuantity; int? get realAllocatedWeight; int? get coldHouseAllocatedWeight; int? get posAllocatedWeight; int? get segmentationWeight; int? get totalRemainQuantity; int? get totalRemainWeight; int? get freePrice; int? get approvedPrice; bool? get approvedPriceStatus; dynamic get createdBy; dynamic get modifiedBy; int? get parentProduct; dynamic get killHouse; int? get guild; +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProductModelCopyWith get copyWith => _$ProductModelCopyWithImpl(this as ProductModel, _$identity); + + /// Serializes this ProductModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.create_date, create_date) || other.create_date == create_date)&&(identical(other.modify_date, modify_date) || other.modify_date == modify_date)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.name, name) || other.name == name)&&(identical(other.provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesQuantity) || other.provinceGovernmentalCarcassesQuantity == provinceGovernmentalCarcassesQuantity)&&(identical(other.provinceGovernmentalCarcassesWeight, provinceGovernmentalCarcassesWeight) || other.provinceGovernmentalCarcassesWeight == provinceGovernmentalCarcassesWeight)&&(identical(other.provinceFreeCarcassesQuantity, provinceFreeCarcassesQuantity) || other.provinceFreeCarcassesQuantity == provinceFreeCarcassesQuantity)&&(identical(other.provinceFreeCarcassesWeight, provinceFreeCarcassesWeight) || other.provinceFreeCarcassesWeight == provinceFreeCarcassesWeight)&&(identical(other.receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesQuantity) || other.receiveGovernmentalCarcassesQuantity == receiveGovernmentalCarcassesQuantity)&&(identical(other.receiveGovernmentalCarcassesWeight, receiveGovernmentalCarcassesWeight) || other.receiveGovernmentalCarcassesWeight == receiveGovernmentalCarcassesWeight)&&(identical(other.receiveFreeCarcassesQuantity, receiveFreeCarcassesQuantity) || other.receiveFreeCarcassesQuantity == receiveFreeCarcassesQuantity)&&(identical(other.receiveFreeCarcassesWeight, receiveFreeCarcassesWeight) || other.receiveFreeCarcassesWeight == receiveFreeCarcassesWeight)&&(identical(other.freeBuyingCarcassesQuantity, freeBuyingCarcassesQuantity) || other.freeBuyingCarcassesQuantity == freeBuyingCarcassesQuantity)&&(identical(other.freeBuyingCarcassesWeight, freeBuyingCarcassesWeight) || other.freeBuyingCarcassesWeight == freeBuyingCarcassesWeight)&&(identical(other.totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesQuantity) || other.totalGovernmentalCarcassesQuantity == totalGovernmentalCarcassesQuantity)&&(identical(other.totalGovernmentalCarcassesWeight, totalGovernmentalCarcassesWeight) || other.totalGovernmentalCarcassesWeight == totalGovernmentalCarcassesWeight)&&(identical(other.totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesQuantity) || other.totalFreeBarsCarcassesQuantity == totalFreeBarsCarcassesQuantity)&&(identical(other.totalFreeBarsCarcassesWeight, totalFreeBarsCarcassesWeight) || other.totalFreeBarsCarcassesWeight == totalFreeBarsCarcassesWeight)&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)&&(identical(other.totalCarcassesQuantity, totalCarcassesQuantity) || other.totalCarcassesQuantity == totalCarcassesQuantity)&&(identical(other.totalCarcassesWeight, totalCarcassesWeight) || other.totalCarcassesWeight == totalCarcassesWeight)&&(identical(other.freezingQuantity, freezingQuantity) || other.freezingQuantity == freezingQuantity)&&(identical(other.freezingWeight, freezingWeight) || other.freezingWeight == freezingWeight)&&(identical(other.lossWeight, lossWeight) || other.lossWeight == lossWeight)&&(identical(other.outProvinceAllocatedQuantity, outProvinceAllocatedQuantity) || other.outProvinceAllocatedQuantity == outProvinceAllocatedQuantity)&&(identical(other.outProvinceAllocatedWeight, outProvinceAllocatedWeight) || other.outProvinceAllocatedWeight == outProvinceAllocatedWeight)&&(identical(other.provinceAllocatedQuantity, provinceAllocatedQuantity) || other.provinceAllocatedQuantity == provinceAllocatedQuantity)&&(identical(other.provinceAllocatedWeight, provinceAllocatedWeight) || other.provinceAllocatedWeight == provinceAllocatedWeight)&&(identical(other.realAllocatedQuantity, realAllocatedQuantity) || other.realAllocatedQuantity == realAllocatedQuantity)&&(identical(other.realAllocatedWeight, realAllocatedWeight) || other.realAllocatedWeight == realAllocatedWeight)&&(identical(other.coldHouseAllocatedWeight, coldHouseAllocatedWeight) || other.coldHouseAllocatedWeight == coldHouseAllocatedWeight)&&(identical(other.posAllocatedWeight, posAllocatedWeight) || other.posAllocatedWeight == posAllocatedWeight)&&(identical(other.segmentationWeight, segmentationWeight) || other.segmentationWeight == segmentationWeight)&&(identical(other.totalRemainQuantity, totalRemainQuantity) || other.totalRemainQuantity == totalRemainQuantity)&&(identical(other.totalRemainWeight, totalRemainWeight) || other.totalRemainWeight == totalRemainWeight)&&(identical(other.freePrice, freePrice) || other.freePrice == freePrice)&&(identical(other.approvedPrice, approvedPrice) || other.approvedPrice == approvedPrice)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.parentProduct, parentProduct) || other.parentProduct == parentProduct)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&(identical(other.guild, guild) || other.guild == guild)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,key,create_date,modify_date,trash,name,provinceGovernmentalCarcassesQuantity,provinceGovernmentalCarcassesWeight,provinceFreeCarcassesQuantity,provinceFreeCarcassesWeight,receiveGovernmentalCarcassesQuantity,receiveGovernmentalCarcassesWeight,receiveFreeCarcassesQuantity,receiveFreeCarcassesWeight,freeBuyingCarcassesQuantity,freeBuyingCarcassesWeight,totalGovernmentalCarcassesQuantity,totalGovernmentalCarcassesWeight,totalFreeBarsCarcassesQuantity,totalFreeBarsCarcassesWeight,weightAverage,totalCarcassesQuantity,totalCarcassesWeight,freezingQuantity,freezingWeight,lossWeight,outProvinceAllocatedQuantity,outProvinceAllocatedWeight,provinceAllocatedQuantity,provinceAllocatedWeight,realAllocatedQuantity,realAllocatedWeight,coldHouseAllocatedWeight,posAllocatedWeight,segmentationWeight,totalRemainQuantity,totalRemainWeight,freePrice,approvedPrice,approvedPriceStatus,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),parentProduct,const DeepCollectionEquality().hash(killHouse),guild]); + +@override +String toString() { + return 'ProductModel(id: $id, key: $key, create_date: $create_date, modify_date: $modify_date, trash: $trash, name: $name, provinceGovernmentalCarcassesQuantity: $provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesWeight: $provinceGovernmentalCarcassesWeight, provinceFreeCarcassesQuantity: $provinceFreeCarcassesQuantity, provinceFreeCarcassesWeight: $provinceFreeCarcassesWeight, receiveGovernmentalCarcassesQuantity: $receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesWeight: $receiveGovernmentalCarcassesWeight, receiveFreeCarcassesQuantity: $receiveFreeCarcassesQuantity, receiveFreeCarcassesWeight: $receiveFreeCarcassesWeight, freeBuyingCarcassesQuantity: $freeBuyingCarcassesQuantity, freeBuyingCarcassesWeight: $freeBuyingCarcassesWeight, totalGovernmentalCarcassesQuantity: $totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesWeight: $totalGovernmentalCarcassesWeight, totalFreeBarsCarcassesQuantity: $totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesWeight: $totalFreeBarsCarcassesWeight, weightAverage: $weightAverage, totalCarcassesQuantity: $totalCarcassesQuantity, totalCarcassesWeight: $totalCarcassesWeight, freezingQuantity: $freezingQuantity, freezingWeight: $freezingWeight, lossWeight: $lossWeight, outProvinceAllocatedQuantity: $outProvinceAllocatedQuantity, outProvinceAllocatedWeight: $outProvinceAllocatedWeight, provinceAllocatedQuantity: $provinceAllocatedQuantity, provinceAllocatedWeight: $provinceAllocatedWeight, realAllocatedQuantity: $realAllocatedQuantity, realAllocatedWeight: $realAllocatedWeight, coldHouseAllocatedWeight: $coldHouseAllocatedWeight, posAllocatedWeight: $posAllocatedWeight, segmentationWeight: $segmentationWeight, totalRemainQuantity: $totalRemainQuantity, totalRemainWeight: $totalRemainWeight, freePrice: $freePrice, approvedPrice: $approvedPrice, approvedPriceStatus: $approvedPriceStatus, createdBy: $createdBy, modifiedBy: $modifiedBy, parentProduct: $parentProduct, killHouse: $killHouse, guild: $guild)'; +} + + +} + +/// @nodoc +abstract mixin class $ProductModelCopyWith<$Res> { + factory $ProductModelCopyWith(ProductModel value, $Res Function(ProductModel) _then) = _$ProductModelCopyWithImpl; +@useResult +$Res call({ + int? id, String? key, String? create_date, String? modify_date, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, dynamic createdBy, dynamic modifiedBy, int? parentProduct, dynamic killHouse, int? guild +}); + + + + +} +/// @nodoc +class _$ProductModelCopyWithImpl<$Res> + implements $ProductModelCopyWith<$Res> { + _$ProductModelCopyWithImpl(this._self, this._then); + + final ProductModel _self; + final $Res Function(ProductModel) _then; + +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? key = freezed,Object? create_date = freezed,Object? modify_date = freezed,Object? trash = freezed,Object? name = freezed,Object? provinceGovernmentalCarcassesQuantity = freezed,Object? provinceGovernmentalCarcassesWeight = freezed,Object? provinceFreeCarcassesQuantity = freezed,Object? provinceFreeCarcassesWeight = freezed,Object? receiveGovernmentalCarcassesQuantity = freezed,Object? receiveGovernmentalCarcassesWeight = freezed,Object? receiveFreeCarcassesQuantity = freezed,Object? receiveFreeCarcassesWeight = freezed,Object? freeBuyingCarcassesQuantity = freezed,Object? freeBuyingCarcassesWeight = freezed,Object? totalGovernmentalCarcassesQuantity = freezed,Object? totalGovernmentalCarcassesWeight = freezed,Object? totalFreeBarsCarcassesQuantity = freezed,Object? totalFreeBarsCarcassesWeight = freezed,Object? weightAverage = freezed,Object? totalCarcassesQuantity = freezed,Object? totalCarcassesWeight = freezed,Object? freezingQuantity = freezed,Object? freezingWeight = freezed,Object? lossWeight = freezed,Object? outProvinceAllocatedQuantity = freezed,Object? outProvinceAllocatedWeight = freezed,Object? provinceAllocatedQuantity = freezed,Object? provinceAllocatedWeight = freezed,Object? realAllocatedQuantity = freezed,Object? realAllocatedWeight = freezed,Object? coldHouseAllocatedWeight = freezed,Object? posAllocatedWeight = freezed,Object? segmentationWeight = freezed,Object? totalRemainQuantity = freezed,Object? totalRemainWeight = freezed,Object? freePrice = freezed,Object? approvedPrice = freezed,Object? approvedPriceStatus = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? parentProduct = freezed,Object? killHouse = freezed,Object? guild = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,create_date: freezed == create_date ? _self.create_date : create_date // ignore: cast_nullable_to_non_nullable +as String?,modify_date: freezed == modify_date ? _self.modify_date : modify_date // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,provinceGovernmentalCarcassesQuantity: freezed == provinceGovernmentalCarcassesQuantity ? _self.provinceGovernmentalCarcassesQuantity : provinceGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceGovernmentalCarcassesWeight: freezed == provinceGovernmentalCarcassesWeight ? _self.provinceGovernmentalCarcassesWeight : provinceGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesQuantity: freezed == provinceFreeCarcassesQuantity ? _self.provinceFreeCarcassesQuantity : provinceFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesWeight: freezed == provinceFreeCarcassesWeight ? _self.provinceFreeCarcassesWeight : provinceFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesQuantity: freezed == receiveGovernmentalCarcassesQuantity ? _self.receiveGovernmentalCarcassesQuantity : receiveGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesWeight: freezed == receiveGovernmentalCarcassesWeight ? _self.receiveGovernmentalCarcassesWeight : receiveGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesQuantity: freezed == receiveFreeCarcassesQuantity ? _self.receiveFreeCarcassesQuantity : receiveFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesWeight: freezed == receiveFreeCarcassesWeight ? _self.receiveFreeCarcassesWeight : receiveFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesQuantity: freezed == freeBuyingCarcassesQuantity ? _self.freeBuyingCarcassesQuantity : freeBuyingCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesWeight: freezed == freeBuyingCarcassesWeight ? _self.freeBuyingCarcassesWeight : freeBuyingCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesQuantity: freezed == totalGovernmentalCarcassesQuantity ? _self.totalGovernmentalCarcassesQuantity : totalGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesWeight: freezed == totalGovernmentalCarcassesWeight ? _self.totalGovernmentalCarcassesWeight : totalGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesQuantity: freezed == totalFreeBarsCarcassesQuantity ? _self.totalFreeBarsCarcassesQuantity : totalFreeBarsCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesWeight: freezed == totalFreeBarsCarcassesWeight ? _self.totalFreeBarsCarcassesWeight : totalFreeBarsCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?,totalCarcassesQuantity: freezed == totalCarcassesQuantity ? _self.totalCarcassesQuantity : totalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalCarcassesWeight: freezed == totalCarcassesWeight ? _self.totalCarcassesWeight : totalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freezingQuantity: freezed == freezingQuantity ? _self.freezingQuantity : freezingQuantity // ignore: cast_nullable_to_non_nullable +as int?,freezingWeight: freezed == freezingWeight ? _self.freezingWeight : freezingWeight // ignore: cast_nullable_to_non_nullable +as int?,lossWeight: freezed == lossWeight ? _self.lossWeight : lossWeight // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedQuantity: freezed == outProvinceAllocatedQuantity ? _self.outProvinceAllocatedQuantity : outProvinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedWeight: freezed == outProvinceAllocatedWeight ? _self.outProvinceAllocatedWeight : outProvinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedQuantity: freezed == provinceAllocatedQuantity ? _self.provinceAllocatedQuantity : provinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedWeight: freezed == provinceAllocatedWeight ? _self.provinceAllocatedWeight : provinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedQuantity: freezed == realAllocatedQuantity ? _self.realAllocatedQuantity : realAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedWeight: freezed == realAllocatedWeight ? _self.realAllocatedWeight : realAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,coldHouseAllocatedWeight: freezed == coldHouseAllocatedWeight ? _self.coldHouseAllocatedWeight : coldHouseAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,posAllocatedWeight: freezed == posAllocatedWeight ? _self.posAllocatedWeight : posAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,segmentationWeight: freezed == segmentationWeight ? _self.segmentationWeight : segmentationWeight // ignore: cast_nullable_to_non_nullable +as int?,totalRemainQuantity: freezed == totalRemainQuantity ? _self.totalRemainQuantity : totalRemainQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalRemainWeight: freezed == totalRemainWeight ? _self.totalRemainWeight : totalRemainWeight // ignore: cast_nullable_to_non_nullable +as int?,freePrice: freezed == freePrice ? _self.freePrice : freePrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPrice: freezed == approvedPrice ? _self.approvedPrice : approvedPrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,parentProduct: freezed == parentProduct ? _self.parentProduct : parentProduct // ignore: cast_nullable_to_non_nullable +as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ProductModel]. +extension ProductModelPatterns on ProductModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ProductModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ProductModel value) $default,){ +final _that = this; +switch (_that) { +case _ProductModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ProductModel value)? $default,){ +final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? key, String? create_date, String? modify_date, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, dynamic createdBy, dynamic modifiedBy, int? parentProduct, dynamic killHouse, int? guild)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that.id,_that.key,_that.create_date,_that.modify_date,_that.trash,_that.name,_that.provinceGovernmentalCarcassesQuantity,_that.provinceGovernmentalCarcassesWeight,_that.provinceFreeCarcassesQuantity,_that.provinceFreeCarcassesWeight,_that.receiveGovernmentalCarcassesQuantity,_that.receiveGovernmentalCarcassesWeight,_that.receiveFreeCarcassesQuantity,_that.receiveFreeCarcassesWeight,_that.freeBuyingCarcassesQuantity,_that.freeBuyingCarcassesWeight,_that.totalGovernmentalCarcassesQuantity,_that.totalGovernmentalCarcassesWeight,_that.totalFreeBarsCarcassesQuantity,_that.totalFreeBarsCarcassesWeight,_that.weightAverage,_that.totalCarcassesQuantity,_that.totalCarcassesWeight,_that.freezingQuantity,_that.freezingWeight,_that.lossWeight,_that.outProvinceAllocatedQuantity,_that.outProvinceAllocatedWeight,_that.provinceAllocatedQuantity,_that.provinceAllocatedWeight,_that.realAllocatedQuantity,_that.realAllocatedWeight,_that.coldHouseAllocatedWeight,_that.posAllocatedWeight,_that.segmentationWeight,_that.totalRemainQuantity,_that.totalRemainWeight,_that.freePrice,_that.approvedPrice,_that.approvedPriceStatus,_that.createdBy,_that.modifiedBy,_that.parentProduct,_that.killHouse,_that.guild);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? key, String? create_date, String? modify_date, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, dynamic createdBy, dynamic modifiedBy, int? parentProduct, dynamic killHouse, int? guild) $default,) {final _that = this; +switch (_that) { +case _ProductModel(): +return $default(_that.id,_that.key,_that.create_date,_that.modify_date,_that.trash,_that.name,_that.provinceGovernmentalCarcassesQuantity,_that.provinceGovernmentalCarcassesWeight,_that.provinceFreeCarcassesQuantity,_that.provinceFreeCarcassesWeight,_that.receiveGovernmentalCarcassesQuantity,_that.receiveGovernmentalCarcassesWeight,_that.receiveFreeCarcassesQuantity,_that.receiveFreeCarcassesWeight,_that.freeBuyingCarcassesQuantity,_that.freeBuyingCarcassesWeight,_that.totalGovernmentalCarcassesQuantity,_that.totalGovernmentalCarcassesWeight,_that.totalFreeBarsCarcassesQuantity,_that.totalFreeBarsCarcassesWeight,_that.weightAverage,_that.totalCarcassesQuantity,_that.totalCarcassesWeight,_that.freezingQuantity,_that.freezingWeight,_that.lossWeight,_that.outProvinceAllocatedQuantity,_that.outProvinceAllocatedWeight,_that.provinceAllocatedQuantity,_that.provinceAllocatedWeight,_that.realAllocatedQuantity,_that.realAllocatedWeight,_that.coldHouseAllocatedWeight,_that.posAllocatedWeight,_that.segmentationWeight,_that.totalRemainQuantity,_that.totalRemainWeight,_that.freePrice,_that.approvedPrice,_that.approvedPriceStatus,_that.createdBy,_that.modifiedBy,_that.parentProduct,_that.killHouse,_that.guild);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? key, String? create_date, String? modify_date, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, dynamic createdBy, dynamic modifiedBy, int? parentProduct, dynamic killHouse, int? guild)? $default,) {final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that.id,_that.key,_that.create_date,_that.modify_date,_that.trash,_that.name,_that.provinceGovernmentalCarcassesQuantity,_that.provinceGovernmentalCarcassesWeight,_that.provinceFreeCarcassesQuantity,_that.provinceFreeCarcassesWeight,_that.receiveGovernmentalCarcassesQuantity,_that.receiveGovernmentalCarcassesWeight,_that.receiveFreeCarcassesQuantity,_that.receiveFreeCarcassesWeight,_that.freeBuyingCarcassesQuantity,_that.freeBuyingCarcassesWeight,_that.totalGovernmentalCarcassesQuantity,_that.totalGovernmentalCarcassesWeight,_that.totalFreeBarsCarcassesQuantity,_that.totalFreeBarsCarcassesWeight,_that.weightAverage,_that.totalCarcassesQuantity,_that.totalCarcassesWeight,_that.freezingQuantity,_that.freezingWeight,_that.lossWeight,_that.outProvinceAllocatedQuantity,_that.outProvinceAllocatedWeight,_that.provinceAllocatedQuantity,_that.provinceAllocatedWeight,_that.realAllocatedQuantity,_that.realAllocatedWeight,_that.coldHouseAllocatedWeight,_that.posAllocatedWeight,_that.segmentationWeight,_that.totalRemainQuantity,_that.totalRemainWeight,_that.freePrice,_that.approvedPrice,_that.approvedPriceStatus,_that.createdBy,_that.modifiedBy,_that.parentProduct,_that.killHouse,_that.guild);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ProductModel implements ProductModel { + _ProductModel({this.id, this.key, this.create_date, this.modify_date, this.trash, this.name, this.provinceGovernmentalCarcassesQuantity, this.provinceGovernmentalCarcassesWeight, this.provinceFreeCarcassesQuantity, this.provinceFreeCarcassesWeight, this.receiveGovernmentalCarcassesQuantity, this.receiveGovernmentalCarcassesWeight, this.receiveFreeCarcassesQuantity, this.receiveFreeCarcassesWeight, this.freeBuyingCarcassesQuantity, this.freeBuyingCarcassesWeight, this.totalGovernmentalCarcassesQuantity, this.totalGovernmentalCarcassesWeight, this.totalFreeBarsCarcassesQuantity, this.totalFreeBarsCarcassesWeight, this.weightAverage, this.totalCarcassesQuantity, this.totalCarcassesWeight, this.freezingQuantity, this.freezingWeight, this.lossWeight, this.outProvinceAllocatedQuantity, this.outProvinceAllocatedWeight, this.provinceAllocatedQuantity, this.provinceAllocatedWeight, this.realAllocatedQuantity, this.realAllocatedWeight, this.coldHouseAllocatedWeight, this.posAllocatedWeight, this.segmentationWeight, this.totalRemainQuantity, this.totalRemainWeight, this.freePrice, this.approvedPrice, this.approvedPriceStatus, this.createdBy, this.modifiedBy, this.parentProduct, this.killHouse, this.guild}); + factory _ProductModel.fromJson(Map json) => _$ProductModelFromJson(json); + +@override final int? id; +@override final String? key; +@override final String? create_date; +// Changed from createDate, removed @JsonKey +@override final String? modify_date; +// Changed from modifyDate, removed @JsonKey +@override final bool? trash; +@override final String? name; +@override final int? provinceGovernmentalCarcassesQuantity; +@override final int? provinceGovernmentalCarcassesWeight; +@override final int? provinceFreeCarcassesQuantity; +@override final int? provinceFreeCarcassesWeight; +@override final int? receiveGovernmentalCarcassesQuantity; +@override final int? receiveGovernmentalCarcassesWeight; +@override final int? receiveFreeCarcassesQuantity; +@override final int? receiveFreeCarcassesWeight; +@override final int? freeBuyingCarcassesQuantity; +@override final int? freeBuyingCarcassesWeight; +@override final int? totalGovernmentalCarcassesQuantity; +@override final int? totalGovernmentalCarcassesWeight; +@override final int? totalFreeBarsCarcassesQuantity; +@override final int? totalFreeBarsCarcassesWeight; +@override final double? weightAverage; +@override final int? totalCarcassesQuantity; +@override final int? totalCarcassesWeight; +@override final int? freezingQuantity; +@override final int? freezingWeight; +@override final int? lossWeight; +@override final int? outProvinceAllocatedQuantity; +@override final int? outProvinceAllocatedWeight; +@override final int? provinceAllocatedQuantity; +@override final int? provinceAllocatedWeight; +@override final int? realAllocatedQuantity; +@override final int? realAllocatedWeight; +@override final int? coldHouseAllocatedWeight; +@override final int? posAllocatedWeight; +@override final int? segmentationWeight; +@override final int? totalRemainQuantity; +@override final int? totalRemainWeight; +@override final int? freePrice; +@override final int? approvedPrice; +@override final bool? approvedPriceStatus; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final int? parentProduct; +@override final dynamic killHouse; +@override final int? guild; + +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProductModelCopyWith<_ProductModel> get copyWith => __$ProductModelCopyWithImpl<_ProductModel>(this, _$identity); + +@override +Map toJson() { + return _$ProductModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.create_date, create_date) || other.create_date == create_date)&&(identical(other.modify_date, modify_date) || other.modify_date == modify_date)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.name, name) || other.name == name)&&(identical(other.provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesQuantity) || other.provinceGovernmentalCarcassesQuantity == provinceGovernmentalCarcassesQuantity)&&(identical(other.provinceGovernmentalCarcassesWeight, provinceGovernmentalCarcassesWeight) || other.provinceGovernmentalCarcassesWeight == provinceGovernmentalCarcassesWeight)&&(identical(other.provinceFreeCarcassesQuantity, provinceFreeCarcassesQuantity) || other.provinceFreeCarcassesQuantity == provinceFreeCarcassesQuantity)&&(identical(other.provinceFreeCarcassesWeight, provinceFreeCarcassesWeight) || other.provinceFreeCarcassesWeight == provinceFreeCarcassesWeight)&&(identical(other.receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesQuantity) || other.receiveGovernmentalCarcassesQuantity == receiveGovernmentalCarcassesQuantity)&&(identical(other.receiveGovernmentalCarcassesWeight, receiveGovernmentalCarcassesWeight) || other.receiveGovernmentalCarcassesWeight == receiveGovernmentalCarcassesWeight)&&(identical(other.receiveFreeCarcassesQuantity, receiveFreeCarcassesQuantity) || other.receiveFreeCarcassesQuantity == receiveFreeCarcassesQuantity)&&(identical(other.receiveFreeCarcassesWeight, receiveFreeCarcassesWeight) || other.receiveFreeCarcassesWeight == receiveFreeCarcassesWeight)&&(identical(other.freeBuyingCarcassesQuantity, freeBuyingCarcassesQuantity) || other.freeBuyingCarcassesQuantity == freeBuyingCarcassesQuantity)&&(identical(other.freeBuyingCarcassesWeight, freeBuyingCarcassesWeight) || other.freeBuyingCarcassesWeight == freeBuyingCarcassesWeight)&&(identical(other.totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesQuantity) || other.totalGovernmentalCarcassesQuantity == totalGovernmentalCarcassesQuantity)&&(identical(other.totalGovernmentalCarcassesWeight, totalGovernmentalCarcassesWeight) || other.totalGovernmentalCarcassesWeight == totalGovernmentalCarcassesWeight)&&(identical(other.totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesQuantity) || other.totalFreeBarsCarcassesQuantity == totalFreeBarsCarcassesQuantity)&&(identical(other.totalFreeBarsCarcassesWeight, totalFreeBarsCarcassesWeight) || other.totalFreeBarsCarcassesWeight == totalFreeBarsCarcassesWeight)&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)&&(identical(other.totalCarcassesQuantity, totalCarcassesQuantity) || other.totalCarcassesQuantity == totalCarcassesQuantity)&&(identical(other.totalCarcassesWeight, totalCarcassesWeight) || other.totalCarcassesWeight == totalCarcassesWeight)&&(identical(other.freezingQuantity, freezingQuantity) || other.freezingQuantity == freezingQuantity)&&(identical(other.freezingWeight, freezingWeight) || other.freezingWeight == freezingWeight)&&(identical(other.lossWeight, lossWeight) || other.lossWeight == lossWeight)&&(identical(other.outProvinceAllocatedQuantity, outProvinceAllocatedQuantity) || other.outProvinceAllocatedQuantity == outProvinceAllocatedQuantity)&&(identical(other.outProvinceAllocatedWeight, outProvinceAllocatedWeight) || other.outProvinceAllocatedWeight == outProvinceAllocatedWeight)&&(identical(other.provinceAllocatedQuantity, provinceAllocatedQuantity) || other.provinceAllocatedQuantity == provinceAllocatedQuantity)&&(identical(other.provinceAllocatedWeight, provinceAllocatedWeight) || other.provinceAllocatedWeight == provinceAllocatedWeight)&&(identical(other.realAllocatedQuantity, realAllocatedQuantity) || other.realAllocatedQuantity == realAllocatedQuantity)&&(identical(other.realAllocatedWeight, realAllocatedWeight) || other.realAllocatedWeight == realAllocatedWeight)&&(identical(other.coldHouseAllocatedWeight, coldHouseAllocatedWeight) || other.coldHouseAllocatedWeight == coldHouseAllocatedWeight)&&(identical(other.posAllocatedWeight, posAllocatedWeight) || other.posAllocatedWeight == posAllocatedWeight)&&(identical(other.segmentationWeight, segmentationWeight) || other.segmentationWeight == segmentationWeight)&&(identical(other.totalRemainQuantity, totalRemainQuantity) || other.totalRemainQuantity == totalRemainQuantity)&&(identical(other.totalRemainWeight, totalRemainWeight) || other.totalRemainWeight == totalRemainWeight)&&(identical(other.freePrice, freePrice) || other.freePrice == freePrice)&&(identical(other.approvedPrice, approvedPrice) || other.approvedPrice == approvedPrice)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.parentProduct, parentProduct) || other.parentProduct == parentProduct)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&(identical(other.guild, guild) || other.guild == guild)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,key,create_date,modify_date,trash,name,provinceGovernmentalCarcassesQuantity,provinceGovernmentalCarcassesWeight,provinceFreeCarcassesQuantity,provinceFreeCarcassesWeight,receiveGovernmentalCarcassesQuantity,receiveGovernmentalCarcassesWeight,receiveFreeCarcassesQuantity,receiveFreeCarcassesWeight,freeBuyingCarcassesQuantity,freeBuyingCarcassesWeight,totalGovernmentalCarcassesQuantity,totalGovernmentalCarcassesWeight,totalFreeBarsCarcassesQuantity,totalFreeBarsCarcassesWeight,weightAverage,totalCarcassesQuantity,totalCarcassesWeight,freezingQuantity,freezingWeight,lossWeight,outProvinceAllocatedQuantity,outProvinceAllocatedWeight,provinceAllocatedQuantity,provinceAllocatedWeight,realAllocatedQuantity,realAllocatedWeight,coldHouseAllocatedWeight,posAllocatedWeight,segmentationWeight,totalRemainQuantity,totalRemainWeight,freePrice,approvedPrice,approvedPriceStatus,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),parentProduct,const DeepCollectionEquality().hash(killHouse),guild]); + +@override +String toString() { + return 'ProductModel(id: $id, key: $key, create_date: $create_date, modify_date: $modify_date, trash: $trash, name: $name, provinceGovernmentalCarcassesQuantity: $provinceGovernmentalCarcassesQuantity, provinceGovernmentalCarcassesWeight: $provinceGovernmentalCarcassesWeight, provinceFreeCarcassesQuantity: $provinceFreeCarcassesQuantity, provinceFreeCarcassesWeight: $provinceFreeCarcassesWeight, receiveGovernmentalCarcassesQuantity: $receiveGovernmentalCarcassesQuantity, receiveGovernmentalCarcassesWeight: $receiveGovernmentalCarcassesWeight, receiveFreeCarcassesQuantity: $receiveFreeCarcassesQuantity, receiveFreeCarcassesWeight: $receiveFreeCarcassesWeight, freeBuyingCarcassesQuantity: $freeBuyingCarcassesQuantity, freeBuyingCarcassesWeight: $freeBuyingCarcassesWeight, totalGovernmentalCarcassesQuantity: $totalGovernmentalCarcassesQuantity, totalGovernmentalCarcassesWeight: $totalGovernmentalCarcassesWeight, totalFreeBarsCarcassesQuantity: $totalFreeBarsCarcassesQuantity, totalFreeBarsCarcassesWeight: $totalFreeBarsCarcassesWeight, weightAverage: $weightAverage, totalCarcassesQuantity: $totalCarcassesQuantity, totalCarcassesWeight: $totalCarcassesWeight, freezingQuantity: $freezingQuantity, freezingWeight: $freezingWeight, lossWeight: $lossWeight, outProvinceAllocatedQuantity: $outProvinceAllocatedQuantity, outProvinceAllocatedWeight: $outProvinceAllocatedWeight, provinceAllocatedQuantity: $provinceAllocatedQuantity, provinceAllocatedWeight: $provinceAllocatedWeight, realAllocatedQuantity: $realAllocatedQuantity, realAllocatedWeight: $realAllocatedWeight, coldHouseAllocatedWeight: $coldHouseAllocatedWeight, posAllocatedWeight: $posAllocatedWeight, segmentationWeight: $segmentationWeight, totalRemainQuantity: $totalRemainQuantity, totalRemainWeight: $totalRemainWeight, freePrice: $freePrice, approvedPrice: $approvedPrice, approvedPriceStatus: $approvedPriceStatus, createdBy: $createdBy, modifiedBy: $modifiedBy, parentProduct: $parentProduct, killHouse: $killHouse, guild: $guild)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProductModelCopyWith<$Res> implements $ProductModelCopyWith<$Res> { + factory _$ProductModelCopyWith(_ProductModel value, $Res Function(_ProductModel) _then) = __$ProductModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? key, String? create_date, String? modify_date, bool? trash, String? name, int? provinceGovernmentalCarcassesQuantity, int? provinceGovernmentalCarcassesWeight, int? provinceFreeCarcassesQuantity, int? provinceFreeCarcassesWeight, int? receiveGovernmentalCarcassesQuantity, int? receiveGovernmentalCarcassesWeight, int? receiveFreeCarcassesQuantity, int? receiveFreeCarcassesWeight, int? freeBuyingCarcassesQuantity, int? freeBuyingCarcassesWeight, int? totalGovernmentalCarcassesQuantity, int? totalGovernmentalCarcassesWeight, int? totalFreeBarsCarcassesQuantity, int? totalFreeBarsCarcassesWeight, double? weightAverage, int? totalCarcassesQuantity, int? totalCarcassesWeight, int? freezingQuantity, int? freezingWeight, int? lossWeight, int? outProvinceAllocatedQuantity, int? outProvinceAllocatedWeight, int? provinceAllocatedQuantity, int? provinceAllocatedWeight, int? realAllocatedQuantity, int? realAllocatedWeight, int? coldHouseAllocatedWeight, int? posAllocatedWeight, int? segmentationWeight, int? totalRemainQuantity, int? totalRemainWeight, int? freePrice, int? approvedPrice, bool? approvedPriceStatus, dynamic createdBy, dynamic modifiedBy, int? parentProduct, dynamic killHouse, int? guild +}); + + + + +} +/// @nodoc +class __$ProductModelCopyWithImpl<$Res> + implements _$ProductModelCopyWith<$Res> { + __$ProductModelCopyWithImpl(this._self, this._then); + + final _ProductModel _self; + final $Res Function(_ProductModel) _then; + +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? key = freezed,Object? create_date = freezed,Object? modify_date = freezed,Object? trash = freezed,Object? name = freezed,Object? provinceGovernmentalCarcassesQuantity = freezed,Object? provinceGovernmentalCarcassesWeight = freezed,Object? provinceFreeCarcassesQuantity = freezed,Object? provinceFreeCarcassesWeight = freezed,Object? receiveGovernmentalCarcassesQuantity = freezed,Object? receiveGovernmentalCarcassesWeight = freezed,Object? receiveFreeCarcassesQuantity = freezed,Object? receiveFreeCarcassesWeight = freezed,Object? freeBuyingCarcassesQuantity = freezed,Object? freeBuyingCarcassesWeight = freezed,Object? totalGovernmentalCarcassesQuantity = freezed,Object? totalGovernmentalCarcassesWeight = freezed,Object? totalFreeBarsCarcassesQuantity = freezed,Object? totalFreeBarsCarcassesWeight = freezed,Object? weightAverage = freezed,Object? totalCarcassesQuantity = freezed,Object? totalCarcassesWeight = freezed,Object? freezingQuantity = freezed,Object? freezingWeight = freezed,Object? lossWeight = freezed,Object? outProvinceAllocatedQuantity = freezed,Object? outProvinceAllocatedWeight = freezed,Object? provinceAllocatedQuantity = freezed,Object? provinceAllocatedWeight = freezed,Object? realAllocatedQuantity = freezed,Object? realAllocatedWeight = freezed,Object? coldHouseAllocatedWeight = freezed,Object? posAllocatedWeight = freezed,Object? segmentationWeight = freezed,Object? totalRemainQuantity = freezed,Object? totalRemainWeight = freezed,Object? freePrice = freezed,Object? approvedPrice = freezed,Object? approvedPriceStatus = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? parentProduct = freezed,Object? killHouse = freezed,Object? guild = freezed,}) { + return _then(_ProductModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,create_date: freezed == create_date ? _self.create_date : create_date // ignore: cast_nullable_to_non_nullable +as String?,modify_date: freezed == modify_date ? _self.modify_date : modify_date // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,provinceGovernmentalCarcassesQuantity: freezed == provinceGovernmentalCarcassesQuantity ? _self.provinceGovernmentalCarcassesQuantity : provinceGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceGovernmentalCarcassesWeight: freezed == provinceGovernmentalCarcassesWeight ? _self.provinceGovernmentalCarcassesWeight : provinceGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesQuantity: freezed == provinceFreeCarcassesQuantity ? _self.provinceFreeCarcassesQuantity : provinceFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceFreeCarcassesWeight: freezed == provinceFreeCarcassesWeight ? _self.provinceFreeCarcassesWeight : provinceFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesQuantity: freezed == receiveGovernmentalCarcassesQuantity ? _self.receiveGovernmentalCarcassesQuantity : receiveGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveGovernmentalCarcassesWeight: freezed == receiveGovernmentalCarcassesWeight ? _self.receiveGovernmentalCarcassesWeight : receiveGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesQuantity: freezed == receiveFreeCarcassesQuantity ? _self.receiveFreeCarcassesQuantity : receiveFreeCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,receiveFreeCarcassesWeight: freezed == receiveFreeCarcassesWeight ? _self.receiveFreeCarcassesWeight : receiveFreeCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesQuantity: freezed == freeBuyingCarcassesQuantity ? _self.freeBuyingCarcassesQuantity : freeBuyingCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,freeBuyingCarcassesWeight: freezed == freeBuyingCarcassesWeight ? _self.freeBuyingCarcassesWeight : freeBuyingCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesQuantity: freezed == totalGovernmentalCarcassesQuantity ? _self.totalGovernmentalCarcassesQuantity : totalGovernmentalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalGovernmentalCarcassesWeight: freezed == totalGovernmentalCarcassesWeight ? _self.totalGovernmentalCarcassesWeight : totalGovernmentalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesQuantity: freezed == totalFreeBarsCarcassesQuantity ? _self.totalFreeBarsCarcassesQuantity : totalFreeBarsCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalFreeBarsCarcassesWeight: freezed == totalFreeBarsCarcassesWeight ? _self.totalFreeBarsCarcassesWeight : totalFreeBarsCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?,totalCarcassesQuantity: freezed == totalCarcassesQuantity ? _self.totalCarcassesQuantity : totalCarcassesQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalCarcassesWeight: freezed == totalCarcassesWeight ? _self.totalCarcassesWeight : totalCarcassesWeight // ignore: cast_nullable_to_non_nullable +as int?,freezingQuantity: freezed == freezingQuantity ? _self.freezingQuantity : freezingQuantity // ignore: cast_nullable_to_non_nullable +as int?,freezingWeight: freezed == freezingWeight ? _self.freezingWeight : freezingWeight // ignore: cast_nullable_to_non_nullable +as int?,lossWeight: freezed == lossWeight ? _self.lossWeight : lossWeight // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedQuantity: freezed == outProvinceAllocatedQuantity ? _self.outProvinceAllocatedQuantity : outProvinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,outProvinceAllocatedWeight: freezed == outProvinceAllocatedWeight ? _self.outProvinceAllocatedWeight : outProvinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedQuantity: freezed == provinceAllocatedQuantity ? _self.provinceAllocatedQuantity : provinceAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceAllocatedWeight: freezed == provinceAllocatedWeight ? _self.provinceAllocatedWeight : provinceAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedQuantity: freezed == realAllocatedQuantity ? _self.realAllocatedQuantity : realAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,realAllocatedWeight: freezed == realAllocatedWeight ? _self.realAllocatedWeight : realAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,coldHouseAllocatedWeight: freezed == coldHouseAllocatedWeight ? _self.coldHouseAllocatedWeight : coldHouseAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,posAllocatedWeight: freezed == posAllocatedWeight ? _self.posAllocatedWeight : posAllocatedWeight // ignore: cast_nullable_to_non_nullable +as int?,segmentationWeight: freezed == segmentationWeight ? _self.segmentationWeight : segmentationWeight // ignore: cast_nullable_to_non_nullable +as int?,totalRemainQuantity: freezed == totalRemainQuantity ? _self.totalRemainQuantity : totalRemainQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalRemainWeight: freezed == totalRemainWeight ? _self.totalRemainWeight : totalRemainWeight // ignore: cast_nullable_to_non_nullable +as int?,freePrice: freezed == freePrice ? _self.freePrice : freePrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPrice: freezed == approvedPrice ? _self.approvedPrice : approvedPrice // ignore: cast_nullable_to_non_nullable +as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,parentProduct: freezed == parentProduct ? _self.parentProduct : parentProduct // ignore: cast_nullable_to_non_nullable +as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/roles_products/roles_products.g.dart b/packages/chicken/lib/data/models/response/roles_products/roles_products.g.dart new file mode 100644 index 0000000..a81b24d --- /dev/null +++ b/packages/chicken/lib/data/models/response/roles_products/roles_products.g.dart @@ -0,0 +1,141 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'roles_products.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_RolesProductsModel _$RolesProductsModelFromJson(Map json) => + _RolesProductsModel( + products: (json['products'] as List) + .map((e) => ProductModel.fromJson(e as Map)) + .toList(), + ); + +Map _$RolesProductsModelToJson(_RolesProductsModel instance) => + {'products': instance.products}; + +_ProductModel _$ProductModelFromJson( + Map json, +) => _ProductModel( + id: (json['id'] as num?)?.toInt(), + key: json['key'] as String?, + create_date: json['create_date'] as String?, + modify_date: json['modify_date'] as String?, + trash: json['trash'] as bool?, + name: json['name'] as String?, + provinceGovernmentalCarcassesQuantity: + (json['province_governmental_carcasses_quantity'] as num?)?.toInt(), + provinceGovernmentalCarcassesWeight: + (json['province_governmental_carcasses_weight'] as num?)?.toInt(), + provinceFreeCarcassesQuantity: + (json['province_free_carcasses_quantity'] as num?)?.toInt(), + provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?) + ?.toInt(), + receiveGovernmentalCarcassesQuantity: + (json['receive_governmental_carcasses_quantity'] as num?)?.toInt(), + receiveGovernmentalCarcassesWeight: + (json['receive_governmental_carcasses_weight'] as num?)?.toInt(), + receiveFreeCarcassesQuantity: + (json['receive_free_carcasses_quantity'] as num?)?.toInt(), + receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?) + ?.toInt(), + freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?) + ?.toInt(), + freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?) + ?.toInt(), + totalGovernmentalCarcassesQuantity: + (json['total_governmental_carcasses_quantity'] as num?)?.toInt(), + totalGovernmentalCarcassesWeight: + (json['total_governmental_carcasses_weight'] as num?)?.toInt(), + totalFreeBarsCarcassesQuantity: + (json['total_free_bars_carcasses_quantity'] as num?)?.toInt(), + totalFreeBarsCarcassesWeight: + (json['total_free_bars_carcasses_weight'] as num?)?.toInt(), + weightAverage: (json['weight_average'] as num?)?.toDouble(), + totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(), + totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(), + freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(), + freezingWeight: (json['freezing_weight'] as num?)?.toInt(), + lossWeight: (json['loss_weight'] as num?)?.toInt(), + outProvinceAllocatedQuantity: + (json['out_province_allocated_quantity'] as num?)?.toInt(), + outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?) + ?.toInt(), + provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?) + ?.toInt(), + provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(), + realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(), + realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(), + coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?) + ?.toInt(), + posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(), + segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(), + totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(), + totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(), + freePrice: (json['free_price'] as num?)?.toInt(), + approvedPrice: (json['approved_price'] as num?)?.toInt(), + approvedPriceStatus: json['approved_price_status'] as bool?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + parentProduct: (json['parent_product'] as num?)?.toInt(), + killHouse: json['kill_house'], + guild: (json['guild'] as num?)?.toInt(), +); + +Map _$ProductModelToJson( + _ProductModel instance, +) => { + 'id': instance.id, + 'key': instance.key, + 'create_date': instance.create_date, + 'modify_date': instance.modify_date, + 'trash': instance.trash, + 'name': instance.name, + 'province_governmental_carcasses_quantity': + instance.provinceGovernmentalCarcassesQuantity, + 'province_governmental_carcasses_weight': + instance.provinceGovernmentalCarcassesWeight, + 'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity, + 'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight, + 'receive_governmental_carcasses_quantity': + instance.receiveGovernmentalCarcassesQuantity, + 'receive_governmental_carcasses_weight': + instance.receiveGovernmentalCarcassesWeight, + 'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity, + 'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight, + 'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity, + 'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight, + 'total_governmental_carcasses_quantity': + instance.totalGovernmentalCarcassesQuantity, + 'total_governmental_carcasses_weight': + instance.totalGovernmentalCarcassesWeight, + 'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity, + 'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight, + 'weight_average': instance.weightAverage, + 'total_carcasses_quantity': instance.totalCarcassesQuantity, + 'total_carcasses_weight': instance.totalCarcassesWeight, + 'freezing_quantity': instance.freezingQuantity, + 'freezing_weight': instance.freezingWeight, + 'loss_weight': instance.lossWeight, + 'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity, + 'out_province_allocated_weight': instance.outProvinceAllocatedWeight, + 'province_allocated_quantity': instance.provinceAllocatedQuantity, + 'province_allocated_weight': instance.provinceAllocatedWeight, + 'real_allocated_quantity': instance.realAllocatedQuantity, + 'real_allocated_weight': instance.realAllocatedWeight, + 'cold_house_allocated_weight': instance.coldHouseAllocatedWeight, + 'pos_allocated_weight': instance.posAllocatedWeight, + 'segmentation_weight': instance.segmentationWeight, + 'total_remain_quantity': instance.totalRemainQuantity, + 'total_remain_weight': instance.totalRemainWeight, + 'free_price': instance.freePrice, + 'approved_price': instance.approvedPrice, + 'approved_price_status': instance.approvedPriceStatus, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'parent_product': instance.parentProduct, + 'kill_house': instance.killHouse, + 'guild': instance.guild, +}; diff --git a/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.dart b/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.dart new file mode 100644 index 0000000..c9b1052 --- /dev/null +++ b/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.dart @@ -0,0 +1,62 @@ +// segmentation_model.dart +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'segmentation_model.freezed.dart'; +part 'segmentation_model.g.dart'; + +@freezed +abstract class SegmentationModel with _$SegmentationModel { + const factory SegmentationModel({ + String? key, + String? productKey, + String? guildKey, + String? result, + int? weight, + Buyer? buyer, + DateTime? date, + ToGuild? toGuild, + }) = _SegmentationModel; + + factory SegmentationModel.fromJson(Map json) => + _$SegmentationModelFromJson(json); +} + +@freezed +abstract class Buyer with _$Buyer { + const factory Buyer({ + String? fullname, + String? mobile, + String? shop, + }) = _Buyer; + + factory Buyer.fromJson(Map json) => _$BuyerFromJson(json); +} + +@freezed +abstract class ToGuild with _$ToGuild { + const factory ToGuild({ + String? key, + String? guildsName, + String? typeActivity, + String? areaActivity, + String? guildsId, + bool? steward, + User? user, + }) = _ToGuild; + + factory ToGuild.fromJson(Map json) => _$ToGuildFromJson(json); +} + +@freezed +abstract class User with _$User { + const factory User({ + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? nationalId, + String? city, + }) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.freezed.dart b/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.freezed.dart new file mode 100644 index 0000000..5efe966 --- /dev/null +++ b/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.freezed.dart @@ -0,0 +1,1198 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'segmentation_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$SegmentationModel { + + String? get key; String? get productKey; String? get guildKey; String? get result; int? get weight; Buyer? get buyer; DateTime? get date; ToGuild? get toGuild; +/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SegmentationModelCopyWith get copyWith => _$SegmentationModelCopyWithImpl(this as SegmentationModel, _$identity); + + /// Serializes this SegmentationModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SegmentationModel&&(identical(other.key, key) || other.key == key)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.result, result) || other.result == result)&&(identical(other.weight, weight) || other.weight == weight)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.date, date) || other.date == date)&&(identical(other.toGuild, toGuild) || other.toGuild == toGuild)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,productKey,guildKey,result,weight,buyer,date,toGuild); + +@override +String toString() { + return 'SegmentationModel(key: $key, productKey: $productKey, guildKey: $guildKey, result: $result, weight: $weight, buyer: $buyer, date: $date, toGuild: $toGuild)'; +} + + +} + +/// @nodoc +abstract mixin class $SegmentationModelCopyWith<$Res> { + factory $SegmentationModelCopyWith(SegmentationModel value, $Res Function(SegmentationModel) _then) = _$SegmentationModelCopyWithImpl; +@useResult +$Res call({ + String? key, String? productKey, String? guildKey, String? result, int? weight, Buyer? buyer, DateTime? date, ToGuild? toGuild +}); + + +$BuyerCopyWith<$Res>? get buyer;$ToGuildCopyWith<$Res>? get toGuild; + +} +/// @nodoc +class _$SegmentationModelCopyWithImpl<$Res> + implements $SegmentationModelCopyWith<$Res> { + _$SegmentationModelCopyWithImpl(this._self, this._then); + + final SegmentationModel _self; + final $Res Function(SegmentationModel) _then; + +/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? productKey = freezed,Object? guildKey = freezed,Object? result = freezed,Object? weight = freezed,Object? buyer = freezed,Object? date = freezed,Object? toGuild = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable +as String?,result: freezed == result ? _self.result : result // ignore: cast_nullable_to_non_nullable +as String?,weight: freezed == weight ? _self.weight : weight // ignore: cast_nullable_to_non_nullable +as int?,buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable +as Buyer?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,toGuild: freezed == toGuild ? _self.toGuild : toGuild // ignore: cast_nullable_to_non_nullable +as ToGuild?, + )); +} +/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerCopyWith<$Res>? get buyer { + if (_self.buyer == null) { + return null; + } + + return $BuyerCopyWith<$Res>(_self.buyer!, (value) { + return _then(_self.copyWith(buyer: value)); + }); +}/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ToGuildCopyWith<$Res>? get toGuild { + if (_self.toGuild == null) { + return null; + } + + return $ToGuildCopyWith<$Res>(_self.toGuild!, (value) { + return _then(_self.copyWith(toGuild: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [SegmentationModel]. +extension SegmentationModelPatterns on SegmentationModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SegmentationModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SegmentationModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SegmentationModel value) $default,){ +final _that = this; +switch (_that) { +case _SegmentationModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SegmentationModel value)? $default,){ +final _that = this; +switch (_that) { +case _SegmentationModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? productKey, String? guildKey, String? result, int? weight, Buyer? buyer, DateTime? date, ToGuild? toGuild)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SegmentationModel() when $default != null: +return $default(_that.key,_that.productKey,_that.guildKey,_that.result,_that.weight,_that.buyer,_that.date,_that.toGuild);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? productKey, String? guildKey, String? result, int? weight, Buyer? buyer, DateTime? date, ToGuild? toGuild) $default,) {final _that = this; +switch (_that) { +case _SegmentationModel(): +return $default(_that.key,_that.productKey,_that.guildKey,_that.result,_that.weight,_that.buyer,_that.date,_that.toGuild);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? productKey, String? guildKey, String? result, int? weight, Buyer? buyer, DateTime? date, ToGuild? toGuild)? $default,) {final _that = this; +switch (_that) { +case _SegmentationModel() when $default != null: +return $default(_that.key,_that.productKey,_that.guildKey,_that.result,_that.weight,_that.buyer,_that.date,_that.toGuild);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _SegmentationModel implements SegmentationModel { + const _SegmentationModel({this.key, this.productKey, this.guildKey, this.result, this.weight, this.buyer, this.date, this.toGuild}); + factory _SegmentationModel.fromJson(Map json) => _$SegmentationModelFromJson(json); + +@override final String? key; +@override final String? productKey; +@override final String? guildKey; +@override final String? result; +@override final int? weight; +@override final Buyer? buyer; +@override final DateTime? date; +@override final ToGuild? toGuild; + +/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SegmentationModelCopyWith<_SegmentationModel> get copyWith => __$SegmentationModelCopyWithImpl<_SegmentationModel>(this, _$identity); + +@override +Map toJson() { + return _$SegmentationModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SegmentationModel&&(identical(other.key, key) || other.key == key)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.result, result) || other.result == result)&&(identical(other.weight, weight) || other.weight == weight)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.date, date) || other.date == date)&&(identical(other.toGuild, toGuild) || other.toGuild == toGuild)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,productKey,guildKey,result,weight,buyer,date,toGuild); + +@override +String toString() { + return 'SegmentationModel(key: $key, productKey: $productKey, guildKey: $guildKey, result: $result, weight: $weight, buyer: $buyer, date: $date, toGuild: $toGuild)'; +} + + +} + +/// @nodoc +abstract mixin class _$SegmentationModelCopyWith<$Res> implements $SegmentationModelCopyWith<$Res> { + factory _$SegmentationModelCopyWith(_SegmentationModel value, $Res Function(_SegmentationModel) _then) = __$SegmentationModelCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? productKey, String? guildKey, String? result, int? weight, Buyer? buyer, DateTime? date, ToGuild? toGuild +}); + + +@override $BuyerCopyWith<$Res>? get buyer;@override $ToGuildCopyWith<$Res>? get toGuild; + +} +/// @nodoc +class __$SegmentationModelCopyWithImpl<$Res> + implements _$SegmentationModelCopyWith<$Res> { + __$SegmentationModelCopyWithImpl(this._self, this._then); + + final _SegmentationModel _self; + final $Res Function(_SegmentationModel) _then; + +/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? productKey = freezed,Object? guildKey = freezed,Object? result = freezed,Object? weight = freezed,Object? buyer = freezed,Object? date = freezed,Object? toGuild = freezed,}) { + return _then(_SegmentationModel( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable +as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable +as String?,result: freezed == result ? _self.result : result // ignore: cast_nullable_to_non_nullable +as String?,weight: freezed == weight ? _self.weight : weight // ignore: cast_nullable_to_non_nullable +as int?,buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable +as Buyer?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,toGuild: freezed == toGuild ? _self.toGuild : toGuild // ignore: cast_nullable_to_non_nullable +as ToGuild?, + )); +} + +/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerCopyWith<$Res>? get buyer { + if (_self.buyer == null) { + return null; + } + + return $BuyerCopyWith<$Res>(_self.buyer!, (value) { + return _then(_self.copyWith(buyer: value)); + }); +}/// Create a copy of SegmentationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ToGuildCopyWith<$Res>? get toGuild { + if (_self.toGuild == null) { + return null; + } + + return $ToGuildCopyWith<$Res>(_self.toGuild!, (value) { + return _then(_self.copyWith(toGuild: value)); + }); +} +} + + +/// @nodoc +mixin _$Buyer { + + String? get fullname; String? get mobile; String? get shop; +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BuyerCopyWith get copyWith => _$BuyerCopyWithImpl(this as Buyer, _$identity); + + /// Serializes this Buyer to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Buyer&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.shop, shop) || other.shop == shop)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,mobile,shop); + +@override +String toString() { + return 'Buyer(fullname: $fullname, mobile: $mobile, shop: $shop)'; +} + + +} + +/// @nodoc +abstract mixin class $BuyerCopyWith<$Res> { + factory $BuyerCopyWith(Buyer value, $Res Function(Buyer) _then) = _$BuyerCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? mobile, String? shop +}); + + + + +} +/// @nodoc +class _$BuyerCopyWithImpl<$Res> + implements $BuyerCopyWith<$Res> { + _$BuyerCopyWithImpl(this._self, this._then); + + final Buyer _self; + final $Res Function(Buyer) _then; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? shop = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,shop: freezed == shop ? _self.shop : shop // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Buyer]. +extension BuyerPatterns on Buyer { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Buyer value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Buyer value) $default,){ +final _that = this; +switch (_that) { +case _Buyer(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Buyer value)? $default,){ +final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? mobile, String? shop)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that.fullname,_that.mobile,_that.shop);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? mobile, String? shop) $default,) {final _that = this; +switch (_that) { +case _Buyer(): +return $default(_that.fullname,_that.mobile,_that.shop);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? mobile, String? shop)? $default,) {final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that.fullname,_that.mobile,_that.shop);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Buyer implements Buyer { + const _Buyer({this.fullname, this.mobile, this.shop}); + factory _Buyer.fromJson(Map json) => _$BuyerFromJson(json); + +@override final String? fullname; +@override final String? mobile; +@override final String? shop; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BuyerCopyWith<_Buyer> get copyWith => __$BuyerCopyWithImpl<_Buyer>(this, _$identity); + +@override +Map toJson() { + return _$BuyerToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Buyer&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.shop, shop) || other.shop == shop)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,mobile,shop); + +@override +String toString() { + return 'Buyer(fullname: $fullname, mobile: $mobile, shop: $shop)'; +} + + +} + +/// @nodoc +abstract mixin class _$BuyerCopyWith<$Res> implements $BuyerCopyWith<$Res> { + factory _$BuyerCopyWith(_Buyer value, $Res Function(_Buyer) _then) = __$BuyerCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? mobile, String? shop +}); + + + + +} +/// @nodoc +class __$BuyerCopyWithImpl<$Res> + implements _$BuyerCopyWith<$Res> { + __$BuyerCopyWithImpl(this._self, this._then); + + final _Buyer _self; + final $Res Function(_Buyer) _then; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? shop = freezed,}) { + return _then(_Buyer( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,shop: freezed == shop ? _self.shop : shop // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$ToGuild { + + String? get key; String? get guildsName; String? get typeActivity; String? get areaActivity; String? get guildsId; bool? get steward; User? get user; +/// Create a copy of ToGuild +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ToGuildCopyWith get copyWith => _$ToGuildCopyWithImpl(this as ToGuild, _$identity); + + /// Serializes this ToGuild to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ToGuild&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,guildsName,typeActivity,areaActivity,guildsId,steward,user); + +@override +String toString() { + return 'ToGuild(key: $key, guildsName: $guildsName, typeActivity: $typeActivity, areaActivity: $areaActivity, guildsId: $guildsId, steward: $steward, user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class $ToGuildCopyWith<$Res> { + factory $ToGuildCopyWith(ToGuild value, $Res Function(ToGuild) _then) = _$ToGuildCopyWithImpl; +@useResult +$Res call({ + String? key, String? guildsName, String? typeActivity, String? areaActivity, String? guildsId, bool? steward, User? user +}); + + +$UserCopyWith<$Res>? get user; + +} +/// @nodoc +class _$ToGuildCopyWithImpl<$Res> + implements $ToGuildCopyWith<$Res> { + _$ToGuildCopyWithImpl(this._self, this._then); + + final ToGuild _self; + final $Res Function(ToGuild) _then; + +/// Create a copy of ToGuild +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? guildsName = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? guildsId = freezed,Object? steward = freezed,Object? user = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?, + )); +} +/// Create a copy of ToGuild +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ToGuild]. +extension ToGuildPatterns on ToGuild { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ToGuild value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ToGuild() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ToGuild value) $default,){ +final _that = this; +switch (_that) { +case _ToGuild(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ToGuild value)? $default,){ +final _that = this; +switch (_that) { +case _ToGuild() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? guildsName, String? typeActivity, String? areaActivity, String? guildsId, bool? steward, User? user)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ToGuild() when $default != null: +return $default(_that.key,_that.guildsName,_that.typeActivity,_that.areaActivity,_that.guildsId,_that.steward,_that.user);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? guildsName, String? typeActivity, String? areaActivity, String? guildsId, bool? steward, User? user) $default,) {final _that = this; +switch (_that) { +case _ToGuild(): +return $default(_that.key,_that.guildsName,_that.typeActivity,_that.areaActivity,_that.guildsId,_that.steward,_that.user);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? guildsName, String? typeActivity, String? areaActivity, String? guildsId, bool? steward, User? user)? $default,) {final _that = this; +switch (_that) { +case _ToGuild() when $default != null: +return $default(_that.key,_that.guildsName,_that.typeActivity,_that.areaActivity,_that.guildsId,_that.steward,_that.user);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ToGuild implements ToGuild { + const _ToGuild({this.key, this.guildsName, this.typeActivity, this.areaActivity, this.guildsId, this.steward, this.user}); + factory _ToGuild.fromJson(Map json) => _$ToGuildFromJson(json); + +@override final String? key; +@override final String? guildsName; +@override final String? typeActivity; +@override final String? areaActivity; +@override final String? guildsId; +@override final bool? steward; +@override final User? user; + +/// Create a copy of ToGuild +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ToGuildCopyWith<_ToGuild> get copyWith => __$ToGuildCopyWithImpl<_ToGuild>(this, _$identity); + +@override +Map toJson() { + return _$ToGuildToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ToGuild&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,guildsName,typeActivity,areaActivity,guildsId,steward,user); + +@override +String toString() { + return 'ToGuild(key: $key, guildsName: $guildsName, typeActivity: $typeActivity, areaActivity: $areaActivity, guildsId: $guildsId, steward: $steward, user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class _$ToGuildCopyWith<$Res> implements $ToGuildCopyWith<$Res> { + factory _$ToGuildCopyWith(_ToGuild value, $Res Function(_ToGuild) _then) = __$ToGuildCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? guildsName, String? typeActivity, String? areaActivity, String? guildsId, bool? steward, User? user +}); + + +@override $UserCopyWith<$Res>? get user; + +} +/// @nodoc +class __$ToGuildCopyWithImpl<$Res> + implements _$ToGuildCopyWith<$Res> { + __$ToGuildCopyWithImpl(this._self, this._then); + + final _ToGuild _self; + final $Res Function(_ToGuild) _then; + +/// Create a copy of ToGuild +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? guildsName = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? guildsId = freezed,Object? steward = freezed,Object? user = freezed,}) { + return _then(_ToGuild( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?, + )); +} + +/// Create a copy of ToGuild +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get nationalId; String? get city; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({this.fullname, this.firstName, this.lastName, this.mobile, this.nationalId, this.city}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? nationalId; +@override final String? city; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.g.dart b/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.g.dart new file mode 100644 index 0000000..6f4411a --- /dev/null +++ b/packages/chicken/lib/data/models/response/segmentation_model/segmentation_model.g.dart @@ -0,0 +1,89 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segmentation_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_SegmentationModel _$SegmentationModelFromJson(Map json) => + _SegmentationModel( + key: json['key'] as String?, + productKey: json['product_key'] as String?, + guildKey: json['guild_key'] as String?, + result: json['result'] as String?, + weight: (json['weight'] as num?)?.toInt(), + buyer: json['buyer'] == null + ? null + : Buyer.fromJson(json['buyer'] as Map), + date: json['date'] == null + ? null + : DateTime.parse(json['date'] as String), + toGuild: json['to_guild'] == null + ? null + : ToGuild.fromJson(json['to_guild'] as Map), + ); + +Map _$SegmentationModelToJson(_SegmentationModel instance) => + { + 'key': instance.key, + 'product_key': instance.productKey, + 'guild_key': instance.guildKey, + 'result': instance.result, + 'weight': instance.weight, + 'buyer': instance.buyer, + 'date': instance.date?.toIso8601String(), + 'to_guild': instance.toGuild, + }; + +_Buyer _$BuyerFromJson(Map json) => _Buyer( + fullname: json['fullname'] as String?, + mobile: json['mobile'] as String?, + shop: json['shop'] as String?, +); + +Map _$BuyerToJson(_Buyer instance) => { + 'fullname': instance.fullname, + 'mobile': instance.mobile, + 'shop': instance.shop, +}; + +_ToGuild _$ToGuildFromJson(Map json) => _ToGuild( + key: json['key'] as String?, + guildsName: json['guilds_name'] as String?, + typeActivity: json['type_activity'] as String?, + areaActivity: json['area_activity'] as String?, + guildsId: json['guilds_id'] as String?, + steward: json['steward'] as bool?, + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), +); + +Map _$ToGuildToJson(_ToGuild instance) => { + 'key': instance.key, + 'guilds_name': instance.guildsName, + 'type_activity': instance.typeActivity, + 'area_activity': instance.areaActivity, + 'guilds_id': instance.guildsId, + 'steward': instance.steward, + 'user': instance.user, +}; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + city: json['city'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'city': instance.city, +}; diff --git a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart new file mode 100644 index 0000000..d09c3a0 --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.dart @@ -0,0 +1,140 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'steward_free_bar.freezed.dart'; +part 'steward_free_bar.g.dart'; + +@freezed +abstract class StewardFreeBar with _$StewardFreeBar { + const factory StewardFreeBar({ + int? id, + Steward? steward, + dynamic guild, + Product? product, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + String? killHouseName, + String? killHouseMobile, + String? killHouseVetName, + String? killHouseVetMobile, + String? province, + String? city, + String? driverName, + String? driverMobile, + dynamic car, + String? pelak, + int? numberOfCarcasses, + double? weightOfCarcasses, + String? barImage, + String? date, + bool? temporaryTrash, + bool? temporaryDeleted, + String? createdBy, + String? modifiedBy, + }) = _StewardFreeBar; + + factory StewardFreeBar.fromJson(Map json) => + _$StewardFreeBarFromJson(json); +} + +@freezed +abstract class Steward with _$Steward { + const factory Steward({ + User? user, + String? guildsName, + bool? steward, + int? allocationLimit, + Address? address, + String? licenseNumber, + String? typeActivity, + String? areaActivity, + String? guildsId, + String? createDate, + }) = _Steward; + + factory Steward.fromJson(Map json) => _$StewardFromJson(json); +} + +@freezed +abstract class User with _$User { + const factory User({ + String? fullname, + String? firstName, + String? lastName, + int? baseOrder, + String? mobile, + String? nationalId, + String? nationalCode, + String? key, + City? city, + String? unitName, + String? unitNationalId, + String? unitRegistrationNumber, + String? unitEconomicalNumber, + String? unitProvince, + String? unitCity, + String? unitPostalCode, + String? unitAddress, + }) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} + +@freezed +abstract class City with _$City { + const factory City({ + int? id, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + int? provinceIdForeignKey, + int? cityIdKey, + String? name, + double? productPrice, + bool? provinceCenter, + int? cityNumber, + String? cityName, + int? provinceNumber, + String? provinceName, + String? createdBy, + String? modifiedBy, + int? province, + }) = _City; + + factory City.fromJson(Map json) => _$CityFromJson(json); +} + +@freezed +abstract class Address with _$Address { + const factory Address({ + Province? province, + City? city, + String? address, + String? postalCode, + }) = _Address; + + factory Address.fromJson(Map json) => _$AddressFromJson(json); +} + +@freezed +abstract class Province with _$Province { + const factory Province({ + String? key, + String? name, + }) = _Province; + + factory Province.fromJson(Map json) => + _$ProvinceFromJson(json); +} + +@freezed +abstract class Product with _$Product { + const factory Product({ + String? key, + String? name, + }) = _Product; + + factory Product.fromJson(Map json) => _$ProductFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart new file mode 100644 index 0000000..0a020c5 --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.freezed.dart @@ -0,0 +1,2236 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'steward_free_bar.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$StewardFreeBar { + + int? get id; Steward? get steward; dynamic get guild; Product? get product; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get killHouseName; String? get killHouseMobile; String? get killHouseVetName; String? get killHouseVetMobile; String? get province; String? get city; String? get driverName; String? get driverMobile; dynamic get car; String? get pelak; int? get numberOfCarcasses; double? get weightOfCarcasses; String? get barImage; String? get date; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy; +/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardFreeBarCopyWith get copyWith => _$StewardFreeBarCopyWithImpl(this as StewardFreeBar, _$identity); + + /// Serializes this StewardFreeBar to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeBar&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionEquality().hash(guild),product,key,createDate,modifyDate,trash,killHouseName,killHouseMobile,killHouseVetName,killHouseVetMobile,province,city,driverName,driverMobile,const DeepCollectionEquality().hash(car),pelak,numberOfCarcasses,weightOfCarcasses,barImage,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy]); + +@override +String toString() { + return 'StewardFreeBar(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardFreeBarCopyWith<$Res> { + factory $StewardFreeBarCopyWith(StewardFreeBar value, $Res Function(StewardFreeBar) _then) = _$StewardFreeBarCopyWithImpl; +@useResult +$Res call({ + int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy +}); + + +$StewardCopyWith<$Res>? get steward;$ProductCopyWith<$Res>? get product; + +} +/// @nodoc +class _$StewardFreeBarCopyWithImpl<$Res> + implements $StewardFreeBarCopyWith<$Res> { + _$StewardFreeBarCopyWithImpl(this._self, this._then); + + final StewardFreeBar _self; + final $Res Function(StewardFreeBar) _then; + +/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? killHouseVetName = freezed,Object? killHouseVetMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? pelak = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? barImage = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as Steward?,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as Product?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,killHouseName: freezed == killHouseName ? _self.killHouseName : killHouseName // ignore: cast_nullable_to_non_nullable +as String?,killHouseMobile: freezed == killHouseMobile ? _self.killHouseMobile : killHouseMobile // ignore: cast_nullable_to_non_nullable +as String?,killHouseVetName: freezed == killHouseVetName ? _self.killHouseVetName : killHouseVetName // ignore: cast_nullable_to_non_nullable +as String?,killHouseVetMobile: freezed == killHouseVetMobile ? _self.killHouseVetMobile : killHouseVetMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,pelak: freezed == pelak ? _self.pelak : pelak // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $StewardCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +}/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [StewardFreeBar]. +extension StewardFreeBarPatterns on StewardFreeBar { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardFreeBar value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardFreeBar() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardFreeBar value) $default,){ +final _that = this; +switch (_that) { +case _StewardFreeBar(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardFreeBar value)? $default,){ +final _that = this; +switch (_that) { +case _StewardFreeBar() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardFreeBar() when $default != null: +return $default(_that.id,_that.steward,_that.guild,_that.product,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.killHouseName,_that.killHouseMobile,_that.killHouseVetName,_that.killHouseVetMobile,_that.province,_that.city,_that.driverName,_that.driverMobile,_that.car,_that.pelak,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.barImage,_that.date,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy) $default,) {final _that = this; +switch (_that) { +case _StewardFreeBar(): +return $default(_that.id,_that.steward,_that.guild,_that.product,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.killHouseName,_that.killHouseMobile,_that.killHouseVetName,_that.killHouseVetMobile,_that.province,_that.city,_that.driverName,_that.driverMobile,_that.car,_that.pelak,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.barImage,_that.date,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy)? $default,) {final _that = this; +switch (_that) { +case _StewardFreeBar() when $default != null: +return $default(_that.id,_that.steward,_that.guild,_that.product,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.killHouseName,_that.killHouseMobile,_that.killHouseVetName,_that.killHouseVetMobile,_that.province,_that.city,_that.driverName,_that.driverMobile,_that.car,_that.pelak,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.barImage,_that.date,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardFreeBar implements StewardFreeBar { + const _StewardFreeBar({this.id, this.steward, this.guild, this.product, this.key, this.createDate, this.modifyDate, this.trash, this.killHouseName, this.killHouseMobile, this.killHouseVetName, this.killHouseVetMobile, this.province, this.city, this.driverName, this.driverMobile, this.car, this.pelak, this.numberOfCarcasses, this.weightOfCarcasses, this.barImage, this.date, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy}); + factory _StewardFreeBar.fromJson(Map json) => _$StewardFreeBarFromJson(json); + +@override final int? id; +@override final Steward? steward; +@override final dynamic guild; +@override final Product? product; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final String? killHouseName; +@override final String? killHouseMobile; +@override final String? killHouseVetName; +@override final String? killHouseVetMobile; +@override final String? province; +@override final String? city; +@override final String? driverName; +@override final String? driverMobile; +@override final dynamic car; +@override final String? pelak; +@override final int? numberOfCarcasses; +@override final double? weightOfCarcasses; +@override final String? barImage; +@override final String? date; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final String? createdBy; +@override final String? modifiedBy; + +/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardFreeBarCopyWith<_StewardFreeBar> get copyWith => __$StewardFreeBarCopyWithImpl<_StewardFreeBar>(this, _$identity); + +@override +Map toJson() { + return _$StewardFreeBarToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeBar&&(identical(other.id, id) || other.id == id)&&(identical(other.steward, steward) || other.steward == steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&(identical(other.product, product) || other.product == product)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.killHouseVetName, killHouseVetName) || other.killHouseVetName == killHouseVetName)&&(identical(other.killHouseVetMobile, killHouseVetMobile) || other.killHouseVetMobile == killHouseVetMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&const DeepCollectionEquality().equals(other.car, car)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,steward,const DeepCollectionEquality().hash(guild),product,key,createDate,modifyDate,trash,killHouseName,killHouseMobile,killHouseVetName,killHouseVetMobile,province,city,driverName,driverMobile,const DeepCollectionEquality().hash(car),pelak,numberOfCarcasses,weightOfCarcasses,barImage,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy]); + +@override +String toString() { + return 'StewardFreeBar(id: $id, steward: $steward, guild: $guild, product: $product, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, killHouseVetName: $killHouseVetName, killHouseVetMobile: $killHouseVetMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, car: $car, pelak: $pelak, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, barImage: $barImage, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardFreeBarCopyWith<$Res> implements $StewardFreeBarCopyWith<$Res> { + factory _$StewardFreeBarCopyWith(_StewardFreeBar value, $Res Function(_StewardFreeBar) _then) = __$StewardFreeBarCopyWithImpl; +@override @useResult +$Res call({ + int? id, Steward? steward, dynamic guild, Product? product, String? key, String? createDate, String? modifyDate, bool? trash, String? killHouseName, String? killHouseMobile, String? killHouseVetName, String? killHouseVetMobile, String? province, String? city, String? driverName, String? driverMobile, dynamic car, String? pelak, int? numberOfCarcasses, double? weightOfCarcasses, String? barImage, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy +}); + + +@override $StewardCopyWith<$Res>? get steward;@override $ProductCopyWith<$Res>? get product; + +} +/// @nodoc +class __$StewardFreeBarCopyWithImpl<$Res> + implements _$StewardFreeBarCopyWith<$Res> { + __$StewardFreeBarCopyWithImpl(this._self, this._then); + + final _StewardFreeBar _self; + final $Res Function(_StewardFreeBar) _then; + +/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? killHouseVetName = freezed,Object? killHouseVetMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? pelak = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? barImage = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) { + return _then(_StewardFreeBar( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as Steward?,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as Product?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,killHouseName: freezed == killHouseName ? _self.killHouseName : killHouseName // ignore: cast_nullable_to_non_nullable +as String?,killHouseMobile: freezed == killHouseMobile ? _self.killHouseMobile : killHouseMobile // ignore: cast_nullable_to_non_nullable +as String?,killHouseVetName: freezed == killHouseVetName ? _self.killHouseVetName : killHouseVetName // ignore: cast_nullable_to_non_nullable +as String?,killHouseVetMobile: freezed == killHouseVetMobile ? _self.killHouseVetMobile : killHouseVetMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,pelak: freezed == pelak ? _self.pelak : pelak // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $StewardCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +}/// Create a copy of StewardFreeBar +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +} +} + + +/// @nodoc +mixin _$Steward { + + User? get user; String? get guildsName; bool? get steward; int? get allocationLimit; Address? get address; String? get licenseNumber; String? get typeActivity; String? get areaActivity; String? get guildsId; String? get createDate; +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardCopyWith get copyWith => _$StewardCopyWithImpl(this as Steward, _$identity); + + /// Serializes this Steward to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Steward&&(identical(other.user, user) || other.user == user)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.allocationLimit, allocationLimit) || other.allocationLimit == allocationLimit)&&(identical(other.address, address) || other.address == address)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.createDate, createDate) || other.createDate == createDate)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user,guildsName,steward,allocationLimit,address,licenseNumber,typeActivity,areaActivity,guildsId,createDate); + +@override +String toString() { + return 'Steward(user: $user, guildsName: $guildsName, steward: $steward, allocationLimit: $allocationLimit, address: $address, licenseNumber: $licenseNumber, typeActivity: $typeActivity, areaActivity: $areaActivity, guildsId: $guildsId, createDate: $createDate)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardCopyWith<$Res> { + factory $StewardCopyWith(Steward value, $Res Function(Steward) _then) = _$StewardCopyWithImpl; +@useResult +$Res call({ + User? user, String? guildsName, bool? steward, int? allocationLimit, Address? address, String? licenseNumber, String? typeActivity, String? areaActivity, String? guildsId, String? createDate +}); + + +$UserCopyWith<$Res>? get user;$AddressCopyWith<$Res>? get address; + +} +/// @nodoc +class _$StewardCopyWithImpl<$Res> + implements $StewardCopyWith<$Res> { + _$StewardCopyWithImpl(this._self, this._then); + + final Steward _self; + final $Res Function(Steward) _then; + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? user = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? allocationLimit = freezed,Object? address = freezed,Object? licenseNumber = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? guildsId = freezed,Object? createDate = freezed,}) { + return _then(_self.copyWith( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as int?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Steward]. +extension StewardPatterns on Steward { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Steward value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Steward value) $default,){ +final _that = this; +switch (_that) { +case _Steward(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Steward value)? $default,){ +final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( User? user, String? guildsName, bool? steward, int? allocationLimit, Address? address, String? licenseNumber, String? typeActivity, String? areaActivity, String? guildsId, String? createDate)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that.user,_that.guildsName,_that.steward,_that.allocationLimit,_that.address,_that.licenseNumber,_that.typeActivity,_that.areaActivity,_that.guildsId,_that.createDate);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( User? user, String? guildsName, bool? steward, int? allocationLimit, Address? address, String? licenseNumber, String? typeActivity, String? areaActivity, String? guildsId, String? createDate) $default,) {final _that = this; +switch (_that) { +case _Steward(): +return $default(_that.user,_that.guildsName,_that.steward,_that.allocationLimit,_that.address,_that.licenseNumber,_that.typeActivity,_that.areaActivity,_that.guildsId,_that.createDate);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( User? user, String? guildsName, bool? steward, int? allocationLimit, Address? address, String? licenseNumber, String? typeActivity, String? areaActivity, String? guildsId, String? createDate)? $default,) {final _that = this; +switch (_that) { +case _Steward() when $default != null: +return $default(_that.user,_that.guildsName,_that.steward,_that.allocationLimit,_that.address,_that.licenseNumber,_that.typeActivity,_that.areaActivity,_that.guildsId,_that.createDate);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Steward implements Steward { + const _Steward({this.user, this.guildsName, this.steward, this.allocationLimit, this.address, this.licenseNumber, this.typeActivity, this.areaActivity, this.guildsId, this.createDate}); + factory _Steward.fromJson(Map json) => _$StewardFromJson(json); + +@override final User? user; +@override final String? guildsName; +@override final bool? steward; +@override final int? allocationLimit; +@override final Address? address; +@override final String? licenseNumber; +@override final String? typeActivity; +@override final String? areaActivity; +@override final String? guildsId; +@override final String? createDate; + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardCopyWith<_Steward> get copyWith => __$StewardCopyWithImpl<_Steward>(this, _$identity); + +@override +Map toJson() { + return _$StewardToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Steward&&(identical(other.user, user) || other.user == user)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.allocationLimit, allocationLimit) || other.allocationLimit == allocationLimit)&&(identical(other.address, address) || other.address == address)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.createDate, createDate) || other.createDate == createDate)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user,guildsName,steward,allocationLimit,address,licenseNumber,typeActivity,areaActivity,guildsId,createDate); + +@override +String toString() { + return 'Steward(user: $user, guildsName: $guildsName, steward: $steward, allocationLimit: $allocationLimit, address: $address, licenseNumber: $licenseNumber, typeActivity: $typeActivity, areaActivity: $areaActivity, guildsId: $guildsId, createDate: $createDate)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardCopyWith<$Res> implements $StewardCopyWith<$Res> { + factory _$StewardCopyWith(_Steward value, $Res Function(_Steward) _then) = __$StewardCopyWithImpl; +@override @useResult +$Res call({ + User? user, String? guildsName, bool? steward, int? allocationLimit, Address? address, String? licenseNumber, String? typeActivity, String? areaActivity, String? guildsId, String? createDate +}); + + +@override $UserCopyWith<$Res>? get user;@override $AddressCopyWith<$Res>? get address; + +} +/// @nodoc +class __$StewardCopyWithImpl<$Res> + implements _$StewardCopyWith<$Res> { + __$StewardCopyWithImpl(this._self, this._then); + + final _Steward _self; + final $Res Function(_Steward) _then; + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? user = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? allocationLimit = freezed,Object? address = freezed,Object? licenseNumber = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? guildsId = freezed,Object? createDate = freezed,}) { + return _then(_Steward( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as int?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of Steward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get firstName; String? get lastName; int? get baseOrder; String? get mobile; String? get nationalId; String? get nationalCode; String? get key; City? get city; String? get unitName; String? get unitNationalId; String? get unitRegistrationNumber; String? get unitEconomicalNumber; String? get unitProvince; String? get unitCity; String? get unitPostalCode; String? get unitAddress; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.key, key) || other.key == key)&&(identical(other.city, city) || other.city == city)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,baseOrder,mobile,nationalId,nationalCode,key,city,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, baseOrder: $baseOrder, mobile: $mobile, nationalId: $nationalId, nationalCode: $nationalCode, key: $key, city: $city, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress +}); + + +$CityCopyWith<$Res>? get city; + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? baseOrder = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,Object? key = freezed,Object? city = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable +as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable +as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable +as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable +as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable +as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable +as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.baseOrder,_that.mobile,_that.nationalId,_that.nationalCode,_that.key,_that.city,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.baseOrder,_that.mobile,_that.nationalId,_that.nationalCode,_that.key,_that.city,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.baseOrder,_that.mobile,_that.nationalId,_that.nationalCode,_that.key,_that.city,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({this.fullname, this.firstName, this.lastName, this.baseOrder, this.mobile, this.nationalId, this.nationalCode, this.key, this.city, this.unitName, this.unitNationalId, this.unitRegistrationNumber, this.unitEconomicalNumber, this.unitProvince, this.unitCity, this.unitPostalCode, this.unitAddress}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final int? baseOrder; +@override final String? mobile; +@override final String? nationalId; +@override final String? nationalCode; +@override final String? key; +@override final City? city; +@override final String? unitName; +@override final String? unitNationalId; +@override final String? unitRegistrationNumber; +@override final String? unitEconomicalNumber; +@override final String? unitProvince; +@override final String? unitCity; +@override final String? unitPostalCode; +@override final String? unitAddress; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.key, key) || other.key == key)&&(identical(other.city, city) || other.city == city)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,baseOrder,mobile,nationalId,nationalCode,key,city,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress); + +@override +String toString() { + return 'User(fullname: $fullname, firstName: $firstName, lastName: $lastName, baseOrder: $baseOrder, mobile: $mobile, nationalId: $nationalId, nationalCode: $nationalCode, key: $key, city: $city, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, int? baseOrder, String? mobile, String? nationalId, String? nationalCode, String? key, City? city, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress +}); + + +@override $CityCopyWith<$Res>? get city; + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? baseOrder = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,Object? key = freezed,Object? city = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable +as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable +as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable +as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable +as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable +as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable +as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$City { + + int? get id; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get provinceIdForeignKey; int? get cityIdKey; String? get name; double? get productPrice; bool? get provinceCenter; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; String? get createdBy; String? get modifiedBy; int? get province; +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityCopyWith get copyWith => _$CityCopyWithImpl(this as City, _$identity); + + /// Serializes this City to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is City&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.provinceIdForeignKey, provinceIdForeignKey) || other.provinceIdForeignKey == provinceIdForeignKey)&&(identical(other.cityIdKey, cityIdKey) || other.cityIdKey == cityIdKey)&&(identical(other.name, name) || other.name == name)&&(identical(other.productPrice, productPrice) || other.productPrice == productPrice)&&(identical(other.provinceCenter, provinceCenter) || other.provinceCenter == provinceCenter)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&(identical(other.province, province) || other.province == province)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,key,createDate,modifyDate,trash,provinceIdForeignKey,cityIdKey,name,productPrice,provinceCenter,cityNumber,cityName,provinceNumber,provinceName,createdBy,modifiedBy,province); + +@override +String toString() { + return 'City(id: $id, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, provinceIdForeignKey: $provinceIdForeignKey, cityIdKey: $cityIdKey, name: $name, productPrice: $productPrice, provinceCenter: $provinceCenter, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, createdBy: $createdBy, modifiedBy: $modifiedBy, province: $province)'; +} + + +} + +/// @nodoc +abstract mixin class $CityCopyWith<$Res> { + factory $CityCopyWith(City value, $Res Function(City) _then) = _$CityCopyWithImpl; +@useResult +$Res call({ + int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? createdBy, String? modifiedBy, int? province +}); + + + + +} +/// @nodoc +class _$CityCopyWithImpl<$Res> + implements $CityCopyWith<$Res> { + _$CityCopyWithImpl(this._self, this._then); + + final City _self; + final $Res Function(City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdKey = freezed,Object? name = freezed,Object? productPrice = freezed,Object? provinceCenter = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? province = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable +as int?,cityIdKey: freezed == cityIdKey ? _self.cityIdKey : cityIdKey // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,productPrice: freezed == productPrice ? _self.productPrice : productPrice // ignore: cast_nullable_to_non_nullable +as double?,provinceCenter: freezed == provinceCenter ? _self.provinceCenter : provinceCenter // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [City]. +extension CityPatterns on City { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _City value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _City value) $default,){ +final _that = this; +switch (_that) { +case _City(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _City value)? $default,){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? createdBy, String? modifiedBy, int? province)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.provinceIdForeignKey,_that.cityIdKey,_that.name,_that.productPrice,_that.provinceCenter,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.createdBy,_that.modifiedBy,_that.province);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? createdBy, String? modifiedBy, int? province) $default,) {final _that = this; +switch (_that) { +case _City(): +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.provinceIdForeignKey,_that.cityIdKey,_that.name,_that.productPrice,_that.provinceCenter,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.createdBy,_that.modifiedBy,_that.province);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? createdBy, String? modifiedBy, int? province)? $default,) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.id,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.provinceIdForeignKey,_that.cityIdKey,_that.name,_that.productPrice,_that.provinceCenter,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.createdBy,_that.modifiedBy,_that.province);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _City implements City { + const _City({this.id, this.key, this.createDate, this.modifyDate, this.trash, this.provinceIdForeignKey, this.cityIdKey, this.name, this.productPrice, this.provinceCenter, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.createdBy, this.modifiedBy, this.province}); + factory _City.fromJson(Map json) => _$CityFromJson(json); + +@override final int? id; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final int? provinceIdForeignKey; +@override final int? cityIdKey; +@override final String? name; +@override final double? productPrice; +@override final bool? provinceCenter; +@override final int? cityNumber; +@override final String? cityName; +@override final int? provinceNumber; +@override final String? provinceName; +@override final String? createdBy; +@override final String? modifiedBy; +@override final int? province; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CityCopyWith<_City> get copyWith => __$CityCopyWithImpl<_City>(this, _$identity); + +@override +Map toJson() { + return _$CityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _City&&(identical(other.id, id) || other.id == id)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.provinceIdForeignKey, provinceIdForeignKey) || other.provinceIdForeignKey == provinceIdForeignKey)&&(identical(other.cityIdKey, cityIdKey) || other.cityIdKey == cityIdKey)&&(identical(other.name, name) || other.name == name)&&(identical(other.productPrice, productPrice) || other.productPrice == productPrice)&&(identical(other.provinceCenter, provinceCenter) || other.provinceCenter == provinceCenter)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&(identical(other.province, province) || other.province == province)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,key,createDate,modifyDate,trash,provinceIdForeignKey,cityIdKey,name,productPrice,provinceCenter,cityNumber,cityName,provinceNumber,provinceName,createdBy,modifiedBy,province); + +@override +String toString() { + return 'City(id: $id, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, provinceIdForeignKey: $provinceIdForeignKey, cityIdKey: $cityIdKey, name: $name, productPrice: $productPrice, provinceCenter: $provinceCenter, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, createdBy: $createdBy, modifiedBy: $modifiedBy, province: $province)'; +} + + +} + +/// @nodoc +abstract mixin class _$CityCopyWith<$Res> implements $CityCopyWith<$Res> { + factory _$CityCopyWith(_City value, $Res Function(_City) _then) = __$CityCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? key, String? createDate, String? modifyDate, bool? trash, int? provinceIdForeignKey, int? cityIdKey, String? name, double? productPrice, bool? provinceCenter, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? createdBy, String? modifiedBy, int? province +}); + + + + +} +/// @nodoc +class __$CityCopyWithImpl<$Res> + implements _$CityCopyWith<$Res> { + __$CityCopyWithImpl(this._self, this._then); + + final _City _self; + final $Res Function(_City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdKey = freezed,Object? name = freezed,Object? productPrice = freezed,Object? provinceCenter = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? province = freezed,}) { + return _then(_City( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable +as int?,cityIdKey: freezed == cityIdKey ? _self.cityIdKey : cityIdKey // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,productPrice: freezed == productPrice ? _self.productPrice : productPrice // ignore: cast_nullable_to_non_nullable +as double?,provinceCenter: freezed == provinceCenter ? _self.provinceCenter : provinceCenter // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$Address { + + Province? get province; City? get city; String? get address; String? get postalCode; +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressCopyWith
get copyWith => _$AddressCopyWithImpl
(this as Address, _$identity); + + /// Serializes this Address to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $AddressCopyWith<$Res> { + factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl; +@useResult +$Res call({ + Province? province, City? city, String? address, String? postalCode +}); + + +$ProvinceCopyWith<$Res>? get province;$CityCopyWith<$Res>? get city; + +} +/// @nodoc +class _$AddressCopyWithImpl<$Res> + implements $AddressCopyWith<$Res> { + _$AddressCopyWithImpl(this._self, this._then); + + final Address _self; + final $Res Function(Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Address]. +extension AddressPatterns on Address { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Address value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Address value) $default,){ +final _that = this; +switch (_that) { +case _Address(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Address value)? $default,){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Province? province, City? city, String? address, String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Province? province, City? city, String? address, String? postalCode) $default,) {final _that = this; +switch (_that) { +case _Address(): +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Province? province, City? city, String? address, String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Address implements Address { + const _Address({this.province, this.city, this.address, this.postalCode}); + factory _Address.fromJson(Map json) => _$AddressFromJson(json); + +@override final Province? province; +@override final City? city; +@override final String? address; +@override final String? postalCode; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity); + +@override +Map toJson() { + return _$AddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'Address(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> { + factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl; +@override @useResult +$Res call({ + Province? province, City? city, String? address, String? postalCode +}); + + +@override $ProvinceCopyWith<$Res>? get province;@override $CityCopyWith<$Res>? get city; + +} +/// @nodoc +class __$AddressCopyWithImpl<$Res> + implements _$AddressCopyWith<$Res> { + __$AddressCopyWithImpl(this._self, this._then); + + final _Address _self; + final $Res Function(_Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_Address( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as Province?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$Province { + + String? get key; String? get name; +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProvinceCopyWith get copyWith => _$ProvinceCopyWithImpl(this as Province, _$identity); + + /// Serializes this Province to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProvinceCopyWith<$Res> { + factory $ProvinceCopyWith(Province value, $Res Function(Province) _then) = _$ProvinceCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$ProvinceCopyWithImpl<$Res> + implements $ProvinceCopyWith<$Res> { + _$ProvinceCopyWithImpl(this._self, this._then); + + final Province _self; + final $Res Function(Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Province]. +extension ProvincePatterns on Province { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Province value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Province value) $default,){ +final _that = this; +switch (_that) { +case _Province(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Province value)? $default,){ +final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _Province(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _Province() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Province implements Province { + const _Province({this.key, this.name}); + factory _Province.fromJson(Map json) => _$ProvinceFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProvinceCopyWith<_Province> get copyWith => __$ProvinceCopyWithImpl<_Province>(this, _$identity); + +@override +Map toJson() { + return _$ProvinceToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Province&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Province(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProvinceCopyWith<$Res> implements $ProvinceCopyWith<$Res> { + factory _$ProvinceCopyWith(_Province value, $Res Function(_Province) _then) = __$ProvinceCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$ProvinceCopyWithImpl<$Res> + implements _$ProvinceCopyWith<$Res> { + __$ProvinceCopyWithImpl(this._self, this._then); + + final _Province _self; + final $Res Function(_Province) _then; + +/// Create a copy of Province +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_Province( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Product { + + String? get key; String? get name; +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProductCopyWith get copyWith => _$ProductCopyWithImpl(this as Product, _$identity); + + /// Serializes this Product to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Product&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Product(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProductCopyWith<$Res> { + factory $ProductCopyWith(Product value, $Res Function(Product) _then) = _$ProductCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$ProductCopyWithImpl<$Res> + implements $ProductCopyWith<$Res> { + _$ProductCopyWithImpl(this._self, this._then); + + final Product _self; + final $Res Function(Product) _then; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Product]. +extension ProductPatterns on Product { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Product value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Product value) $default,){ +final _that = this; +switch (_that) { +case _Product(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Product value)? $default,){ +final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _Product(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _Product() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Product implements Product { + const _Product({this.key, this.name}); + factory _Product.fromJson(Map json) => _$ProductFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProductCopyWith<_Product> get copyWith => __$ProductCopyWithImpl<_Product>(this, _$identity); + +@override +Map toJson() { + return _$ProductToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Product&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'Product(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProductCopyWith<$Res> implements $ProductCopyWith<$Res> { + factory _$ProductCopyWith(_Product value, $Res Function(_Product) _then) = __$ProductCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$ProductCopyWithImpl<$Res> + implements _$ProductCopyWith<$Res> { + __$ProductCopyWithImpl(this._self, this._then); + + final _Product _self; + final $Res Function(_Product) _then; + +/// Create a copy of Product +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_Product( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart new file mode 100644 index 0000000..8a9d5bd --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_bar/steward_free_bar.g.dart @@ -0,0 +1,217 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'steward_free_bar.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_StewardFreeBar _$StewardFreeBarFromJson(Map json) => + _StewardFreeBar( + id: (json['id'] as num?)?.toInt(), + steward: json['steward'] == null + ? null + : Steward.fromJson(json['steward'] as Map), + guild: json['guild'], + product: json['product'] == null + ? null + : Product.fromJson(json['product'] as Map), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + killHouseName: json['kill_house_name'] as String?, + killHouseMobile: json['kill_house_mobile'] as String?, + killHouseVetName: json['kill_house_vet_name'] as String?, + killHouseVetMobile: json['kill_house_vet_mobile'] as String?, + province: json['province'] as String?, + city: json['city'] as String?, + driverName: json['driver_name'] as String?, + driverMobile: json['driver_mobile'] as String?, + car: json['car'], + pelak: json['pelak'] as String?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(), + barImage: json['bar_image'] as String?, + date: json['date'] as String?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + createdBy: json['created_by'] as String?, + modifiedBy: json['modified_by'] as String?, + ); + +Map _$StewardFreeBarToJson(_StewardFreeBar instance) => + { + 'id': instance.id, + 'steward': instance.steward, + 'guild': instance.guild, + 'product': instance.product, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'kill_house_name': instance.killHouseName, + 'kill_house_mobile': instance.killHouseMobile, + 'kill_house_vet_name': instance.killHouseVetName, + 'kill_house_vet_mobile': instance.killHouseVetMobile, + 'province': instance.province, + 'city': instance.city, + 'driver_name': instance.driverName, + 'driver_mobile': instance.driverMobile, + 'car': instance.car, + 'pelak': instance.pelak, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'bar_image': instance.barImage, + 'date': instance.date, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + }; + +_Steward _$StewardFromJson(Map json) => _Steward( + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), + guildsName: json['guilds_name'] as String?, + steward: json['steward'] as bool?, + allocationLimit: (json['allocation_limit'] as num?)?.toInt(), + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + licenseNumber: json['license_number'] as String?, + typeActivity: json['type_activity'] as String?, + areaActivity: json['area_activity'] as String?, + guildsId: json['guilds_id'] as String?, + createDate: json['create_date'] as String?, +); + +Map _$StewardToJson(_Steward instance) => { + 'user': instance.user, + 'guilds_name': instance.guildsName, + 'steward': instance.steward, + 'allocation_limit': instance.allocationLimit, + 'address': instance.address, + 'license_number': instance.licenseNumber, + 'type_activity': instance.typeActivity, + 'area_activity': instance.areaActivity, + 'guilds_id': instance.guildsId, + 'create_date': instance.createDate, +}; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + baseOrder: (json['base_order'] as num?)?.toInt(), + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + nationalCode: json['national_code'] as String?, + key: json['key'] as String?, + city: json['city'] == null + ? null + : City.fromJson(json['city'] as Map), + unitName: json['unit_name'] as String?, + unitNationalId: json['unit_national_id'] as String?, + unitRegistrationNumber: json['unit_registration_number'] as String?, + unitEconomicalNumber: json['unit_economical_number'] as String?, + unitProvince: json['unit_province'] as String?, + unitCity: json['unit_city'] as String?, + unitPostalCode: json['unit_postal_code'] as String?, + unitAddress: json['unit_address'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'base_order': instance.baseOrder, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'national_code': instance.nationalCode, + 'key': instance.key, + 'city': instance.city, + 'unit_name': instance.unitName, + 'unit_national_id': instance.unitNationalId, + 'unit_registration_number': instance.unitRegistrationNumber, + 'unit_economical_number': instance.unitEconomicalNumber, + 'unit_province': instance.unitProvince, + 'unit_city': instance.unitCity, + 'unit_postal_code': instance.unitPostalCode, + 'unit_address': instance.unitAddress, +}; + +_City _$CityFromJson(Map json) => _City( + id: (json['id'] as num?)?.toInt(), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(), + cityIdKey: (json['city_id_key'] as num?)?.toInt(), + name: json['name'] as String?, + productPrice: (json['product_price'] as num?)?.toDouble(), + provinceCenter: json['province_center'] as bool?, + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + createdBy: json['created_by'] as String?, + modifiedBy: json['modified_by'] as String?, + province: (json['province'] as num?)?.toInt(), +); + +Map _$CityToJson(_City instance) => { + 'id': instance.id, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'province_id_foreign_key': instance.provinceIdForeignKey, + 'city_id_key': instance.cityIdKey, + 'name': instance.name, + 'product_price': instance.productPrice, + 'province_center': instance.provinceCenter, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'province': instance.province, +}; + +_Address _$AddressFromJson(Map json) => _Address( + province: json['province'] == null + ? null + : Province.fromJson(json['province'] as Map), + city: json['city'] == null + ? null + : City.fromJson(json['city'] as Map), + address: json['address'] as String?, + postalCode: json['postal_code'] as String?, +); + +Map _$AddressToJson(_Address instance) => { + 'province': instance.province, + 'city': instance.city, + 'address': instance.address, + 'postal_code': instance.postalCode, +}; + +_Province _$ProvinceFromJson(Map json) => + _Province(key: json['key'] as String?, name: json['name'] as String?); + +Map _$ProvinceToJson(_Province instance) => { + 'key': instance.key, + 'name': instance.name, +}; + +_Product _$ProductFromJson(Map json) => + _Product(key: json['key'] as String?, name: json['name'] as String?); + +Map _$ProductToJson(_Product instance) => { + 'key': instance.key, + 'name': instance.name, +}; diff --git a/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart b/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart new file mode 100644 index 0000000..11bcb46 --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart @@ -0,0 +1,17 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'steward_free_bar_dashboard.freezed.dart'; +part 'steward_free_bar_dashboard.g.dart'; + +@freezed +abstract class StewardFreeBarDashboard with _$StewardFreeBarDashboard { + const factory StewardFreeBarDashboard({ + String? product, + int? totalBars, + double? totalQuantity, + double? totalWeight, + }) = _StewardFreeBarDashboard; + + factory StewardFreeBarDashboard.fromJson(Map json) => + _$StewardFreeBarDashboardFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.freezed.dart b/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.freezed.dart new file mode 100644 index 0000000..325171f --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.freezed.dart @@ -0,0 +1,286 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'steward_free_bar_dashboard.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$StewardFreeBarDashboard { + + String? get product; int? get totalBars; double? get totalQuantity; double? get totalWeight; +/// Create a copy of StewardFreeBarDashboard +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardFreeBarDashboardCopyWith get copyWith => _$StewardFreeBarDashboardCopyWithImpl(this as StewardFreeBarDashboard, _$identity); + + /// Serializes this StewardFreeBarDashboard to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeBarDashboard&&(identical(other.product, product) || other.product == product)&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&(identical(other.totalWeight, totalWeight) || other.totalWeight == totalWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,product,totalBars,totalQuantity,totalWeight); + +@override +String toString() { + return 'StewardFreeBarDashboard(product: $product, totalBars: $totalBars, totalQuantity: $totalQuantity, totalWeight: $totalWeight)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardFreeBarDashboardCopyWith<$Res> { + factory $StewardFreeBarDashboardCopyWith(StewardFreeBarDashboard value, $Res Function(StewardFreeBarDashboard) _then) = _$StewardFreeBarDashboardCopyWithImpl; +@useResult +$Res call({ + String? product, int? totalBars, double? totalQuantity, double? totalWeight +}); + + + + +} +/// @nodoc +class _$StewardFreeBarDashboardCopyWithImpl<$Res> + implements $StewardFreeBarDashboardCopyWith<$Res> { + _$StewardFreeBarDashboardCopyWithImpl(this._self, this._then); + + final StewardFreeBarDashboard _self; + final $Res Function(StewardFreeBarDashboard) _then; + +/// Create a copy of StewardFreeBarDashboard +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? product = freezed,Object? totalBars = freezed,Object? totalQuantity = freezed,Object? totalWeight = freezed,}) { + return _then(_self.copyWith( +product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as String?,totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable +as int?,totalQuantity: freezed == totalQuantity ? _self.totalQuantity : totalQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalWeight: freezed == totalWeight ? _self.totalWeight : totalWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [StewardFreeBarDashboard]. +extension StewardFreeBarDashboardPatterns on StewardFreeBarDashboard { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardFreeBarDashboard value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardFreeBarDashboard() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardFreeBarDashboard value) $default,){ +final _that = this; +switch (_that) { +case _StewardFreeBarDashboard(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardFreeBarDashboard value)? $default,){ +final _that = this; +switch (_that) { +case _StewardFreeBarDashboard() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? product, int? totalBars, double? totalQuantity, double? totalWeight)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardFreeBarDashboard() when $default != null: +return $default(_that.product,_that.totalBars,_that.totalQuantity,_that.totalWeight);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? product, int? totalBars, double? totalQuantity, double? totalWeight) $default,) {final _that = this; +switch (_that) { +case _StewardFreeBarDashboard(): +return $default(_that.product,_that.totalBars,_that.totalQuantity,_that.totalWeight);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? product, int? totalBars, double? totalQuantity, double? totalWeight)? $default,) {final _that = this; +switch (_that) { +case _StewardFreeBarDashboard() when $default != null: +return $default(_that.product,_that.totalBars,_that.totalQuantity,_that.totalWeight);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardFreeBarDashboard implements StewardFreeBarDashboard { + const _StewardFreeBarDashboard({this.product, this.totalBars, this.totalQuantity, this.totalWeight}); + factory _StewardFreeBarDashboard.fromJson(Map json) => _$StewardFreeBarDashboardFromJson(json); + +@override final String? product; +@override final int? totalBars; +@override final double? totalQuantity; +@override final double? totalWeight; + +/// Create a copy of StewardFreeBarDashboard +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardFreeBarDashboardCopyWith<_StewardFreeBarDashboard> get copyWith => __$StewardFreeBarDashboardCopyWithImpl<_StewardFreeBarDashboard>(this, _$identity); + +@override +Map toJson() { + return _$StewardFreeBarDashboardToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeBarDashboard&&(identical(other.product, product) || other.product == product)&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&(identical(other.totalWeight, totalWeight) || other.totalWeight == totalWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,product,totalBars,totalQuantity,totalWeight); + +@override +String toString() { + return 'StewardFreeBarDashboard(product: $product, totalBars: $totalBars, totalQuantity: $totalQuantity, totalWeight: $totalWeight)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardFreeBarDashboardCopyWith<$Res> implements $StewardFreeBarDashboardCopyWith<$Res> { + factory _$StewardFreeBarDashboardCopyWith(_StewardFreeBarDashboard value, $Res Function(_StewardFreeBarDashboard) _then) = __$StewardFreeBarDashboardCopyWithImpl; +@override @useResult +$Res call({ + String? product, int? totalBars, double? totalQuantity, double? totalWeight +}); + + + + +} +/// @nodoc +class __$StewardFreeBarDashboardCopyWithImpl<$Res> + implements _$StewardFreeBarDashboardCopyWith<$Res> { + __$StewardFreeBarDashboardCopyWithImpl(this._self, this._then); + + final _StewardFreeBarDashboard _self; + final $Res Function(_StewardFreeBarDashboard) _then; + +/// Create a copy of StewardFreeBarDashboard +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? product = freezed,Object? totalBars = freezed,Object? totalQuantity = freezed,Object? totalWeight = freezed,}) { + return _then(_StewardFreeBarDashboard( +product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as String?,totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable +as int?,totalQuantity: freezed == totalQuantity ? _self.totalQuantity : totalQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalWeight: freezed == totalWeight ? _self.totalWeight : totalWeight // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.g.dart b/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.g.dart new file mode 100644 index 0000000..075281b --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'steward_free_bar_dashboard.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_StewardFreeBarDashboard _$StewardFreeBarDashboardFromJson( + Map json, +) => _StewardFreeBarDashboard( + product: json['product'] as String?, + totalBars: (json['total_bars'] as num?)?.toInt(), + totalQuantity: (json['total_quantity'] as num?)?.toDouble(), + totalWeight: (json['total_weight'] as num?)?.toDouble(), +); + +Map _$StewardFreeBarDashboardToJson( + _StewardFreeBarDashboard instance, +) => { + 'product': instance.product, + 'total_bars': instance.totalBars, + 'total_quantity': instance.totalQuantity, + 'total_weight': instance.totalWeight, +}; diff --git a/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart b/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart new file mode 100644 index 0000000..537a54e --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart @@ -0,0 +1,87 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'steward_free_sale_bar.freezed.dart'; +part 'steward_free_sale_bar.g.dart'; + +@freezed +abstract class StewardFreeSaleBar with _$StewardFreeSaleBar { + const factory StewardFreeSaleBar({ + int? id, + Buyer? buyer, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + String? buyerName, + String? buyerMobile, + String? province, + String? city, + String? driverName, + String? driverMobile, + String? typeCar, + String? pelak, + String? clearanceCode, + int? numberOfCarcasses, + double? weightOfCarcasses, + String? date, + bool? temporaryTrash, + bool? temporaryDeleted, + String? createdBy, + String? modifiedBy, + dynamic steward, + dynamic guild, + dynamic product, + }) = _StewardFreeSaleBar; + + factory StewardFreeSaleBar.fromJson(Map json) => + _$StewardFreeSaleBarFromJson(json); +} + +@freezed +abstract class Buyer with _$Buyer { + const factory Buyer({ + String? key, + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? unitName, + String? city, + String? province, + bool? active, + BuyerSteward? steward, + }) = _Buyer; + + factory Buyer.fromJson(Map json) => _$BuyerFromJson(json); +} + +@freezed +abstract class BuyerSteward with _$BuyerSteward { + const factory BuyerSteward({ + String? key, + String? guildsName, + BuyerStewardUser? user, + String? typeActivity, + String? areaActivity, + }) = _BuyerSteward; + + factory BuyerSteward.fromJson(Map json) => + _$BuyerStewardFromJson(json); +} + +@freezed +abstract class BuyerStewardUser with _$BuyerStewardUser { + const factory BuyerStewardUser({ + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? nationalId, + String? provinceName, + String? cityName, + String? password, + }) = _BuyerStewardUser; + + factory BuyerStewardUser.fromJson(Map json) => + _$BuyerStewardUserFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.freezed.dart b/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.freezed.dart new file mode 100644 index 0000000..de5120a --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.freezed.dart @@ -0,0 +1,1270 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'steward_free_sale_bar.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$StewardFreeSaleBar { + + int? get id; Buyer? get buyer; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get buyerName; String? get buyerMobile; String? get province; String? get city; String? get driverName; String? get driverMobile; String? get typeCar; String? get pelak; String? get clearanceCode; int? get numberOfCarcasses; double? get weightOfCarcasses; String? get date; bool? get temporaryTrash; bool? get temporaryDeleted; String? get createdBy; String? get modifiedBy; dynamic get steward; dynamic get guild; dynamic get product; +/// Create a copy of StewardFreeSaleBar +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardFreeSaleBarCopyWith get copyWith => _$StewardFreeSaleBarCopyWithImpl(this as StewardFreeSaleBar, _$identity); + + /// Serializes this StewardFreeSaleBar to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeSaleBar&&(identical(other.id, id) || other.id == id)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.buyerName, buyerName) || other.buyerName == buyerName)&&(identical(other.buyerMobile, buyerMobile) || other.buyerMobile == buyerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.typeCar, typeCar) || other.typeCar == typeCar)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&const DeepCollectionEquality().equals(other.steward, steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&const DeepCollectionEquality().equals(other.product, product)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,buyer,key,createDate,modifyDate,trash,buyerName,buyerMobile,province,city,driverName,driverMobile,typeCar,pelak,clearanceCode,numberOfCarcasses,weightOfCarcasses,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy,const DeepCollectionEquality().hash(steward),const DeepCollectionEquality().hash(guild),const DeepCollectionEquality().hash(product)]); + +@override +String toString() { + return 'StewardFreeSaleBar(id: $id, buyer: $buyer, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, buyerName: $buyerName, buyerMobile: $buyerMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, typeCar: $typeCar, pelak: $pelak, clearanceCode: $clearanceCode, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, steward: $steward, guild: $guild, product: $product)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardFreeSaleBarCopyWith<$Res> { + factory $StewardFreeSaleBarCopyWith(StewardFreeSaleBar value, $Res Function(StewardFreeSaleBar) _then) = _$StewardFreeSaleBarCopyWithImpl; +@useResult +$Res call({ + int? id, Buyer? buyer, String? key, String? createDate, String? modifyDate, bool? trash, String? buyerName, String? buyerMobile, String? province, String? city, String? driverName, String? driverMobile, String? typeCar, String? pelak, String? clearanceCode, int? numberOfCarcasses, double? weightOfCarcasses, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic steward, dynamic guild, dynamic product +}); + + +$BuyerCopyWith<$Res>? get buyer; + +} +/// @nodoc +class _$StewardFreeSaleBarCopyWithImpl<$Res> + implements $StewardFreeSaleBarCopyWith<$Res> { + _$StewardFreeSaleBarCopyWithImpl(this._self, this._then); + + final StewardFreeSaleBar _self; + final $Res Function(StewardFreeSaleBar) _then; + +/// Create a copy of StewardFreeSaleBar +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? buyer = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? buyerName = freezed,Object? buyerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? typeCar = freezed,Object? pelak = freezed,Object? clearanceCode = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable +as Buyer?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,buyerName: freezed == buyerName ? _self.buyerName : buyerName // ignore: cast_nullable_to_non_nullable +as String?,buyerMobile: freezed == buyerMobile ? _self.buyerMobile : buyerMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,typeCar: freezed == typeCar ? _self.typeCar : typeCar // ignore: cast_nullable_to_non_nullable +as String?,pelak: freezed == pelak ? _self.pelak : pelak // ignore: cast_nullable_to_non_nullable +as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as dynamic,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} +/// Create a copy of StewardFreeSaleBar +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerCopyWith<$Res>? get buyer { + if (_self.buyer == null) { + return null; + } + + return $BuyerCopyWith<$Res>(_self.buyer!, (value) { + return _then(_self.copyWith(buyer: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [StewardFreeSaleBar]. +extension StewardFreeSaleBarPatterns on StewardFreeSaleBar { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardFreeSaleBar value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardFreeSaleBar() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardFreeSaleBar value) $default,){ +final _that = this; +switch (_that) { +case _StewardFreeSaleBar(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardFreeSaleBar value)? $default,){ +final _that = this; +switch (_that) { +case _StewardFreeSaleBar() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, Buyer? buyer, String? key, String? createDate, String? modifyDate, bool? trash, String? buyerName, String? buyerMobile, String? province, String? city, String? driverName, String? driverMobile, String? typeCar, String? pelak, String? clearanceCode, int? numberOfCarcasses, double? weightOfCarcasses, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic steward, dynamic guild, dynamic product)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardFreeSaleBar() when $default != null: +return $default(_that.id,_that.buyer,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.buyerName,_that.buyerMobile,_that.province,_that.city,_that.driverName,_that.driverMobile,_that.typeCar,_that.pelak,_that.clearanceCode,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.steward,_that.guild,_that.product);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, Buyer? buyer, String? key, String? createDate, String? modifyDate, bool? trash, String? buyerName, String? buyerMobile, String? province, String? city, String? driverName, String? driverMobile, String? typeCar, String? pelak, String? clearanceCode, int? numberOfCarcasses, double? weightOfCarcasses, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic steward, dynamic guild, dynamic product) $default,) {final _that = this; +switch (_that) { +case _StewardFreeSaleBar(): +return $default(_that.id,_that.buyer,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.buyerName,_that.buyerMobile,_that.province,_that.city,_that.driverName,_that.driverMobile,_that.typeCar,_that.pelak,_that.clearanceCode,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.steward,_that.guild,_that.product);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, Buyer? buyer, String? key, String? createDate, String? modifyDate, bool? trash, String? buyerName, String? buyerMobile, String? province, String? city, String? driverName, String? driverMobile, String? typeCar, String? pelak, String? clearanceCode, int? numberOfCarcasses, double? weightOfCarcasses, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic steward, dynamic guild, dynamic product)? $default,) {final _that = this; +switch (_that) { +case _StewardFreeSaleBar() when $default != null: +return $default(_that.id,_that.buyer,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.buyerName,_that.buyerMobile,_that.province,_that.city,_that.driverName,_that.driverMobile,_that.typeCar,_that.pelak,_that.clearanceCode,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.temporaryTrash,_that.temporaryDeleted,_that.createdBy,_that.modifiedBy,_that.steward,_that.guild,_that.product);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardFreeSaleBar implements StewardFreeSaleBar { + const _StewardFreeSaleBar({this.id, this.buyer, this.key, this.createDate, this.modifyDate, this.trash, this.buyerName, this.buyerMobile, this.province, this.city, this.driverName, this.driverMobile, this.typeCar, this.pelak, this.clearanceCode, this.numberOfCarcasses, this.weightOfCarcasses, this.date, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy, this.steward, this.guild, this.product}); + factory _StewardFreeSaleBar.fromJson(Map json) => _$StewardFreeSaleBarFromJson(json); + +@override final int? id; +@override final Buyer? buyer; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final String? buyerName; +@override final String? buyerMobile; +@override final String? province; +@override final String? city; +@override final String? driverName; +@override final String? driverMobile; +@override final String? typeCar; +@override final String? pelak; +@override final String? clearanceCode; +@override final int? numberOfCarcasses; +@override final double? weightOfCarcasses; +@override final String? date; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final String? createdBy; +@override final String? modifiedBy; +@override final dynamic steward; +@override final dynamic guild; +@override final dynamic product; + +/// Create a copy of StewardFreeSaleBar +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardFreeSaleBarCopyWith<_StewardFreeSaleBar> get copyWith => __$StewardFreeSaleBarCopyWithImpl<_StewardFreeSaleBar>(this, _$identity); + +@override +Map toJson() { + return _$StewardFreeSaleBarToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeSaleBar&&(identical(other.id, id) || other.id == id)&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.buyerName, buyerName) || other.buyerName == buyerName)&&(identical(other.buyerMobile, buyerMobile) || other.buyerMobile == buyerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.typeCar, typeCar) || other.typeCar == typeCar)&&(identical(other.pelak, pelak) || other.pelak == pelak)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&const DeepCollectionEquality().equals(other.steward, steward)&&const DeepCollectionEquality().equals(other.guild, guild)&&const DeepCollectionEquality().equals(other.product, product)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,buyer,key,createDate,modifyDate,trash,buyerName,buyerMobile,province,city,driverName,driverMobile,typeCar,pelak,clearanceCode,numberOfCarcasses,weightOfCarcasses,date,temporaryTrash,temporaryDeleted,createdBy,modifiedBy,const DeepCollectionEquality().hash(steward),const DeepCollectionEquality().hash(guild),const DeepCollectionEquality().hash(product)]); + +@override +String toString() { + return 'StewardFreeSaleBar(id: $id, buyer: $buyer, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, buyerName: $buyerName, buyerMobile: $buyerMobile, province: $province, city: $city, driverName: $driverName, driverMobile: $driverMobile, typeCar: $typeCar, pelak: $pelak, clearanceCode: $clearanceCode, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, date: $date, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, steward: $steward, guild: $guild, product: $product)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardFreeSaleBarCopyWith<$Res> implements $StewardFreeSaleBarCopyWith<$Res> { + factory _$StewardFreeSaleBarCopyWith(_StewardFreeSaleBar value, $Res Function(_StewardFreeSaleBar) _then) = __$StewardFreeSaleBarCopyWithImpl; +@override @useResult +$Res call({ + int? id, Buyer? buyer, String? key, String? createDate, String? modifyDate, bool? trash, String? buyerName, String? buyerMobile, String? province, String? city, String? driverName, String? driverMobile, String? typeCar, String? pelak, String? clearanceCode, int? numberOfCarcasses, double? weightOfCarcasses, String? date, bool? temporaryTrash, bool? temporaryDeleted, String? createdBy, String? modifiedBy, dynamic steward, dynamic guild, dynamic product +}); + + +@override $BuyerCopyWith<$Res>? get buyer; + +} +/// @nodoc +class __$StewardFreeSaleBarCopyWithImpl<$Res> + implements _$StewardFreeSaleBarCopyWith<$Res> { + __$StewardFreeSaleBarCopyWithImpl(this._self, this._then); + + final _StewardFreeSaleBar _self; + final $Res Function(_StewardFreeSaleBar) _then; + +/// Create a copy of StewardFreeSaleBar +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? buyer = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? buyerName = freezed,Object? buyerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? typeCar = freezed,Object? pelak = freezed,Object? clearanceCode = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? steward = freezed,Object? guild = freezed,Object? product = freezed,}) { + return _then(_StewardFreeSaleBar( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable +as Buyer?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,buyerName: freezed == buyerName ? _self.buyerName : buyerName // ignore: cast_nullable_to_non_nullable +as String?,buyerMobile: freezed == buyerMobile ? _self.buyerMobile : buyerMobile // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable +as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable +as String?,typeCar: freezed == typeCar ? _self.typeCar : typeCar // ignore: cast_nullable_to_non_nullable +as String?,pelak: freezed == pelak ? _self.pelak : pelak // ignore: cast_nullable_to_non_nullable +as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable +as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as dynamic,guild: freezed == guild ? _self.guild : guild // ignore: cast_nullable_to_non_nullable +as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} + +/// Create a copy of StewardFreeSaleBar +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerCopyWith<$Res>? get buyer { + if (_self.buyer == null) { + return null; + } + + return $BuyerCopyWith<$Res>(_self.buyer!, (value) { + return _then(_self.copyWith(buyer: value)); + }); +} +} + + +/// @nodoc +mixin _$Buyer { + + String? get key; String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get unitName; String? get city; String? get province; bool? get active; BuyerSteward? get steward; +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BuyerCopyWith get copyWith => _$BuyerCopyWithImpl(this as Buyer, _$identity); + + /// Serializes this Buyer to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Buyer&&(identical(other.key, key) || other.key == key)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.active, active) || other.active == active)&&(identical(other.steward, steward) || other.steward == steward)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,fullname,firstName,lastName,mobile,unitName,city,province,active,steward); + +@override +String toString() { + return 'Buyer(key: $key, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, active: $active, steward: $steward)'; +} + + +} + +/// @nodoc +abstract mixin class $BuyerCopyWith<$Res> { + factory $BuyerCopyWith(Buyer value, $Res Function(Buyer) _then) = _$BuyerCopyWithImpl; +@useResult +$Res call({ + String? key, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, BuyerSteward? steward +}); + + +$BuyerStewardCopyWith<$Res>? get steward; + +} +/// @nodoc +class _$BuyerCopyWithImpl<$Res> + implements $BuyerCopyWith<$Res> { + _$BuyerCopyWithImpl(this._self, this._then); + + final Buyer _self; + final $Res Function(Buyer) _then; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? active = freezed,Object? steward = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as BuyerSteward?, + )); +} +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerStewardCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $BuyerStewardCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Buyer]. +extension BuyerPatterns on Buyer { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Buyer value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Buyer value) $default,){ +final _that = this; +switch (_that) { +case _Buyer(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Buyer value)? $default,){ +final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, BuyerSteward? steward)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that.key,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.steward);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, BuyerSteward? steward) $default,) {final _that = this; +switch (_that) { +case _Buyer(): +return $default(_that.key,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.steward);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, BuyerSteward? steward)? $default,) {final _that = this; +switch (_that) { +case _Buyer() when $default != null: +return $default(_that.key,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.steward);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Buyer implements Buyer { + const _Buyer({this.key, this.fullname, this.firstName, this.lastName, this.mobile, this.unitName, this.city, this.province, this.active, this.steward}); + factory _Buyer.fromJson(Map json) => _$BuyerFromJson(json); + +@override final String? key; +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? unitName; +@override final String? city; +@override final String? province; +@override final bool? active; +@override final BuyerSteward? steward; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BuyerCopyWith<_Buyer> get copyWith => __$BuyerCopyWithImpl<_Buyer>(this, _$identity); + +@override +Map toJson() { + return _$BuyerToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Buyer&&(identical(other.key, key) || other.key == key)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.active, active) || other.active == active)&&(identical(other.steward, steward) || other.steward == steward)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,fullname,firstName,lastName,mobile,unitName,city,province,active,steward); + +@override +String toString() { + return 'Buyer(key: $key, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, active: $active, steward: $steward)'; +} + + +} + +/// @nodoc +abstract mixin class _$BuyerCopyWith<$Res> implements $BuyerCopyWith<$Res> { + factory _$BuyerCopyWith(_Buyer value, $Res Function(_Buyer) _then) = __$BuyerCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, BuyerSteward? steward +}); + + +@override $BuyerStewardCopyWith<$Res>? get steward; + +} +/// @nodoc +class __$BuyerCopyWithImpl<$Res> + implements _$BuyerCopyWith<$Res> { + __$BuyerCopyWithImpl(this._self, this._then); + + final _Buyer _self; + final $Res Function(_Buyer) _then; + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? active = freezed,Object? steward = freezed,}) { + return _then(_Buyer( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as BuyerSteward?, + )); +} + +/// Create a copy of Buyer +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerStewardCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $BuyerStewardCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +} +} + + +/// @nodoc +mixin _$BuyerSteward { + + String? get key; String? get guildsName; BuyerStewardUser? get user; String? get typeActivity; String? get areaActivity; +/// Create a copy of BuyerSteward +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BuyerStewardCopyWith get copyWith => _$BuyerStewardCopyWithImpl(this as BuyerSteward, _$identity); + + /// Serializes this BuyerSteward to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BuyerSteward&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.user, user) || other.user == user)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,guildsName,user,typeActivity,areaActivity); + +@override +String toString() { + return 'BuyerSteward(key: $key, guildsName: $guildsName, user: $user, typeActivity: $typeActivity, areaActivity: $areaActivity)'; +} + + +} + +/// @nodoc +abstract mixin class $BuyerStewardCopyWith<$Res> { + factory $BuyerStewardCopyWith(BuyerSteward value, $Res Function(BuyerSteward) _then) = _$BuyerStewardCopyWithImpl; +@useResult +$Res call({ + String? key, String? guildsName, BuyerStewardUser? user, String? typeActivity, String? areaActivity +}); + + +$BuyerStewardUserCopyWith<$Res>? get user; + +} +/// @nodoc +class _$BuyerStewardCopyWithImpl<$Res> + implements $BuyerStewardCopyWith<$Res> { + _$BuyerStewardCopyWithImpl(this._self, this._then); + + final BuyerSteward _self; + final $Res Function(BuyerSteward) _then; + +/// Create a copy of BuyerSteward +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? guildsName = freezed,Object? user = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as BuyerStewardUser?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of BuyerSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerStewardUserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $BuyerStewardUserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [BuyerSteward]. +extension BuyerStewardPatterns on BuyerSteward { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BuyerSteward value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BuyerSteward() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BuyerSteward value) $default,){ +final _that = this; +switch (_that) { +case _BuyerSteward(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BuyerSteward value)? $default,){ +final _that = this; +switch (_that) { +case _BuyerSteward() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? guildsName, BuyerStewardUser? user, String? typeActivity, String? areaActivity)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BuyerSteward() when $default != null: +return $default(_that.key,_that.guildsName,_that.user,_that.typeActivity,_that.areaActivity);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? guildsName, BuyerStewardUser? user, String? typeActivity, String? areaActivity) $default,) {final _that = this; +switch (_that) { +case _BuyerSteward(): +return $default(_that.key,_that.guildsName,_that.user,_that.typeActivity,_that.areaActivity);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? guildsName, BuyerStewardUser? user, String? typeActivity, String? areaActivity)? $default,) {final _that = this; +switch (_that) { +case _BuyerSteward() when $default != null: +return $default(_that.key,_that.guildsName,_that.user,_that.typeActivity,_that.areaActivity);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _BuyerSteward implements BuyerSteward { + const _BuyerSteward({this.key, this.guildsName, this.user, this.typeActivity, this.areaActivity}); + factory _BuyerSteward.fromJson(Map json) => _$BuyerStewardFromJson(json); + +@override final String? key; +@override final String? guildsName; +@override final BuyerStewardUser? user; +@override final String? typeActivity; +@override final String? areaActivity; + +/// Create a copy of BuyerSteward +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BuyerStewardCopyWith<_BuyerSteward> get copyWith => __$BuyerStewardCopyWithImpl<_BuyerSteward>(this, _$identity); + +@override +Map toJson() { + return _$BuyerStewardToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BuyerSteward&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.user, user) || other.user == user)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,guildsName,user,typeActivity,areaActivity); + +@override +String toString() { + return 'BuyerSteward(key: $key, guildsName: $guildsName, user: $user, typeActivity: $typeActivity, areaActivity: $areaActivity)'; +} + + +} + +/// @nodoc +abstract mixin class _$BuyerStewardCopyWith<$Res> implements $BuyerStewardCopyWith<$Res> { + factory _$BuyerStewardCopyWith(_BuyerSteward value, $Res Function(_BuyerSteward) _then) = __$BuyerStewardCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? guildsName, BuyerStewardUser? user, String? typeActivity, String? areaActivity +}); + + +@override $BuyerStewardUserCopyWith<$Res>? get user; + +} +/// @nodoc +class __$BuyerStewardCopyWithImpl<$Res> + implements _$BuyerStewardCopyWith<$Res> { + __$BuyerStewardCopyWithImpl(this._self, this._then); + + final _BuyerSteward _self; + final $Res Function(_BuyerSteward) _then; + +/// Create a copy of BuyerSteward +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? guildsName = freezed,Object? user = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,}) { + return _then(_BuyerSteward( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as BuyerStewardUser?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of BuyerSteward +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyerStewardUserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $BuyerStewardUserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// @nodoc +mixin _$BuyerStewardUser { + + String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get nationalId; String? get provinceName; String? get cityName; String? get password; +/// Create a copy of BuyerStewardUser +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BuyerStewardUserCopyWith get copyWith => _$BuyerStewardUserCopyWithImpl(this as BuyerStewardUser, _$identity); + + /// Serializes this BuyerStewardUser to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BuyerStewardUser&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.password, password) || other.password == password)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,provinceName,cityName,password); + +@override +String toString() { + return 'BuyerStewardUser(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, provinceName: $provinceName, cityName: $cityName, password: $password)'; +} + + +} + +/// @nodoc +abstract mixin class $BuyerStewardUserCopyWith<$Res> { + factory $BuyerStewardUserCopyWith(BuyerStewardUser value, $Res Function(BuyerStewardUser) _then) = _$BuyerStewardUserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? provinceName, String? cityName, String? password +}); + + + + +} +/// @nodoc +class _$BuyerStewardUserCopyWithImpl<$Res> + implements $BuyerStewardUserCopyWith<$Res> { + _$BuyerStewardUserCopyWithImpl(this._self, this._then); + + final BuyerStewardUser _self; + final $Res Function(BuyerStewardUser) _then; + +/// Create a copy of BuyerStewardUser +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? provinceName = freezed,Object? cityName = freezed,Object? password = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BuyerStewardUser]. +extension BuyerStewardUserPatterns on BuyerStewardUser { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BuyerStewardUser value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BuyerStewardUser() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BuyerStewardUser value) $default,){ +final _that = this; +switch (_that) { +case _BuyerStewardUser(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BuyerStewardUser value)? $default,){ +final _that = this; +switch (_that) { +case _BuyerStewardUser() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? provinceName, String? cityName, String? password)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BuyerStewardUser() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.provinceName,_that.cityName,_that.password);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? provinceName, String? cityName, String? password) $default,) {final _that = this; +switch (_that) { +case _BuyerStewardUser(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.provinceName,_that.cityName,_that.password);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? provinceName, String? cityName, String? password)? $default,) {final _that = this; +switch (_that) { +case _BuyerStewardUser() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.provinceName,_that.cityName,_that.password);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _BuyerStewardUser implements BuyerStewardUser { + const _BuyerStewardUser({this.fullname, this.firstName, this.lastName, this.mobile, this.nationalId, this.provinceName, this.cityName, this.password}); + factory _BuyerStewardUser.fromJson(Map json) => _$BuyerStewardUserFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? nationalId; +@override final String? provinceName; +@override final String? cityName; +@override final String? password; + +/// Create a copy of BuyerStewardUser +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BuyerStewardUserCopyWith<_BuyerStewardUser> get copyWith => __$BuyerStewardUserCopyWithImpl<_BuyerStewardUser>(this, _$identity); + +@override +Map toJson() { + return _$BuyerStewardUserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BuyerStewardUser&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.password, password) || other.password == password)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,provinceName,cityName,password); + +@override +String toString() { + return 'BuyerStewardUser(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, provinceName: $provinceName, cityName: $cityName, password: $password)'; +} + + +} + +/// @nodoc +abstract mixin class _$BuyerStewardUserCopyWith<$Res> implements $BuyerStewardUserCopyWith<$Res> { + factory _$BuyerStewardUserCopyWith(_BuyerStewardUser value, $Res Function(_BuyerStewardUser) _then) = __$BuyerStewardUserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? provinceName, String? cityName, String? password +}); + + + + +} +/// @nodoc +class __$BuyerStewardUserCopyWithImpl<$Res> + implements _$BuyerStewardUserCopyWith<$Res> { + __$BuyerStewardUserCopyWithImpl(this._self, this._then); + + final _BuyerStewardUser _self; + final $Res Function(_BuyerStewardUser) _then; + +/// Create a copy of BuyerStewardUser +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? provinceName = freezed,Object? cityName = freezed,Object? password = freezed,}) { + return _then(_BuyerStewardUser( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.g.dart b/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.g.dart new file mode 100644 index 0000000..e8feabc --- /dev/null +++ b/packages/chicken/lib/data/models/response/steward_free_sale_bar/steward_free_sale_bar.g.dart @@ -0,0 +1,139 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'steward_free_sale_bar.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_StewardFreeSaleBar _$StewardFreeSaleBarFromJson(Map json) => + _StewardFreeSaleBar( + id: (json['id'] as num?)?.toInt(), + buyer: json['buyer'] == null + ? null + : Buyer.fromJson(json['buyer'] as Map), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + buyerName: json['buyer_name'] as String?, + buyerMobile: json['buyer_mobile'] as String?, + province: json['province'] as String?, + city: json['city'] as String?, + driverName: json['driver_name'] as String?, + driverMobile: json['driver_mobile'] as String?, + typeCar: json['type_car'] as String?, + pelak: json['pelak'] as String?, + clearanceCode: json['clearance_code'] as String?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(), + date: json['date'] as String?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + createdBy: json['created_by'] as String?, + modifiedBy: json['modified_by'] as String?, + steward: json['steward'], + guild: json['guild'], + product: json['product'], + ); + +Map _$StewardFreeSaleBarToJson(_StewardFreeSaleBar instance) => + { + 'id': instance.id, + 'buyer': instance.buyer, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'buyer_name': instance.buyerName, + 'buyer_mobile': instance.buyerMobile, + 'province': instance.province, + 'city': instance.city, + 'driver_name': instance.driverName, + 'driver_mobile': instance.driverMobile, + 'type_car': instance.typeCar, + 'pelak': instance.pelak, + 'clearance_code': instance.clearanceCode, + 'number_of_carcasses': instance.numberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'date': instance.date, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'steward': instance.steward, + 'guild': instance.guild, + 'product': instance.product, + }; + +_Buyer _$BuyerFromJson(Map json) => _Buyer( + key: json['key'] as String?, + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + unitName: json['unit_name'] as String?, + city: json['city'] as String?, + province: json['province'] as String?, + active: json['active'] as bool?, + steward: json['steward'] == null + ? null + : BuyerSteward.fromJson(json['steward'] as Map), +); + +Map _$BuyerToJson(_Buyer instance) => { + 'key': instance.key, + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'unit_name': instance.unitName, + 'city': instance.city, + 'province': instance.province, + 'active': instance.active, + 'steward': instance.steward, +}; + +_BuyerSteward _$BuyerStewardFromJson(Map json) => + _BuyerSteward( + key: json['key'] as String?, + guildsName: json['guilds_name'] as String?, + user: json['user'] == null + ? null + : BuyerStewardUser.fromJson(json['user'] as Map), + typeActivity: json['type_activity'] as String?, + areaActivity: json['area_activity'] as String?, + ); + +Map _$BuyerStewardToJson(_BuyerSteward instance) => + { + 'key': instance.key, + 'guilds_name': instance.guildsName, + 'user': instance.user, + 'type_activity': instance.typeActivity, + 'area_activity': instance.areaActivity, + }; + +_BuyerStewardUser _$BuyerStewardUserFromJson(Map json) => + _BuyerStewardUser( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + provinceName: json['province_name'] as String?, + cityName: json['city_name'] as String?, + password: json['password'] as String?, + ); + +Map _$BuyerStewardUserToJson(_BuyerStewardUser instance) => + { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'province_name': instance.provinceName, + 'city_name': instance.cityName, + 'password': instance.password, + }; diff --git a/packages/chicken/lib/data/models/response/user_info/user_info_model.dart b/packages/chicken/lib/data/models/response/user_info/user_info_model.dart new file mode 100644 index 0000000..e1a94ea --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_info/user_info_model.dart @@ -0,0 +1,18 @@ +import 'package:rasadyar_core/core.dart'; + +part 'user_info_model.freezed.dart'; + +part 'user_info_model.g.dart'; + +@freezed +abstract class UserInfoModel with _$UserInfoModel { + const factory UserInfoModel({ + bool? isUser, + String? address, + String? backend, + String? apiKey, + }) = _UserInfoModel ; + + factory UserInfoModel.fromJson(Map json) => + _$UserInfoModelFromJson(json); +} \ No newline at end of file diff --git a/packages/chicken/lib/data/models/response/user_info/user_info_model.freezed.dart b/packages/chicken/lib/data/models/response/user_info/user_info_model.freezed.dart new file mode 100644 index 0000000..7d28ca0 --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_info/user_info_model.freezed.dart @@ -0,0 +1,286 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'user_info_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$UserInfoModel { + + bool? get isUser; String? get address; String? get backend; String? get apiKey; +/// Create a copy of UserInfoModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserInfoModelCopyWith get copyWith => _$UserInfoModelCopyWithImpl(this as UserInfoModel, _$identity); + + /// Serializes this UserInfoModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UserInfoModel&&(identical(other.isUser, isUser) || other.isUser == isUser)&&(identical(other.address, address) || other.address == address)&&(identical(other.backend, backend) || other.backend == backend)&&(identical(other.apiKey, apiKey) || other.apiKey == apiKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isUser,address,backend,apiKey); + +@override +String toString() { + return 'UserInfoModel(isUser: $isUser, address: $address, backend: $backend, apiKey: $apiKey)'; +} + + +} + +/// @nodoc +abstract mixin class $UserInfoModelCopyWith<$Res> { + factory $UserInfoModelCopyWith(UserInfoModel value, $Res Function(UserInfoModel) _then) = _$UserInfoModelCopyWithImpl; +@useResult +$Res call({ + bool? isUser, String? address, String? backend, String? apiKey +}); + + + + +} +/// @nodoc +class _$UserInfoModelCopyWithImpl<$Res> + implements $UserInfoModelCopyWith<$Res> { + _$UserInfoModelCopyWithImpl(this._self, this._then); + + final UserInfoModel _self; + final $Res Function(UserInfoModel) _then; + +/// Create a copy of UserInfoModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isUser = freezed,Object? address = freezed,Object? backend = freezed,Object? apiKey = freezed,}) { + return _then(_self.copyWith( +isUser: freezed == isUser ? _self.isUser : isUser // ignore: cast_nullable_to_non_nullable +as bool?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,backend: freezed == backend ? _self.backend : backend // ignore: cast_nullable_to_non_nullable +as String?,apiKey: freezed == apiKey ? _self.apiKey : apiKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [UserInfoModel]. +extension UserInfoModelPatterns on UserInfoModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UserInfoModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UserInfoModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UserInfoModel value) $default,){ +final _that = this; +switch (_that) { +case _UserInfoModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UserInfoModel value)? $default,){ +final _that = this; +switch (_that) { +case _UserInfoModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? isUser, String? address, String? backend, String? apiKey)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UserInfoModel() when $default != null: +return $default(_that.isUser,_that.address,_that.backend,_that.apiKey);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? isUser, String? address, String? backend, String? apiKey) $default,) {final _that = this; +switch (_that) { +case _UserInfoModel(): +return $default(_that.isUser,_that.address,_that.backend,_that.apiKey);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? isUser, String? address, String? backend, String? apiKey)? $default,) {final _that = this; +switch (_that) { +case _UserInfoModel() when $default != null: +return $default(_that.isUser,_that.address,_that.backend,_that.apiKey);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _UserInfoModel implements UserInfoModel { + const _UserInfoModel({this.isUser, this.address, this.backend, this.apiKey}); + factory _UserInfoModel.fromJson(Map json) => _$UserInfoModelFromJson(json); + +@override final bool? isUser; +@override final String? address; +@override final String? backend; +@override final String? apiKey; + +/// Create a copy of UserInfoModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserInfoModelCopyWith<_UserInfoModel> get copyWith => __$UserInfoModelCopyWithImpl<_UserInfoModel>(this, _$identity); + +@override +Map toJson() { + return _$UserInfoModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserInfoModel&&(identical(other.isUser, isUser) || other.isUser == isUser)&&(identical(other.address, address) || other.address == address)&&(identical(other.backend, backend) || other.backend == backend)&&(identical(other.apiKey, apiKey) || other.apiKey == apiKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isUser,address,backend,apiKey); + +@override +String toString() { + return 'UserInfoModel(isUser: $isUser, address: $address, backend: $backend, apiKey: $apiKey)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserInfoModelCopyWith<$Res> implements $UserInfoModelCopyWith<$Res> { + factory _$UserInfoModelCopyWith(_UserInfoModel value, $Res Function(_UserInfoModel) _then) = __$UserInfoModelCopyWithImpl; +@override @useResult +$Res call({ + bool? isUser, String? address, String? backend, String? apiKey +}); + + + + +} +/// @nodoc +class __$UserInfoModelCopyWithImpl<$Res> + implements _$UserInfoModelCopyWith<$Res> { + __$UserInfoModelCopyWithImpl(this._self, this._then); + + final _UserInfoModel _self; + final $Res Function(_UserInfoModel) _then; + +/// Create a copy of UserInfoModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isUser = freezed,Object? address = freezed,Object? backend = freezed,Object? apiKey = freezed,}) { + return _then(_UserInfoModel( +isUser: freezed == isUser ? _self.isUser : isUser // ignore: cast_nullable_to_non_nullable +as bool?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,backend: freezed == backend ? _self.backend : backend // ignore: cast_nullable_to_non_nullable +as String?,apiKey: freezed == apiKey ? _self.apiKey : apiKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/user_info/user_info_model.g.dart b/packages/chicken/lib/data/models/response/user_info/user_info_model.g.dart new file mode 100644 index 0000000..2c8f1c4 --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_info/user_info_model.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_info_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_UserInfoModel _$UserInfoModelFromJson(Map json) => + _UserInfoModel( + isUser: json['is_user'] as bool?, + address: json['address'] as String?, + backend: json['backend'] as String?, + apiKey: json['api_key'] as String?, + ); + +Map _$UserInfoModelToJson(_UserInfoModel instance) => + { + 'is_user': instance.isUser, + 'address': instance.address, + 'backend': instance.backend, + 'api_key': instance.apiKey, + }; diff --git a/packages/chicken/lib/data/models/response/user_profile/user_profile.dart b/packages/chicken/lib/data/models/response/user_profile/user_profile.dart new file mode 100644 index 0000000..29c5b39 --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_profile/user_profile.dart @@ -0,0 +1,65 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'user_profile.freezed.dart'; +part 'user_profile.g.dart'; + +@freezed +abstract class UserProfile with _$UserProfile { + const factory UserProfile({ + List? role, + String? city, + String? province, + String? key, + String? userGateWayId, + dynamic userDjangoIdForeignKey, + dynamic provinceIdForeignKey, + dynamic cityIdForeignKey, + dynamic systemUserProfileIdKey, + String? fullname, + String? firstName, + String? lastName, + String? nationalCode, + String? nationalCodeImage, + String? nationalId, + String? mobile, + String? birthday, + String? image, + String? password, + bool? active, + UserState? state, + int? baseOrder, + int? cityNumber, + String? cityName, + int? provinceNumber, + String? provinceName, + String? unitName, + String? unitNationalId, + String? unitRegistrationNumber, + String? unitEconomicalNumber, + String? unitProvince, + String? unitCity, + String? unitPostalCode, + String? unitAddress, + String? personType, + String? type, + }) = _UserProfile; + + factory UserProfile.fromJson(Map json) => _$UserProfileFromJson(json); +} + +@freezed +abstract class UserState with _$UserState { + const factory UserState({ + String? city, + String? image, + String? mobile, + String? birthday, + String? province, + String? lastName, + String? firstName, + String? nationalId, + String? nationalCode, + }) = _UserState; + + factory UserState.fromJson(Map json) => _$UserStateFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/user_profile/user_profile.freezed.dart b/packages/chicken/lib/data/models/response/user_profile/user_profile.freezed.dart new file mode 100644 index 0000000..041158c --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_profile/user_profile.freezed.dart @@ -0,0 +1,701 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'user_profile.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$UserProfile { + + List? get role; String? get city; String? get province; String? get key; String? get userGateWayId; dynamic get userDjangoIdForeignKey; dynamic get provinceIdForeignKey; dynamic get cityIdForeignKey; dynamic get systemUserProfileIdKey; String? get fullname; String? get firstName; String? get lastName; String? get nationalCode; String? get nationalCodeImage; String? get nationalId; String? get mobile; String? get birthday; String? get image; String? get password; bool? get active; UserState? get state; int? get baseOrder; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; String? get unitName; String? get unitNationalId; String? get unitRegistrationNumber; String? get unitEconomicalNumber; String? get unitProvince; String? get unitCity; String? get unitPostalCode; String? get unitAddress; String? get personType; String? get type; +/// Create a copy of UserProfile +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserProfileCopyWith get copyWith => _$UserProfileCopyWithImpl(this as UserProfile, _$identity); + + /// Serializes this UserProfile to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfile&&const DeepCollectionEquality().equals(other.role, role)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.key, key) || other.key == key)&&(identical(other.userGateWayId, userGateWayId) || other.userGateWayId == userGateWayId)&&const DeepCollectionEquality().equals(other.userDjangoIdForeignKey, userDjangoIdForeignKey)&&const DeepCollectionEquality().equals(other.provinceIdForeignKey, provinceIdForeignKey)&&const DeepCollectionEquality().equals(other.cityIdForeignKey, cityIdForeignKey)&&const DeepCollectionEquality().equals(other.systemUserProfileIdKey, systemUserProfileIdKey)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalCodeImage, nationalCodeImage) || other.nationalCodeImage == nationalCodeImage)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.password, password) || other.password == password)&&(identical(other.active, active) || other.active == active)&&(identical(other.state, state) || other.state == state)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)&&(identical(other.personType, personType) || other.personType == personType)&&(identical(other.type, type) || other.type == type)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,const DeepCollectionEquality().hash(role),city,province,key,userGateWayId,const DeepCollectionEquality().hash(userDjangoIdForeignKey),const DeepCollectionEquality().hash(provinceIdForeignKey),const DeepCollectionEquality().hash(cityIdForeignKey),const DeepCollectionEquality().hash(systemUserProfileIdKey),fullname,firstName,lastName,nationalCode,nationalCodeImage,nationalId,mobile,birthday,image,password,active,state,baseOrder,cityNumber,cityName,provinceNumber,provinceName,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress,personType,type]); + +@override +String toString() { + return 'UserProfile(role: $role, city: $city, province: $province, key: $key, userGateWayId: $userGateWayId, userDjangoIdForeignKey: $userDjangoIdForeignKey, provinceIdForeignKey: $provinceIdForeignKey, cityIdForeignKey: $cityIdForeignKey, systemUserProfileIdKey: $systemUserProfileIdKey, fullname: $fullname, firstName: $firstName, lastName: $lastName, nationalCode: $nationalCode, nationalCodeImage: $nationalCodeImage, nationalId: $nationalId, mobile: $mobile, birthday: $birthday, image: $image, password: $password, active: $active, state: $state, baseOrder: $baseOrder, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress, personType: $personType, type: $type)'; +} + + +} + +/// @nodoc +abstract mixin class $UserProfileCopyWith<$Res> { + factory $UserProfileCopyWith(UserProfile value, $Res Function(UserProfile) _then) = _$UserProfileCopyWithImpl; +@useResult +$Res call({ + List? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type +}); + + +$UserStateCopyWith<$Res>? get state; + +} +/// @nodoc +class _$UserProfileCopyWithImpl<$Res> + implements $UserProfileCopyWith<$Res> { + _$UserProfileCopyWithImpl(this._self, this._then); + + final UserProfile _self; + final $Res Function(UserProfile) _then; + +/// Create a copy of UserProfile +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? role = freezed,Object? city = freezed,Object? province = freezed,Object? key = freezed,Object? userGateWayId = freezed,Object? userDjangoIdForeignKey = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdForeignKey = freezed,Object? systemUserProfileIdKey = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? nationalCode = freezed,Object? nationalCodeImage = freezed,Object? nationalId = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? image = freezed,Object? password = freezed,Object? active = freezed,Object? state = freezed,Object? baseOrder = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,Object? personType = freezed,Object? type = freezed,}) { + return _then(_self.copyWith( +role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as List?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,userGateWayId: freezed == userGateWayId ? _self.userGateWayId : userGateWayId // ignore: cast_nullable_to_non_nullable +as String?,userDjangoIdForeignKey: freezed == userDjangoIdForeignKey ? _self.userDjangoIdForeignKey : userDjangoIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,cityIdForeignKey: freezed == cityIdForeignKey ? _self.cityIdForeignKey : cityIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,systemUserProfileIdKey: freezed == systemUserProfileIdKey ? _self.systemUserProfileIdKey : systemUserProfileIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,nationalCodeImage: freezed == nationalCodeImage ? _self.nationalCodeImage : nationalCodeImage // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable +as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as UserState?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable +as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable +as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable +as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable +as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable +as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable +as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable +as String?,personType: freezed == personType ? _self.personType : personType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of UserProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserStateCopyWith<$Res>? get state { + if (_self.state == null) { + return null; + } + + return $UserStateCopyWith<$Res>(_self.state!, (value) { + return _then(_self.copyWith(state: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [UserProfile]. +extension UserProfilePatterns on UserProfile { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UserProfile value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UserProfile() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UserProfile value) $default,){ +final _that = this; +switch (_that) { +case _UserProfile(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UserProfile value)? $default,){ +final _that = this; +switch (_that) { +case _UserProfile() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( List? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UserProfile() when $default != null: +return $default(_that.role,_that.city,_that.province,_that.key,_that.userGateWayId,_that.userDjangoIdForeignKey,_that.provinceIdForeignKey,_that.cityIdForeignKey,_that.systemUserProfileIdKey,_that.fullname,_that.firstName,_that.lastName,_that.nationalCode,_that.nationalCodeImage,_that.nationalId,_that.mobile,_that.birthday,_that.image,_that.password,_that.active,_that.state,_that.baseOrder,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress,_that.personType,_that.type);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( List? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type) $default,) {final _that = this; +switch (_that) { +case _UserProfile(): +return $default(_that.role,_that.city,_that.province,_that.key,_that.userGateWayId,_that.userDjangoIdForeignKey,_that.provinceIdForeignKey,_that.cityIdForeignKey,_that.systemUserProfileIdKey,_that.fullname,_that.firstName,_that.lastName,_that.nationalCode,_that.nationalCodeImage,_that.nationalId,_that.mobile,_that.birthday,_that.image,_that.password,_that.active,_that.state,_that.baseOrder,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress,_that.personType,_that.type);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( List? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type)? $default,) {final _that = this; +switch (_that) { +case _UserProfile() when $default != null: +return $default(_that.role,_that.city,_that.province,_that.key,_that.userGateWayId,_that.userDjangoIdForeignKey,_that.provinceIdForeignKey,_that.cityIdForeignKey,_that.systemUserProfileIdKey,_that.fullname,_that.firstName,_that.lastName,_that.nationalCode,_that.nationalCodeImage,_that.nationalId,_that.mobile,_that.birthday,_that.image,_that.password,_that.active,_that.state,_that.baseOrder,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress,_that.personType,_that.type);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _UserProfile implements UserProfile { + const _UserProfile({final List? role, this.city, this.province, this.key, this.userGateWayId, this.userDjangoIdForeignKey, this.provinceIdForeignKey, this.cityIdForeignKey, this.systemUserProfileIdKey, this.fullname, this.firstName, this.lastName, this.nationalCode, this.nationalCodeImage, this.nationalId, this.mobile, this.birthday, this.image, this.password, this.active, this.state, this.baseOrder, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.unitName, this.unitNationalId, this.unitRegistrationNumber, this.unitEconomicalNumber, this.unitProvince, this.unitCity, this.unitPostalCode, this.unitAddress, this.personType, this.type}): _role = role; + factory _UserProfile.fromJson(Map json) => _$UserProfileFromJson(json); + + final List? _role; +@override List? get role { + final value = _role; + if (value == null) return null; + if (_role is EqualUnmodifiableListView) return _role; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final String? city; +@override final String? province; +@override final String? key; +@override final String? userGateWayId; +@override final dynamic userDjangoIdForeignKey; +@override final dynamic provinceIdForeignKey; +@override final dynamic cityIdForeignKey; +@override final dynamic systemUserProfileIdKey; +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? nationalCode; +@override final String? nationalCodeImage; +@override final String? nationalId; +@override final String? mobile; +@override final String? birthday; +@override final String? image; +@override final String? password; +@override final bool? active; +@override final UserState? state; +@override final int? baseOrder; +@override final int? cityNumber; +@override final String? cityName; +@override final int? provinceNumber; +@override final String? provinceName; +@override final String? unitName; +@override final String? unitNationalId; +@override final String? unitRegistrationNumber; +@override final String? unitEconomicalNumber; +@override final String? unitProvince; +@override final String? unitCity; +@override final String? unitPostalCode; +@override final String? unitAddress; +@override final String? personType; +@override final String? type; + +/// Create a copy of UserProfile +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserProfileCopyWith<_UserProfile> get copyWith => __$UserProfileCopyWithImpl<_UserProfile>(this, _$identity); + +@override +Map toJson() { + return _$UserProfileToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfile&&const DeepCollectionEquality().equals(other._role, _role)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.key, key) || other.key == key)&&(identical(other.userGateWayId, userGateWayId) || other.userGateWayId == userGateWayId)&&const DeepCollectionEquality().equals(other.userDjangoIdForeignKey, userDjangoIdForeignKey)&&const DeepCollectionEquality().equals(other.provinceIdForeignKey, provinceIdForeignKey)&&const DeepCollectionEquality().equals(other.cityIdForeignKey, cityIdForeignKey)&&const DeepCollectionEquality().equals(other.systemUserProfileIdKey, systemUserProfileIdKey)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalCodeImage, nationalCodeImage) || other.nationalCodeImage == nationalCodeImage)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.password, password) || other.password == password)&&(identical(other.active, active) || other.active == active)&&(identical(other.state, state) || other.state == state)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)&&(identical(other.personType, personType) || other.personType == personType)&&(identical(other.type, type) || other.type == type)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,const DeepCollectionEquality().hash(_role),city,province,key,userGateWayId,const DeepCollectionEquality().hash(userDjangoIdForeignKey),const DeepCollectionEquality().hash(provinceIdForeignKey),const DeepCollectionEquality().hash(cityIdForeignKey),const DeepCollectionEquality().hash(systemUserProfileIdKey),fullname,firstName,lastName,nationalCode,nationalCodeImage,nationalId,mobile,birthday,image,password,active,state,baseOrder,cityNumber,cityName,provinceNumber,provinceName,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress,personType,type]); + +@override +String toString() { + return 'UserProfile(role: $role, city: $city, province: $province, key: $key, userGateWayId: $userGateWayId, userDjangoIdForeignKey: $userDjangoIdForeignKey, provinceIdForeignKey: $provinceIdForeignKey, cityIdForeignKey: $cityIdForeignKey, systemUserProfileIdKey: $systemUserProfileIdKey, fullname: $fullname, firstName: $firstName, lastName: $lastName, nationalCode: $nationalCode, nationalCodeImage: $nationalCodeImage, nationalId: $nationalId, mobile: $mobile, birthday: $birthday, image: $image, password: $password, active: $active, state: $state, baseOrder: $baseOrder, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress, personType: $personType, type: $type)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserProfileCopyWith<$Res> implements $UserProfileCopyWith<$Res> { + factory _$UserProfileCopyWith(_UserProfile value, $Res Function(_UserProfile) _then) = __$UserProfileCopyWithImpl; +@override @useResult +$Res call({ + List? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type +}); + + +@override $UserStateCopyWith<$Res>? get state; + +} +/// @nodoc +class __$UserProfileCopyWithImpl<$Res> + implements _$UserProfileCopyWith<$Res> { + __$UserProfileCopyWithImpl(this._self, this._then); + + final _UserProfile _self; + final $Res Function(_UserProfile) _then; + +/// Create a copy of UserProfile +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? role = freezed,Object? city = freezed,Object? province = freezed,Object? key = freezed,Object? userGateWayId = freezed,Object? userDjangoIdForeignKey = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdForeignKey = freezed,Object? systemUserProfileIdKey = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? nationalCode = freezed,Object? nationalCodeImage = freezed,Object? nationalId = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? image = freezed,Object? password = freezed,Object? active = freezed,Object? state = freezed,Object? baseOrder = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,Object? personType = freezed,Object? type = freezed,}) { + return _then(_UserProfile( +role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable +as List?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,userGateWayId: freezed == userGateWayId ? _self.userGateWayId : userGateWayId // ignore: cast_nullable_to_non_nullable +as String?,userDjangoIdForeignKey: freezed == userDjangoIdForeignKey ? _self.userDjangoIdForeignKey : userDjangoIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,cityIdForeignKey: freezed == cityIdForeignKey ? _self.cityIdForeignKey : cityIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,systemUserProfileIdKey: freezed == systemUserProfileIdKey ? _self.systemUserProfileIdKey : systemUserProfileIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,nationalCodeImage: freezed == nationalCodeImage ? _self.nationalCodeImage : nationalCodeImage // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable +as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as UserState?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable +as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable +as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable +as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable +as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable +as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable +as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable +as String?,personType: freezed == personType ? _self.personType : personType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of UserProfile +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserStateCopyWith<$Res>? get state { + if (_self.state == null) { + return null; + } + + return $UserStateCopyWith<$Res>(_self.state!, (value) { + return _then(_self.copyWith(state: value)); + }); +} +} + + +/// @nodoc +mixin _$UserState { + + String? get city; String? get image; String? get mobile; String? get birthday; String? get province; String? get lastName; String? get firstName; String? get nationalId; String? get nationalCode; +/// Create a copy of UserState +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserStateCopyWith get copyWith => _$UserStateCopyWithImpl(this as UserState, _$identity); + + /// Serializes this UserState to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UserState&&(identical(other.city, city) || other.city == city)&&(identical(other.image, image) || other.image == image)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.province, province) || other.province == province)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,image,mobile,birthday,province,lastName,firstName,nationalId,nationalCode); + +@override +String toString() { + return 'UserState(city: $city, image: $image, mobile: $mobile, birthday: $birthday, province: $province, lastName: $lastName, firstName: $firstName, nationalId: $nationalId, nationalCode: $nationalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $UserStateCopyWith<$Res> { + factory $UserStateCopyWith(UserState value, $Res Function(UserState) _then) = _$UserStateCopyWithImpl; +@useResult +$Res call({ + String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode +}); + + + + +} +/// @nodoc +class _$UserStateCopyWithImpl<$Res> + implements $UserStateCopyWith<$Res> { + _$UserStateCopyWithImpl(this._self, this._then); + + final UserState _self; + final $Res Function(UserState) _then; + +/// Create a copy of UserState +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? city = freezed,Object? image = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? province = freezed,Object? lastName = freezed,Object? firstName = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,}) { + return _then(_self.copyWith( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [UserState]. +extension UserStatePatterns on UserState { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UserState value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UserState() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UserState value) $default,){ +final _that = this; +switch (_that) { +case _UserState(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UserState value)? $default,){ +final _that = this; +switch (_that) { +case _UserState() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UserState() when $default != null: +return $default(_that.city,_that.image,_that.mobile,_that.birthday,_that.province,_that.lastName,_that.firstName,_that.nationalId,_that.nationalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode) $default,) {final _that = this; +switch (_that) { +case _UserState(): +return $default(_that.city,_that.image,_that.mobile,_that.birthday,_that.province,_that.lastName,_that.firstName,_that.nationalId,_that.nationalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode)? $default,) {final _that = this; +switch (_that) { +case _UserState() when $default != null: +return $default(_that.city,_that.image,_that.mobile,_that.birthday,_that.province,_that.lastName,_that.firstName,_that.nationalId,_that.nationalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _UserState implements UserState { + const _UserState({this.city, this.image, this.mobile, this.birthday, this.province, this.lastName, this.firstName, this.nationalId, this.nationalCode}); + factory _UserState.fromJson(Map json) => _$UserStateFromJson(json); + +@override final String? city; +@override final String? image; +@override final String? mobile; +@override final String? birthday; +@override final String? province; +@override final String? lastName; +@override final String? firstName; +@override final String? nationalId; +@override final String? nationalCode; + +/// Create a copy of UserState +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserStateCopyWith<_UserState> get copyWith => __$UserStateCopyWithImpl<_UserState>(this, _$identity); + +@override +Map toJson() { + return _$UserStateToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserState&&(identical(other.city, city) || other.city == city)&&(identical(other.image, image) || other.image == image)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.province, province) || other.province == province)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,image,mobile,birthday,province,lastName,firstName,nationalId,nationalCode); + +@override +String toString() { + return 'UserState(city: $city, image: $image, mobile: $mobile, birthday: $birthday, province: $province, lastName: $lastName, firstName: $firstName, nationalId: $nationalId, nationalCode: $nationalCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserStateCopyWith<$Res> implements $UserStateCopyWith<$Res> { + factory _$UserStateCopyWith(_UserState value, $Res Function(_UserState) _then) = __$UserStateCopyWithImpl; +@override @useResult +$Res call({ + String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode +}); + + + + +} +/// @nodoc +class __$UserStateCopyWithImpl<$Res> + implements _$UserStateCopyWith<$Res> { + __$UserStateCopyWithImpl(this._self, this._then); + + final _UserState _self; + final $Res Function(_UserState) _then; + +/// Create a copy of UserState +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? city = freezed,Object? image = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? province = freezed,Object? lastName = freezed,Object? firstName = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,}) { + return _then(_UserState( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/user_profile/user_profile.g.dart b/packages/chicken/lib/data/models/response/user_profile/user_profile.g.dart new file mode 100644 index 0000000..7a3516a --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_profile/user_profile.g.dart @@ -0,0 +1,113 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_profile.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_UserProfile _$UserProfileFromJson(Map json) => _UserProfile( + role: (json['role'] as List?)?.map((e) => e as String).toList(), + city: json['city'] as String?, + province: json['province'] as String?, + key: json['key'] as String?, + userGateWayId: json['user_gate_way_id'] as String?, + userDjangoIdForeignKey: json['user_django_id_foreign_key'], + provinceIdForeignKey: json['province_id_foreign_key'], + cityIdForeignKey: json['city_id_foreign_key'], + systemUserProfileIdKey: json['system_user_profile_id_key'], + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + nationalCode: json['national_code'] as String?, + nationalCodeImage: json['national_code_image'] as String?, + nationalId: json['national_id'] as String?, + mobile: json['mobile'] as String?, + birthday: json['birthday'] as String?, + image: json['image'] as String?, + password: json['password'] as String?, + active: json['active'] as bool?, + state: json['state'] == null + ? null + : UserState.fromJson(json['state'] as Map), + baseOrder: (json['base_order'] as num?)?.toInt(), + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + unitName: json['unit_name'] as String?, + unitNationalId: json['unit_national_id'] as String?, + unitRegistrationNumber: json['unit_registration_number'] as String?, + unitEconomicalNumber: json['unit_economical_number'] as String?, + unitProvince: json['unit_province'] as String?, + unitCity: json['unit_city'] as String?, + unitPostalCode: json['unit_postal_code'] as String?, + unitAddress: json['unit_address'] as String?, + personType: json['person_type'] as String?, + type: json['type'] as String?, +); + +Map _$UserProfileToJson(_UserProfile instance) => + { + 'role': instance.role, + 'city': instance.city, + 'province': instance.province, + 'key': instance.key, + 'user_gate_way_id': instance.userGateWayId, + 'user_django_id_foreign_key': instance.userDjangoIdForeignKey, + 'province_id_foreign_key': instance.provinceIdForeignKey, + 'city_id_foreign_key': instance.cityIdForeignKey, + 'system_user_profile_id_key': instance.systemUserProfileIdKey, + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'national_code': instance.nationalCode, + 'national_code_image': instance.nationalCodeImage, + 'national_id': instance.nationalId, + 'mobile': instance.mobile, + 'birthday': instance.birthday, + 'image': instance.image, + 'password': instance.password, + 'active': instance.active, + 'state': instance.state, + 'base_order': instance.baseOrder, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'unit_name': instance.unitName, + 'unit_national_id': instance.unitNationalId, + 'unit_registration_number': instance.unitRegistrationNumber, + 'unit_economical_number': instance.unitEconomicalNumber, + 'unit_province': instance.unitProvince, + 'unit_city': instance.unitCity, + 'unit_postal_code': instance.unitPostalCode, + 'unit_address': instance.unitAddress, + 'person_type': instance.personType, + 'type': instance.type, + }; + +_UserState _$UserStateFromJson(Map json) => _UserState( + city: json['city'] as String?, + image: json['image'] as String?, + mobile: json['mobile'] as String?, + birthday: json['birthday'] as String?, + province: json['province'] as String?, + lastName: json['last_name'] as String?, + firstName: json['first_name'] as String?, + nationalId: json['national_id'] as String?, + nationalCode: json['national_code'] as String?, +); + +Map _$UserStateToJson(_UserState instance) => + { + 'city': instance.city, + 'image': instance.image, + 'mobile': instance.mobile, + 'birthday': instance.birthday, + 'province': instance.province, + 'last_name': instance.lastName, + 'first_name': instance.firstName, + 'national_id': instance.nationalId, + 'national_code': instance.nationalCode, + }; diff --git a/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.dart b/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.dart new file mode 100644 index 0000000..70a9a40 --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.dart @@ -0,0 +1,30 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'user_profile_model.freezed.dart'; + +part 'user_profile_model.g.dart'; + +@freezed +abstract class UserProfileModel with _$UserProfileModel { + const factory UserProfileModel({ + String? accessToken, + String? expiresIn, + String? scope, + String? expireTime, + String? mobile, + String? fullname, + String? firstname, + String? lastname, + String? city, + String? province, + String? nationalCode, + String? nationalId, + String? birthday, + String? image, + int? baseOrder, + List? role, + }) = _UserProfileModel; + + factory UserProfileModel.fromJson(Map json) => + _$UserProfileModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.freezed.dart b/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.freezed.dart new file mode 100644 index 0000000..407cb7c --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.freezed.dart @@ -0,0 +1,330 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'user_profile_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$UserProfileModel { + + String? get accessToken; String? get expiresIn; String? get scope; String? get expireTime; String? get mobile; String? get fullname; String? get firstname; String? get lastname; String? get city; String? get province; String? get nationalCode; String? get nationalId; String? get birthday; String? get image; int? get baseOrder; List? get role; +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserProfileModelCopyWith get copyWith => _$UserProfileModelCopyWithImpl(this as UserProfileModel, _$identity); + + /// Serializes this UserProfileModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfileModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other.role, role)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(role)); + +@override +String toString() { + return 'UserProfileModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)'; +} + + +} + +/// @nodoc +abstract mixin class $UserProfileModelCopyWith<$Res> { + factory $UserProfileModelCopyWith(UserProfileModel value, $Res Function(UserProfileModel) _then) = _$UserProfileModelCopyWithImpl; +@useResult +$Res call({ + String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List? role +}); + + + + +} +/// @nodoc +class _$UserProfileModelCopyWithImpl<$Res> + implements $UserProfileModelCopyWith<$Res> { + _$UserProfileModelCopyWithImpl(this._self, this._then); + + final UserProfileModel _self; + final $Res Function(UserProfileModel) _then; + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) { + return _then(_self.copyWith( +accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable +as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable +as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable +as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable +as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable +as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [UserProfileModel]. +extension UserProfileModelPatterns on UserProfileModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UserProfileModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UserProfileModel value) $default,){ +final _that = this; +switch (_that) { +case _UserProfileModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UserProfileModel value)? $default,){ +final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List? role)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List? role) $default,) {final _that = this; +switch (_that) { +case _UserProfileModel(): +return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List? role)? $default,) {final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _UserProfileModel implements UserProfileModel { + const _UserProfileModel({this.accessToken, this.expiresIn, this.scope, this.expireTime, this.mobile, this.fullname, this.firstname, this.lastname, this.city, this.province, this.nationalCode, this.nationalId, this.birthday, this.image, this.baseOrder, final List? role}): _role = role; + factory _UserProfileModel.fromJson(Map json) => _$UserProfileModelFromJson(json); + +@override final String? accessToken; +@override final String? expiresIn; +@override final String? scope; +@override final String? expireTime; +@override final String? mobile; +@override final String? fullname; +@override final String? firstname; +@override final String? lastname; +@override final String? city; +@override final String? province; +@override final String? nationalCode; +@override final String? nationalId; +@override final String? birthday; +@override final String? image; +@override final int? baseOrder; + final List? _role; +@override List? get role { + final value = _role; + if (value == null) return null; + if (_role is EqualUnmodifiableListView) return _role; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserProfileModelCopyWith<_UserProfileModel> get copyWith => __$UserProfileModelCopyWithImpl<_UserProfileModel>(this, _$identity); + +@override +Map toJson() { + return _$UserProfileModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfileModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other._role, _role)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(_role)); + +@override +String toString() { + return 'UserProfileModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserProfileModelCopyWith<$Res> implements $UserProfileModelCopyWith<$Res> { + factory _$UserProfileModelCopyWith(_UserProfileModel value, $Res Function(_UserProfileModel) _then) = __$UserProfileModelCopyWithImpl; +@override @useResult +$Res call({ + String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List? role +}); + + + + +} +/// @nodoc +class __$UserProfileModelCopyWithImpl<$Res> + implements _$UserProfileModelCopyWith<$Res> { + __$UserProfileModelCopyWithImpl(this._self, this._then); + + final _UserProfileModel _self; + final $Res Function(_UserProfileModel) _then; + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) { + return _then(_UserProfileModel( +accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable +as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable +as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable +as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable +as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable +as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable +as int?,role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.g.dart b/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.g.dart new file mode 100644 index 0000000..df72e0e --- /dev/null +++ b/packages/chicken/lib/data/models/response/user_profile_model/user_profile_model.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_profile_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_UserProfileModel _$UserProfileModelFromJson(Map json) => + _UserProfileModel( + accessToken: json['access_token'] as String?, + expiresIn: json['expires_in'] as String?, + scope: json['scope'] as String?, + expireTime: json['expire_time'] as String?, + mobile: json['mobile'] as String?, + fullname: json['fullname'] as String?, + firstname: json['firstname'] as String?, + lastname: json['lastname'] as String?, + city: json['city'] as String?, + province: json['province'] as String?, + nationalCode: json['national_code'] as String?, + nationalId: json['national_id'] as String?, + birthday: json['birthday'] as String?, + image: json['image'] as String?, + baseOrder: (json['base_order'] as num?)?.toInt(), + role: (json['role'] as List?)?.map((e) => e as String).toList(), + ); + +Map _$UserProfileModelToJson(_UserProfileModel instance) => + { + 'access_token': instance.accessToken, + 'expires_in': instance.expiresIn, + 'scope': instance.scope, + 'expire_time': instance.expireTime, + 'mobile': instance.mobile, + 'fullname': instance.fullname, + 'firstname': instance.firstname, + 'lastname': instance.lastname, + 'city': instance.city, + 'province': instance.province, + 'national_code': instance.nationalCode, + 'national_id': instance.nationalId, + 'birthday': instance.birthday, + 'image': instance.image, + 'base_order': instance.baseOrder, + 'role': instance.role, + }; diff --git a/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.dart b/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.dart new file mode 100644 index 0000000..a775928 --- /dev/null +++ b/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.dart @@ -0,0 +1,168 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'waiting_arrival.freezed.dart'; +part 'waiting_arrival.g.dart'; + +@freezed +abstract class WaitingArrivalModel with _$WaitingArrivalModel { + factory WaitingArrivalModel({ + int? id, + ProductModel? product, + dynamic killHouse, + dynamic toKillHouse, + StewardModel? steward, + StewardModel? toSteward, + dynamic guilds, + dynamic toGuilds, + dynamic toColdHouse, + int? indexWeight, + int? dateTimestamp, + int? newState, + int? newReceiverState, + int? newAllocationState, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + int? numberOfCarcasses, + int? realNumberOfCarcasses, + int? receiverRealNumberOfCarcasses, + double? weightOfCarcasses, + double? realWeightOfCarcasses, + double? receiverRealWeightOfCarcasses, + double? weightLossOfCarcasses, + bool? finalRegistration, + String? sellType, + String? productName, + String? sellerType, + String? type, + String? saleType, + String? allocationType, + bool? systemRegistrationCode, + int? registrationCode, + int? amount, + int? totalAmount, + int? totalAmountPaid, + int? totalAmountRemain, + dynamic loggedRegistrationCode, + String? state, + String? receiverState, + String? allocationState, + String? date, + dynamic role, + dynamic stewardTempKey, + bool? approvedPriceStatus, + bool? calculateStatus, + bool? temporaryTrash, + bool? temporaryDeleted, + bool? overhead, + dynamic createdBy, + dynamic modifiedBy, + dynamic wareHouse, + dynamic stewardWareHouse, + dynamic car, + dynamic dispenser, + }) = _WaitingArrivalModel; + + factory WaitingArrivalModel.fromJson(Map json) => + _$WaitingArrivalModelFromJson(json); +} + +@freezed +abstract class ProductModel with _$ProductModel { + factory ProductModel({String? name, double? weightAverage}) = _ProductModel; + + factory ProductModel.fromJson(Map json) => _$ProductModelFromJson(json); +} + +@freezed +abstract class StewardModel with _$StewardModel { + factory StewardModel({ + int? id, + StewardUserModel? user, + AddressModel? address, + dynamic guildAreaActivity, + dynamic guildTypeActivity, + List? killHouse, + List? stewardKillHouse, + List? stewards, + GetPosStatusModel? getPosStatus, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + bool? active, + int? cityNumber, + String? cityName, + String? guildsId, + String? licenseNumber, + String? guildsName, + String? phone, + String? typeActivity, + String? areaActivity, + int? provinceNumber, + String? provinceName, + bool? steward, + bool? hasPos, + int? allocationLimit, + bool? limitationAllocation, + String? provinceAcceptState, + bool? stewardActive, + bool? stewardLimitationAllocation, + bool? license, + int? wallet, + List? cars, + List? userLevel, + }) = _StewardModel; + + factory StewardModel.fromJson(Map json) => _$StewardModelFromJson(json); +} + +@freezed +abstract class StewardUserModel with _$StewardUserModel { + factory StewardUserModel({ + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? nationalId, + String? city, + }) = _StewardUserModel; + + factory StewardUserModel.fromJson(Map json) => _$StewardUserModelFromJson(json); +} + +@freezed +abstract class AddressModel with _$AddressModel { + factory AddressModel({ + ProvinceModel? province, + CityModel? city, + String? address, + String? postalCode, + }) = _AddressModel; + + factory AddressModel.fromJson(Map json) => _$AddressModelFromJson(json); +} + +@freezed +abstract class ProvinceModel with _$ProvinceModel { + factory ProvinceModel({String? key, String? name}) = _ProvinceModel; + + factory ProvinceModel.fromJson(Map json) => _$ProvinceModelFromJson(json); +} + +@freezed +abstract class CityModel with _$CityModel { + factory CityModel({String? key, String? name}) = _CityModel; + + factory CityModel.fromJson(Map json) => _$CityModelFromJson(json); +} + +@freezed +abstract class GetPosStatusModel with _$GetPosStatusModel { + factory GetPosStatusModel({int? lenActiveSessions, bool? hasPons, bool? hasActivePons}) = + _GetPosStatusModel; + + factory GetPosStatusModel.fromJson(Map json) => + _$GetPosStatusModelFromJson(json); +} diff --git a/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.freezed.dart b/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.freezed.dart new file mode 100644 index 0000000..1cbd066 --- /dev/null +++ b/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.freezed.dart @@ -0,0 +1,2656 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'waiting_arrival.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$WaitingArrivalModel { + + int? get id; ProductModel? get product; dynamic get killHouse; dynamic get toKillHouse; StewardModel? get steward; StewardModel? get toSteward; dynamic get guilds; dynamic get toGuilds; dynamic get toColdHouse; int? get indexWeight; int? get dateTimestamp; int? get newState; int? get newReceiverState; int? get newAllocationState; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get numberOfCarcasses; int? get realNumberOfCarcasses; int? get receiverRealNumberOfCarcasses; double? get weightOfCarcasses; double? get realWeightOfCarcasses; double? get receiverRealWeightOfCarcasses; double? get weightLossOfCarcasses; bool? get finalRegistration; String? get sellType; String? get productName; String? get sellerType; String? get type; String? get saleType; String? get allocationType; bool? get systemRegistrationCode; int? get registrationCode; int? get amount; int? get totalAmount; int? get totalAmountPaid; int? get totalAmountRemain; dynamic get loggedRegistrationCode; String? get state; String? get receiverState; String? get allocationState; String? get date; dynamic get role; dynamic get stewardTempKey; bool? get approvedPriceStatus; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; bool? get overhead; dynamic get createdBy; dynamic get modifiedBy; dynamic get wareHouse; dynamic get stewardWareHouse; dynamic get car; dynamic get dispenser; +/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$WaitingArrivalModelCopyWith get copyWith => _$WaitingArrivalModelCopyWithImpl(this as WaitingArrivalModel, _$identity); + + /// Serializes this WaitingArrivalModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is WaitingArrivalModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.overhead, overhead) || other.overhead == overhead)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,product,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(toKillHouse),steward,toSteward,const DeepCollectionEquality().hash(guilds),const DeepCollectionEquality().hash(toGuilds),const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,const DeepCollectionEquality().hash(loggedRegistrationCode),state,receiverState,allocationState,date,const DeepCollectionEquality().hash(role),const DeepCollectionEquality().hash(stewardTempKey),approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,overhead,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); + +@override +String toString() { + return 'WaitingArrivalModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, overhead: $overhead, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; +} + + +} + +/// @nodoc +abstract mixin class $WaitingArrivalModelCopyWith<$Res> { + factory $WaitingArrivalModelCopyWith(WaitingArrivalModel value, $Res Function(WaitingArrivalModel) _then) = _$WaitingArrivalModelCopyWithImpl; +@useResult +$Res call({ + int? id, ProductModel? product, dynamic killHouse, dynamic toKillHouse, StewardModel? steward, StewardModel? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, bool? overhead, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser +}); + + +$ProductModelCopyWith<$Res>? get product;$StewardModelCopyWith<$Res>? get steward;$StewardModelCopyWith<$Res>? get toSteward; + +} +/// @nodoc +class _$WaitingArrivalModelCopyWithImpl<$Res> + implements $WaitingArrivalModelCopyWith<$Res> { + _$WaitingArrivalModelCopyWithImpl(this._self, this._then); + + final WaitingArrivalModel _self; + final $Res Function(WaitingArrivalModel) _then; + +/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? overhead = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as ProductModel?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,toKillHouse: freezed == toKillHouse ? _self.toKillHouse : toKillHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as StewardModel?,toSteward: freezed == toSteward ? _self.toSteward : toSteward // ignore: cast_nullable_to_non_nullable +as StewardModel?,guilds: freezed == guilds ? _self.guilds : guilds // ignore: cast_nullable_to_non_nullable +as dynamic,toGuilds: freezed == toGuilds ? _self.toGuilds : toGuilds // ignore: cast_nullable_to_non_nullable +as dynamic,toColdHouse: freezed == toColdHouse ? _self.toColdHouse : toColdHouse // ignore: cast_nullable_to_non_nullable +as dynamic,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as int?,dateTimestamp: freezed == dateTimestamp ? _self.dateTimestamp : dateTimestamp // ignore: cast_nullable_to_non_nullable +as int?,newState: freezed == newState ? _self.newState : newState // ignore: cast_nullable_to_non_nullable +as int?,newReceiverState: freezed == newReceiverState ? _self.newReceiverState : newReceiverState // ignore: cast_nullable_to_non_nullable +as int?,newAllocationState: freezed == newAllocationState ? _self.newAllocationState : newAllocationState // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realNumberOfCarcasses: freezed == realNumberOfCarcasses ? _self.realNumberOfCarcasses : realNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,realWeightOfCarcasses: freezed == realWeightOfCarcasses ? _self.realWeightOfCarcasses : realWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,finalRegistration: freezed == finalRegistration ? _self.finalRegistration : finalRegistration // ignore: cast_nullable_to_non_nullable +as bool?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,productName: freezed == productName ? _self.productName : productName // ignore: cast_nullable_to_non_nullable +as String?,sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,saleType: freezed == saleType ? _self.saleType : saleType // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,systemRegistrationCode: freezed == systemRegistrationCode ? _self.systemRegistrationCode : systemRegistrationCode // ignore: cast_nullable_to_non_nullable +as bool?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,totalAmountPaid: freezed == totalAmountPaid ? _self.totalAmountPaid : totalAmountPaid // ignore: cast_nullable_to_non_nullable +as int?,totalAmountRemain: freezed == totalAmountRemain ? _self.totalAmountRemain : totalAmountRemain // ignore: cast_nullable_to_non_nullable +as int?,loggedRegistrationCode: freezed == loggedRegistrationCode ? _self.loggedRegistrationCode : loggedRegistrationCode // ignore: cast_nullable_to_non_nullable +as dynamic,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,receiverState: freezed == receiverState ? _self.receiverState : receiverState // ignore: cast_nullable_to_non_nullable +as String?,allocationState: freezed == allocationState ? _self.allocationState : allocationState // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as dynamic,stewardTempKey: freezed == stewardTempKey ? _self.stewardTempKey : stewardTempKey // ignore: cast_nullable_to_non_nullable +as dynamic,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,overhead: freezed == overhead ? _self.overhead : overhead // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,stewardWareHouse: freezed == stewardWareHouse ? _self.stewardWareHouse : stewardWareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} +/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductModelCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductModelCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +}/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardModelCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $StewardModelCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +}/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardModelCopyWith<$Res>? get toSteward { + if (_self.toSteward == null) { + return null; + } + + return $StewardModelCopyWith<$Res>(_self.toSteward!, (value) { + return _then(_self.copyWith(toSteward: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [WaitingArrivalModel]. +extension WaitingArrivalModelPatterns on WaitingArrivalModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _WaitingArrivalModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _WaitingArrivalModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _WaitingArrivalModel value) $default,){ +final _that = this; +switch (_that) { +case _WaitingArrivalModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _WaitingArrivalModel value)? $default,){ +final _that = this; +switch (_that) { +case _WaitingArrivalModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, ProductModel? product, dynamic killHouse, dynamic toKillHouse, StewardModel? steward, StewardModel? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, bool? overhead, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _WaitingArrivalModel() when $default != null: +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.overhead,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, ProductModel? product, dynamic killHouse, dynamic toKillHouse, StewardModel? steward, StewardModel? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, bool? overhead, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser) $default,) {final _that = this; +switch (_that) { +case _WaitingArrivalModel(): +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.overhead,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, ProductModel? product, dynamic killHouse, dynamic toKillHouse, StewardModel? steward, StewardModel? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, bool? overhead, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser)? $default,) {final _that = this; +switch (_that) { +case _WaitingArrivalModel() when $default != null: +return $default(_that.id,_that.product,_that.killHouse,_that.toKillHouse,_that.steward,_that.toSteward,_that.guilds,_that.toGuilds,_that.toColdHouse,_that.indexWeight,_that.dateTimestamp,_that.newState,_that.newReceiverState,_that.newAllocationState,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.numberOfCarcasses,_that.realNumberOfCarcasses,_that.receiverRealNumberOfCarcasses,_that.weightOfCarcasses,_that.realWeightOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses,_that.finalRegistration,_that.sellType,_that.productName,_that.sellerType,_that.type,_that.saleType,_that.allocationType,_that.systemRegistrationCode,_that.registrationCode,_that.amount,_that.totalAmount,_that.totalAmountPaid,_that.totalAmountRemain,_that.loggedRegistrationCode,_that.state,_that.receiverState,_that.allocationState,_that.date,_that.role,_that.stewardTempKey,_that.approvedPriceStatus,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.overhead,_that.createdBy,_that.modifiedBy,_that.wareHouse,_that.stewardWareHouse,_that.car,_that.dispenser);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _WaitingArrivalModel implements WaitingArrivalModel { + _WaitingArrivalModel({this.id, this.product, this.killHouse, this.toKillHouse, this.steward, this.toSteward, this.guilds, this.toGuilds, this.toColdHouse, this.indexWeight, this.dateTimestamp, this.newState, this.newReceiverState, this.newAllocationState, this.key, this.createDate, this.modifyDate, this.trash, this.numberOfCarcasses, this.realNumberOfCarcasses, this.receiverRealNumberOfCarcasses, this.weightOfCarcasses, this.realWeightOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses, this.finalRegistration, this.sellType, this.productName, this.sellerType, this.type, this.saleType, this.allocationType, this.systemRegistrationCode, this.registrationCode, this.amount, this.totalAmount, this.totalAmountPaid, this.totalAmountRemain, this.loggedRegistrationCode, this.state, this.receiverState, this.allocationState, this.date, this.role, this.stewardTempKey, this.approvedPriceStatus, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.overhead, this.createdBy, this.modifiedBy, this.wareHouse, this.stewardWareHouse, this.car, this.dispenser}); + factory _WaitingArrivalModel.fromJson(Map json) => _$WaitingArrivalModelFromJson(json); + +@override final int? id; +@override final ProductModel? product; +@override final dynamic killHouse; +@override final dynamic toKillHouse; +@override final StewardModel? steward; +@override final StewardModel? toSteward; +@override final dynamic guilds; +@override final dynamic toGuilds; +@override final dynamic toColdHouse; +@override final int? indexWeight; +@override final int? dateTimestamp; +@override final int? newState; +@override final int? newReceiverState; +@override final int? newAllocationState; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final int? numberOfCarcasses; +@override final int? realNumberOfCarcasses; +@override final int? receiverRealNumberOfCarcasses; +@override final double? weightOfCarcasses; +@override final double? realWeightOfCarcasses; +@override final double? receiverRealWeightOfCarcasses; +@override final double? weightLossOfCarcasses; +@override final bool? finalRegistration; +@override final String? sellType; +@override final String? productName; +@override final String? sellerType; +@override final String? type; +@override final String? saleType; +@override final String? allocationType; +@override final bool? systemRegistrationCode; +@override final int? registrationCode; +@override final int? amount; +@override final int? totalAmount; +@override final int? totalAmountPaid; +@override final int? totalAmountRemain; +@override final dynamic loggedRegistrationCode; +@override final String? state; +@override final String? receiverState; +@override final String? allocationState; +@override final String? date; +@override final dynamic role; +@override final dynamic stewardTempKey; +@override final bool? approvedPriceStatus; +@override final bool? calculateStatus; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final bool? overhead; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final dynamic wareHouse; +@override final dynamic stewardWareHouse; +@override final dynamic car; +@override final dynamic dispenser; + +/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$WaitingArrivalModelCopyWith<_WaitingArrivalModel> get copyWith => __$WaitingArrivalModelCopyWithImpl<_WaitingArrivalModel>(this, _$identity); + +@override +Map toJson() { + return _$WaitingArrivalModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _WaitingArrivalModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.overhead, overhead) || other.overhead == overhead)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,product,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(toKillHouse),steward,toSteward,const DeepCollectionEquality().hash(guilds),const DeepCollectionEquality().hash(toGuilds),const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,const DeepCollectionEquality().hash(loggedRegistrationCode),state,receiverState,allocationState,date,const DeepCollectionEquality().hash(role),const DeepCollectionEquality().hash(stewardTempKey),approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,overhead,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); + +@override +String toString() { + return 'WaitingArrivalModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, overhead: $overhead, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; +} + + +} + +/// @nodoc +abstract mixin class _$WaitingArrivalModelCopyWith<$Res> implements $WaitingArrivalModelCopyWith<$Res> { + factory _$WaitingArrivalModelCopyWith(_WaitingArrivalModel value, $Res Function(_WaitingArrivalModel) _then) = __$WaitingArrivalModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, ProductModel? product, dynamic killHouse, dynamic toKillHouse, StewardModel? steward, StewardModel? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, bool? overhead, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser +}); + + +@override $ProductModelCopyWith<$Res>? get product;@override $StewardModelCopyWith<$Res>? get steward;@override $StewardModelCopyWith<$Res>? get toSteward; + +} +/// @nodoc +class __$WaitingArrivalModelCopyWithImpl<$Res> + implements _$WaitingArrivalModelCopyWith<$Res> { + __$WaitingArrivalModelCopyWithImpl(this._self, this._then); + + final _WaitingArrivalModel _self; + final $Res Function(_WaitingArrivalModel) _then; + +/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? overhead = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { + return _then(_WaitingArrivalModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable +as ProductModel?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as dynamic,toKillHouse: freezed == toKillHouse ? _self.toKillHouse : toKillHouse // ignore: cast_nullable_to_non_nullable +as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as StewardModel?,toSteward: freezed == toSteward ? _self.toSteward : toSteward // ignore: cast_nullable_to_non_nullable +as StewardModel?,guilds: freezed == guilds ? _self.guilds : guilds // ignore: cast_nullable_to_non_nullable +as dynamic,toGuilds: freezed == toGuilds ? _self.toGuilds : toGuilds // ignore: cast_nullable_to_non_nullable +as dynamic,toColdHouse: freezed == toColdHouse ? _self.toColdHouse : toColdHouse // ignore: cast_nullable_to_non_nullable +as dynamic,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as int?,dateTimestamp: freezed == dateTimestamp ? _self.dateTimestamp : dateTimestamp // ignore: cast_nullable_to_non_nullable +as int?,newState: freezed == newState ? _self.newState : newState // ignore: cast_nullable_to_non_nullable +as int?,newReceiverState: freezed == newReceiverState ? _self.newReceiverState : newReceiverState // ignore: cast_nullable_to_non_nullable +as int?,newAllocationState: freezed == newAllocationState ? _self.newAllocationState : newAllocationState // ignore: cast_nullable_to_non_nullable +as int?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,realNumberOfCarcasses: freezed == realNumberOfCarcasses ? _self.realNumberOfCarcasses : realNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable +as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,realWeightOfCarcasses: freezed == realWeightOfCarcasses ? _self.realWeightOfCarcasses : realWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable +as double?,finalRegistration: freezed == finalRegistration ? _self.finalRegistration : finalRegistration // ignore: cast_nullable_to_non_nullable +as bool?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable +as String?,productName: freezed == productName ? _self.productName : productName // ignore: cast_nullable_to_non_nullable +as String?,sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,saleType: freezed == saleType ? _self.saleType : saleType // ignore: cast_nullable_to_non_nullable +as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable +as String?,systemRegistrationCode: freezed == systemRegistrationCode ? _self.systemRegistrationCode : systemRegistrationCode // ignore: cast_nullable_to_non_nullable +as bool?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable +as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable +as int?,totalAmountPaid: freezed == totalAmountPaid ? _self.totalAmountPaid : totalAmountPaid // ignore: cast_nullable_to_non_nullable +as int?,totalAmountRemain: freezed == totalAmountRemain ? _self.totalAmountRemain : totalAmountRemain // ignore: cast_nullable_to_non_nullable +as int?,loggedRegistrationCode: freezed == loggedRegistrationCode ? _self.loggedRegistrationCode : loggedRegistrationCode // ignore: cast_nullable_to_non_nullable +as dynamic,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,receiverState: freezed == receiverState ? _self.receiverState : receiverState // ignore: cast_nullable_to_non_nullable +as String?,allocationState: freezed == allocationState ? _self.allocationState : allocationState // ignore: cast_nullable_to_non_nullable +as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as dynamic,stewardTempKey: freezed == stewardTempKey ? _self.stewardTempKey : stewardTempKey // ignore: cast_nullable_to_non_nullable +as dynamic,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable +as bool?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable +as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,overhead: freezed == overhead ? _self.overhead : overhead // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,stewardWareHouse: freezed == stewardWareHouse ? _self.stewardWareHouse : stewardWareHouse // ignore: cast_nullable_to_non_nullable +as dynamic,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable +as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} + +/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProductModelCopyWith<$Res>? get product { + if (_self.product == null) { + return null; + } + + return $ProductModelCopyWith<$Res>(_self.product!, (value) { + return _then(_self.copyWith(product: value)); + }); +}/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardModelCopyWith<$Res>? get steward { + if (_self.steward == null) { + return null; + } + + return $StewardModelCopyWith<$Res>(_self.steward!, (value) { + return _then(_self.copyWith(steward: value)); + }); +}/// Create a copy of WaitingArrivalModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardModelCopyWith<$Res>? get toSteward { + if (_self.toSteward == null) { + return null; + } + + return $StewardModelCopyWith<$Res>(_self.toSteward!, (value) { + return _then(_self.copyWith(toSteward: value)); + }); +} +} + + +/// @nodoc +mixin _$ProductModel { + + String? get name; double? get weightAverage; +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProductModelCopyWith get copyWith => _$ProductModelCopyWithImpl(this as ProductModel, _$identity); + + /// Serializes this ProductModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ProductModel&&(identical(other.name, name) || other.name == name)&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,weightAverage); + +@override +String toString() { + return 'ProductModel(name: $name, weightAverage: $weightAverage)'; +} + + +} + +/// @nodoc +abstract mixin class $ProductModelCopyWith<$Res> { + factory $ProductModelCopyWith(ProductModel value, $Res Function(ProductModel) _then) = _$ProductModelCopyWithImpl; +@useResult +$Res call({ + String? name, double? weightAverage +}); + + + + +} +/// @nodoc +class _$ProductModelCopyWithImpl<$Res> + implements $ProductModelCopyWith<$Res> { + _$ProductModelCopyWithImpl(this._self, this._then); + + final ProductModel _self; + final $Res Function(ProductModel) _then; + +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? weightAverage = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ProductModel]. +extension ProductModelPatterns on ProductModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ProductModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ProductModel value) $default,){ +final _that = this; +switch (_that) { +case _ProductModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ProductModel value)? $default,){ +final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name, double? weightAverage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that.name,_that.weightAverage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name, double? weightAverage) $default,) {final _that = this; +switch (_that) { +case _ProductModel(): +return $default(_that.name,_that.weightAverage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name, double? weightAverage)? $default,) {final _that = this; +switch (_that) { +case _ProductModel() when $default != null: +return $default(_that.name,_that.weightAverage);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ProductModel implements ProductModel { + _ProductModel({this.name, this.weightAverage}); + factory _ProductModel.fromJson(Map json) => _$ProductModelFromJson(json); + +@override final String? name; +@override final double? weightAverage; + +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProductModelCopyWith<_ProductModel> get copyWith => __$ProductModelCopyWithImpl<_ProductModel>(this, _$identity); + +@override +Map toJson() { + return _$ProductModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProductModel&&(identical(other.name, name) || other.name == name)&&(identical(other.weightAverage, weightAverage) || other.weightAverage == weightAverage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,weightAverage); + +@override +String toString() { + return 'ProductModel(name: $name, weightAverage: $weightAverage)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProductModelCopyWith<$Res> implements $ProductModelCopyWith<$Res> { + factory _$ProductModelCopyWith(_ProductModel value, $Res Function(_ProductModel) _then) = __$ProductModelCopyWithImpl; +@override @useResult +$Res call({ + String? name, double? weightAverage +}); + + + + +} +/// @nodoc +class __$ProductModelCopyWithImpl<$Res> + implements _$ProductModelCopyWith<$Res> { + __$ProductModelCopyWithImpl(this._self, this._then); + + final _ProductModel _self; + final $Res Function(_ProductModel) _then; + +/// Create a copy of ProductModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? weightAverage = freezed,}) { + return _then(_ProductModel( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,weightAverage: freezed == weightAverage ? _self.weightAverage : weightAverage // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + + +/// @nodoc +mixin _$StewardModel { + + int? get id; StewardUserModel? get user; AddressModel? get address; dynamic get guildAreaActivity; dynamic get guildTypeActivity; List? get killHouse; List? get stewardKillHouse; List? get stewards; GetPosStatusModel? get getPosStatus; String? get key; String? get createDate; String? get modifyDate; bool? get trash; bool? get active; int? get cityNumber; String? get cityName; String? get guildsId; String? get licenseNumber; String? get guildsName; String? get phone; String? get typeActivity; String? get areaActivity; int? get provinceNumber; String? get provinceName; bool? get steward; bool? get hasPos; int? get allocationLimit; bool? get limitationAllocation; String? get provinceAcceptState; bool? get stewardActive; bool? get stewardLimitationAllocation; bool? get license; int? get wallet; List? get cars; List? get userLevel; +/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardModelCopyWith get copyWith => _$StewardModelCopyWithImpl(this as StewardModel, _$identity); + + /// Serializes this StewardModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardModel&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&const DeepCollectionEquality().equals(other.guildAreaActivity, guildAreaActivity)&&const DeepCollectionEquality().equals(other.guildTypeActivity, guildTypeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.stewardKillHouse, stewardKillHouse)&&const DeepCollectionEquality().equals(other.stewards, stewards)&&(identical(other.getPosStatus, getPosStatus) || other.getPosStatus == getPosStatus)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.active, active) || other.active == active)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.hasPos, hasPos) || other.hasPos == hasPos)&&(identical(other.allocationLimit, allocationLimit) || other.allocationLimit == allocationLimit)&&(identical(other.limitationAllocation, limitationAllocation) || other.limitationAllocation == limitationAllocation)&&(identical(other.provinceAcceptState, provinceAcceptState) || other.provinceAcceptState == provinceAcceptState)&&(identical(other.stewardActive, stewardActive) || other.stewardActive == stewardActive)&&(identical(other.stewardLimitationAllocation, stewardLimitationAllocation) || other.stewardLimitationAllocation == stewardLimitationAllocation)&&(identical(other.license, license) || other.license == license)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other.cars, cars)&&const DeepCollectionEquality().equals(other.userLevel, userLevel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,const DeepCollectionEquality().hash(guildAreaActivity),const DeepCollectionEquality().hash(guildTypeActivity),const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(stewardKillHouse),const DeepCollectionEquality().hash(stewards),getPosStatus,key,createDate,modifyDate,trash,active,cityNumber,cityName,guildsId,licenseNumber,guildsName,phone,typeActivity,areaActivity,provinceNumber,provinceName,steward,hasPos,allocationLimit,limitationAllocation,provinceAcceptState,stewardActive,stewardLimitationAllocation,license,wallet,const DeepCollectionEquality().hash(cars),const DeepCollectionEquality().hash(userLevel)]); + +@override +String toString() { + return 'StewardModel(id: $id, user: $user, address: $address, guildAreaActivity: $guildAreaActivity, guildTypeActivity: $guildTypeActivity, killHouse: $killHouse, stewardKillHouse: $stewardKillHouse, stewards: $stewards, getPosStatus: $getPosStatus, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, active: $active, cityNumber: $cityNumber, cityName: $cityName, guildsId: $guildsId, licenseNumber: $licenseNumber, guildsName: $guildsName, phone: $phone, typeActivity: $typeActivity, areaActivity: $areaActivity, provinceNumber: $provinceNumber, provinceName: $provinceName, steward: $steward, hasPos: $hasPos, allocationLimit: $allocationLimit, limitationAllocation: $limitationAllocation, provinceAcceptState: $provinceAcceptState, stewardActive: $stewardActive, stewardLimitationAllocation: $stewardLimitationAllocation, license: $license, wallet: $wallet, cars: $cars, userLevel: $userLevel)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardModelCopyWith<$Res> { + factory $StewardModelCopyWith(StewardModel value, $Res Function(StewardModel) _then) = _$StewardModelCopyWithImpl; +@useResult +$Res call({ + int? id, StewardUserModel? user, AddressModel? address, dynamic guildAreaActivity, dynamic guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, GetPosStatusModel? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, int? allocationLimit, bool? limitationAllocation, String? provinceAcceptState, bool? stewardActive, bool? stewardLimitationAllocation, bool? license, int? wallet, List? cars, List? userLevel +}); + + +$StewardUserModelCopyWith<$Res>? get user;$AddressModelCopyWith<$Res>? get address;$GetPosStatusModelCopyWith<$Res>? get getPosStatus; + +} +/// @nodoc +class _$StewardModelCopyWithImpl<$Res> + implements $StewardModelCopyWith<$Res> { + _$StewardModelCopyWithImpl(this._self, this._then); + + final StewardModel _self; + final $Res Function(StewardModel) _then; + +/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guildAreaActivity = freezed,Object? guildTypeActivity = freezed,Object? killHouse = freezed,Object? stewardKillHouse = freezed,Object? stewards = freezed,Object? getPosStatus = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? active = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? guildsId = freezed,Object? licenseNumber = freezed,Object? guildsName = freezed,Object? phone = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? steward = freezed,Object? hasPos = freezed,Object? allocationLimit = freezed,Object? limitationAllocation = freezed,Object? provinceAcceptState = freezed,Object? stewardActive = freezed,Object? stewardLimitationAllocation = freezed,Object? license = freezed,Object? wallet = freezed,Object? cars = freezed,Object? userLevel = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as StewardUserModel?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as AddressModel?,guildAreaActivity: freezed == guildAreaActivity ? _self.guildAreaActivity : guildAreaActivity // ignore: cast_nullable_to_non_nullable +as dynamic,guildTypeActivity: freezed == guildTypeActivity ? _self.guildTypeActivity : guildTypeActivity // ignore: cast_nullable_to_non_nullable +as dynamic,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as List?,stewardKillHouse: freezed == stewardKillHouse ? _self.stewardKillHouse : stewardKillHouse // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self.stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,getPosStatus: freezed == getPosStatus ? _self.getPosStatus : getPosStatus // ignore: cast_nullable_to_non_nullable +as GetPosStatusModel?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,hasPos: freezed == hasPos ? _self.hasPos : hasPos // ignore: cast_nullable_to_non_nullable +as bool?,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as int?,limitationAllocation: freezed == limitationAllocation ? _self.limitationAllocation : limitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,provinceAcceptState: freezed == provinceAcceptState ? _self.provinceAcceptState : provinceAcceptState // ignore: cast_nullable_to_non_nullable +as String?,stewardActive: freezed == stewardActive ? _self.stewardActive : stewardActive // ignore: cast_nullable_to_non_nullable +as bool?,stewardLimitationAllocation: freezed == stewardLimitationAllocation ? _self.stewardLimitationAllocation : stewardLimitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self.cars : cars // ignore: cast_nullable_to_non_nullable +as List?,userLevel: freezed == userLevel ? _self.userLevel : userLevel // ignore: cast_nullable_to_non_nullable +as List?, + )); +} +/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardUserModelCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $StewardUserModelCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressModelCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressModelCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetPosStatusModelCopyWith<$Res>? get getPosStatus { + if (_self.getPosStatus == null) { + return null; + } + + return $GetPosStatusModelCopyWith<$Res>(_self.getPosStatus!, (value) { + return _then(_self.copyWith(getPosStatus: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [StewardModel]. +extension StewardModelPatterns on StewardModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardModel value) $default,){ +final _that = this; +switch (_that) { +case _StewardModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardModel value)? $default,){ +final _that = this; +switch (_that) { +case _StewardModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, StewardUserModel? user, AddressModel? address, dynamic guildAreaActivity, dynamic guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, GetPosStatusModel? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, int? allocationLimit, bool? limitationAllocation, String? provinceAcceptState, bool? stewardActive, bool? stewardLimitationAllocation, bool? license, int? wallet, List? cars, List? userLevel)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardModel() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.allocationLimit,_that.limitationAllocation,_that.provinceAcceptState,_that.stewardActive,_that.stewardLimitationAllocation,_that.license,_that.wallet,_that.cars,_that.userLevel);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, StewardUserModel? user, AddressModel? address, dynamic guildAreaActivity, dynamic guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, GetPosStatusModel? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, int? allocationLimit, bool? limitationAllocation, String? provinceAcceptState, bool? stewardActive, bool? stewardLimitationAllocation, bool? license, int? wallet, List? cars, List? userLevel) $default,) {final _that = this; +switch (_that) { +case _StewardModel(): +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.allocationLimit,_that.limitationAllocation,_that.provinceAcceptState,_that.stewardActive,_that.stewardLimitationAllocation,_that.license,_that.wallet,_that.cars,_that.userLevel);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, StewardUserModel? user, AddressModel? address, dynamic guildAreaActivity, dynamic guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, GetPosStatusModel? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, int? allocationLimit, bool? limitationAllocation, String? provinceAcceptState, bool? stewardActive, bool? stewardLimitationAllocation, bool? license, int? wallet, List? cars, List? userLevel)? $default,) {final _that = this; +switch (_that) { +case _StewardModel() when $default != null: +return $default(_that.id,_that.user,_that.address,_that.guildAreaActivity,_that.guildTypeActivity,_that.killHouse,_that.stewardKillHouse,_that.stewards,_that.getPosStatus,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.active,_that.cityNumber,_that.cityName,_that.guildsId,_that.licenseNumber,_that.guildsName,_that.phone,_that.typeActivity,_that.areaActivity,_that.provinceNumber,_that.provinceName,_that.steward,_that.hasPos,_that.allocationLimit,_that.limitationAllocation,_that.provinceAcceptState,_that.stewardActive,_that.stewardLimitationAllocation,_that.license,_that.wallet,_that.cars,_that.userLevel);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardModel implements StewardModel { + _StewardModel({this.id, this.user, this.address, this.guildAreaActivity, this.guildTypeActivity, final List? killHouse, final List? stewardKillHouse, final List? stewards, this.getPosStatus, this.key, this.createDate, this.modifyDate, this.trash, this.active, this.cityNumber, this.cityName, this.guildsId, this.licenseNumber, this.guildsName, this.phone, this.typeActivity, this.areaActivity, this.provinceNumber, this.provinceName, this.steward, this.hasPos, this.allocationLimit, this.limitationAllocation, this.provinceAcceptState, this.stewardActive, this.stewardLimitationAllocation, this.license, this.wallet, final List? cars, final List? userLevel}): _killHouse = killHouse,_stewardKillHouse = stewardKillHouse,_stewards = stewards,_cars = cars,_userLevel = userLevel; + factory _StewardModel.fromJson(Map json) => _$StewardModelFromJson(json); + +@override final int? id; +@override final StewardUserModel? user; +@override final AddressModel? address; +@override final dynamic guildAreaActivity; +@override final dynamic guildTypeActivity; + final List? _killHouse; +@override List? get killHouse { + final value = _killHouse; + if (value == null) return null; + if (_killHouse is EqualUnmodifiableListView) return _killHouse; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewardKillHouse; +@override List? get stewardKillHouse { + final value = _stewardKillHouse; + if (value == null) return null; + if (_stewardKillHouse is EqualUnmodifiableListView) return _stewardKillHouse; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _stewards; +@override List? get stewards { + final value = _stewards; + if (value == null) return null; + if (_stewards is EqualUnmodifiableListView) return _stewards; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final GetPosStatusModel? getPosStatus; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final bool? active; +@override final int? cityNumber; +@override final String? cityName; +@override final String? guildsId; +@override final String? licenseNumber; +@override final String? guildsName; +@override final String? phone; +@override final String? typeActivity; +@override final String? areaActivity; +@override final int? provinceNumber; +@override final String? provinceName; +@override final bool? steward; +@override final bool? hasPos; +@override final int? allocationLimit; +@override final bool? limitationAllocation; +@override final String? provinceAcceptState; +@override final bool? stewardActive; +@override final bool? stewardLimitationAllocation; +@override final bool? license; +@override final int? wallet; + final List? _cars; +@override List? get cars { + final value = _cars; + if (value == null) return null; + if (_cars is EqualUnmodifiableListView) return _cars; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + final List? _userLevel; +@override List? get userLevel { + final value = _userLevel; + if (value == null) return null; + if (_userLevel is EqualUnmodifiableListView) return _userLevel; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardModelCopyWith<_StewardModel> get copyWith => __$StewardModelCopyWithImpl<_StewardModel>(this, _$identity); + +@override +Map toJson() { + return _$StewardModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardModel&&(identical(other.id, id) || other.id == id)&&(identical(other.user, user) || other.user == user)&&(identical(other.address, address) || other.address == address)&&const DeepCollectionEquality().equals(other.guildAreaActivity, guildAreaActivity)&&const DeepCollectionEquality().equals(other.guildTypeActivity, guildTypeActivity)&&const DeepCollectionEquality().equals(other._killHouse, _killHouse)&&const DeepCollectionEquality().equals(other._stewardKillHouse, _stewardKillHouse)&&const DeepCollectionEquality().equals(other._stewards, _stewards)&&(identical(other.getPosStatus, getPosStatus) || other.getPosStatus == getPosStatus)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.active, active) || other.active == active)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.guildsId, guildsId) || other.guildsId == guildsId)&&(identical(other.licenseNumber, licenseNumber) || other.licenseNumber == licenseNumber)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&(identical(other.areaActivity, areaActivity) || other.areaActivity == areaActivity)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.hasPos, hasPos) || other.hasPos == hasPos)&&(identical(other.allocationLimit, allocationLimit) || other.allocationLimit == allocationLimit)&&(identical(other.limitationAllocation, limitationAllocation) || other.limitationAllocation == limitationAllocation)&&(identical(other.provinceAcceptState, provinceAcceptState) || other.provinceAcceptState == provinceAcceptState)&&(identical(other.stewardActive, stewardActive) || other.stewardActive == stewardActive)&&(identical(other.stewardLimitationAllocation, stewardLimitationAllocation) || other.stewardLimitationAllocation == stewardLimitationAllocation)&&(identical(other.license, license) || other.license == license)&&(identical(other.wallet, wallet) || other.wallet == wallet)&&const DeepCollectionEquality().equals(other._cars, _cars)&&const DeepCollectionEquality().equals(other._userLevel, _userLevel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,user,address,const DeepCollectionEquality().hash(guildAreaActivity),const DeepCollectionEquality().hash(guildTypeActivity),const DeepCollectionEquality().hash(_killHouse),const DeepCollectionEquality().hash(_stewardKillHouse),const DeepCollectionEquality().hash(_stewards),getPosStatus,key,createDate,modifyDate,trash,active,cityNumber,cityName,guildsId,licenseNumber,guildsName,phone,typeActivity,areaActivity,provinceNumber,provinceName,steward,hasPos,allocationLimit,limitationAllocation,provinceAcceptState,stewardActive,stewardLimitationAllocation,license,wallet,const DeepCollectionEquality().hash(_cars),const DeepCollectionEquality().hash(_userLevel)]); + +@override +String toString() { + return 'StewardModel(id: $id, user: $user, address: $address, guildAreaActivity: $guildAreaActivity, guildTypeActivity: $guildTypeActivity, killHouse: $killHouse, stewardKillHouse: $stewardKillHouse, stewards: $stewards, getPosStatus: $getPosStatus, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, active: $active, cityNumber: $cityNumber, cityName: $cityName, guildsId: $guildsId, licenseNumber: $licenseNumber, guildsName: $guildsName, phone: $phone, typeActivity: $typeActivity, areaActivity: $areaActivity, provinceNumber: $provinceNumber, provinceName: $provinceName, steward: $steward, hasPos: $hasPos, allocationLimit: $allocationLimit, limitationAllocation: $limitationAllocation, provinceAcceptState: $provinceAcceptState, stewardActive: $stewardActive, stewardLimitationAllocation: $stewardLimitationAllocation, license: $license, wallet: $wallet, cars: $cars, userLevel: $userLevel)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardModelCopyWith<$Res> implements $StewardModelCopyWith<$Res> { + factory _$StewardModelCopyWith(_StewardModel value, $Res Function(_StewardModel) _then) = __$StewardModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, StewardUserModel? user, AddressModel? address, dynamic guildAreaActivity, dynamic guildTypeActivity, List? killHouse, List? stewardKillHouse, List? stewards, GetPosStatusModel? getPosStatus, String? key, String? createDate, String? modifyDate, bool? trash, bool? active, int? cityNumber, String? cityName, String? guildsId, String? licenseNumber, String? guildsName, String? phone, String? typeActivity, String? areaActivity, int? provinceNumber, String? provinceName, bool? steward, bool? hasPos, int? allocationLimit, bool? limitationAllocation, String? provinceAcceptState, bool? stewardActive, bool? stewardLimitationAllocation, bool? license, int? wallet, List? cars, List? userLevel +}); + + +@override $StewardUserModelCopyWith<$Res>? get user;@override $AddressModelCopyWith<$Res>? get address;@override $GetPosStatusModelCopyWith<$Res>? get getPosStatus; + +} +/// @nodoc +class __$StewardModelCopyWithImpl<$Res> + implements _$StewardModelCopyWith<$Res> { + __$StewardModelCopyWithImpl(this._self, this._then); + + final _StewardModel _self; + final $Res Function(_StewardModel) _then; + +/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? user = freezed,Object? address = freezed,Object? guildAreaActivity = freezed,Object? guildTypeActivity = freezed,Object? killHouse = freezed,Object? stewardKillHouse = freezed,Object? stewards = freezed,Object? getPosStatus = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? active = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? guildsId = freezed,Object? licenseNumber = freezed,Object? guildsName = freezed,Object? phone = freezed,Object? typeActivity = freezed,Object? areaActivity = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? steward = freezed,Object? hasPos = freezed,Object? allocationLimit = freezed,Object? limitationAllocation = freezed,Object? provinceAcceptState = freezed,Object? stewardActive = freezed,Object? stewardLimitationAllocation = freezed,Object? license = freezed,Object? wallet = freezed,Object? cars = freezed,Object? userLevel = freezed,}) { + return _then(_StewardModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as StewardUserModel?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as AddressModel?,guildAreaActivity: freezed == guildAreaActivity ? _self.guildAreaActivity : guildAreaActivity // ignore: cast_nullable_to_non_nullable +as dynamic,guildTypeActivity: freezed == guildTypeActivity ? _self.guildTypeActivity : guildTypeActivity // ignore: cast_nullable_to_non_nullable +as dynamic,killHouse: freezed == killHouse ? _self._killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as List?,stewardKillHouse: freezed == stewardKillHouse ? _self._stewardKillHouse : stewardKillHouse // ignore: cast_nullable_to_non_nullable +as List?,stewards: freezed == stewards ? _self._stewards : stewards // ignore: cast_nullable_to_non_nullable +as List?,getPosStatus: freezed == getPosStatus ? _self.getPosStatus : getPosStatus // ignore: cast_nullable_to_non_nullable +as GetPosStatusModel?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable +as bool?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,guildsId: freezed == guildsId ? _self.guildsId : guildsId // ignore: cast_nullable_to_non_nullable +as String?,licenseNumber: freezed == licenseNumber ? _self.licenseNumber : licenseNumber // ignore: cast_nullable_to_non_nullable +as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable +as String?,areaActivity: freezed == areaActivity ? _self.areaActivity : areaActivity // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable +as bool?,hasPos: freezed == hasPos ? _self.hasPos : hasPos // ignore: cast_nullable_to_non_nullable +as bool?,allocationLimit: freezed == allocationLimit ? _self.allocationLimit : allocationLimit // ignore: cast_nullable_to_non_nullable +as int?,limitationAllocation: freezed == limitationAllocation ? _self.limitationAllocation : limitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,provinceAcceptState: freezed == provinceAcceptState ? _self.provinceAcceptState : provinceAcceptState // ignore: cast_nullable_to_non_nullable +as String?,stewardActive: freezed == stewardActive ? _self.stewardActive : stewardActive // ignore: cast_nullable_to_non_nullable +as bool?,stewardLimitationAllocation: freezed == stewardLimitationAllocation ? _self.stewardLimitationAllocation : stewardLimitationAllocation // ignore: cast_nullable_to_non_nullable +as bool?,license: freezed == license ? _self.license : license // ignore: cast_nullable_to_non_nullable +as bool?,wallet: freezed == wallet ? _self.wallet : wallet // ignore: cast_nullable_to_non_nullable +as int?,cars: freezed == cars ? _self._cars : cars // ignore: cast_nullable_to_non_nullable +as List?,userLevel: freezed == userLevel ? _self._userLevel : userLevel // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StewardUserModelCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $StewardUserModelCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressModelCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressModelCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +}/// Create a copy of StewardModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetPosStatusModelCopyWith<$Res>? get getPosStatus { + if (_self.getPosStatus == null) { + return null; + } + + return $GetPosStatusModelCopyWith<$Res>(_self.getPosStatus!, (value) { + return _then(_self.copyWith(getPosStatus: value)); + }); +} +} + + +/// @nodoc +mixin _$StewardUserModel { + + String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get nationalId; String? get city; +/// Create a copy of StewardUserModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StewardUserModelCopyWith get copyWith => _$StewardUserModelCopyWithImpl(this as StewardUserModel, _$identity); + + /// Serializes this StewardUserModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardUserModel&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'StewardUserModel(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $StewardUserModelCopyWith<$Res> { + factory $StewardUserModelCopyWith(StewardUserModel value, $Res Function(StewardUserModel) _then) = _$StewardUserModelCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class _$StewardUserModelCopyWithImpl<$Res> + implements $StewardUserModelCopyWith<$Res> { + _$StewardUserModelCopyWithImpl(this._self, this._then); + + final StewardUserModel _self; + final $Res Function(StewardUserModel) _then; + +/// Create a copy of StewardUserModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [StewardUserModel]. +extension StewardUserModelPatterns on StewardUserModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StewardUserModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StewardUserModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StewardUserModel value) $default,){ +final _that = this; +switch (_that) { +case _StewardUserModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StewardUserModel value)? $default,){ +final _that = this; +switch (_that) { +case _StewardUserModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StewardUserModel() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city) $default,) {final _that = this; +switch (_that) { +case _StewardUserModel(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city)? $default,) {final _that = this; +switch (_that) { +case _StewardUserModel() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.nationalId,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _StewardUserModel implements StewardUserModel { + _StewardUserModel({this.fullname, this.firstName, this.lastName, this.mobile, this.nationalId, this.city}); + factory _StewardUserModel.fromJson(Map json) => _$StewardUserModelFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? nationalId; +@override final String? city; + +/// Create a copy of StewardUserModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StewardUserModelCopyWith<_StewardUserModel> get copyWith => __$StewardUserModelCopyWithImpl<_StewardUserModel>(this, _$identity); + +@override +Map toJson() { + return _$StewardUserModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardUserModel&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,nationalId,city); + +@override +String toString() { + return 'StewardUserModel(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, nationalId: $nationalId, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$StewardUserModelCopyWith<$Res> implements $StewardUserModelCopyWith<$Res> { + factory _$StewardUserModelCopyWith(_StewardUserModel value, $Res Function(_StewardUserModel) _then) = __$StewardUserModelCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? nationalId, String? city +}); + + + + +} +/// @nodoc +class __$StewardUserModelCopyWithImpl<$Res> + implements _$StewardUserModelCopyWith<$Res> { + __$StewardUserModelCopyWithImpl(this._self, this._then); + + final _StewardUserModel _self; + final $Res Function(_StewardUserModel) _then; + +/// Create a copy of StewardUserModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? nationalId = freezed,Object? city = freezed,}) { + return _then(_StewardUserModel( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$AddressModel { + + ProvinceModel? get province; CityModel? get city; String? get address; String? get postalCode; +/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressModelCopyWith get copyWith => _$AddressModelCopyWithImpl(this as AddressModel, _$identity); + + /// Serializes this AddressModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AddressModel&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'AddressModel(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $AddressModelCopyWith<$Res> { + factory $AddressModelCopyWith(AddressModel value, $Res Function(AddressModel) _then) = _$AddressModelCopyWithImpl; +@useResult +$Res call({ + ProvinceModel? province, CityModel? city, String? address, String? postalCode +}); + + +$ProvinceModelCopyWith<$Res>? get province;$CityModelCopyWith<$Res>? get city; + +} +/// @nodoc +class _$AddressModelCopyWithImpl<$Res> + implements $AddressModelCopyWith<$Res> { + _$AddressModelCopyWithImpl(this._self, this._then); + + final AddressModel _self; + final $Res Function(AddressModel) _then; + +/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as ProvinceModel?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as CityModel?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceModelCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceModelCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityModelCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityModelCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [AddressModel]. +extension AddressModelPatterns on AddressModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AddressModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AddressModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AddressModel value) $default,){ +final _that = this; +switch (_that) { +case _AddressModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AddressModel value)? $default,){ +final _that = this; +switch (_that) { +case _AddressModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ProvinceModel? province, CityModel? city, String? address, String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AddressModel() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ProvinceModel? province, CityModel? city, String? address, String? postalCode) $default,) {final _that = this; +switch (_that) { +case _AddressModel(): +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ProvinceModel? province, CityModel? city, String? address, String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _AddressModel() when $default != null: +return $default(_that.province,_that.city,_that.address,_that.postalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _AddressModel implements AddressModel { + _AddressModel({this.province, this.city, this.address, this.postalCode}); + factory _AddressModel.fromJson(Map json) => _$AddressModelFromJson(json); + +@override final ProvinceModel? province; +@override final CityModel? city; +@override final String? address; +@override final String? postalCode; + +/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressModelCopyWith<_AddressModel> get copyWith => __$AddressModelCopyWithImpl<_AddressModel>(this, _$identity); + +@override +Map toJson() { + return _$AddressModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddressModel&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,province,city,address,postalCode); + +@override +String toString() { + return 'AddressModel(province: $province, city: $city, address: $address, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$AddressModelCopyWith<$Res> implements $AddressModelCopyWith<$Res> { + factory _$AddressModelCopyWith(_AddressModel value, $Res Function(_AddressModel) _then) = __$AddressModelCopyWithImpl; +@override @useResult +$Res call({ + ProvinceModel? province, CityModel? city, String? address, String? postalCode +}); + + +@override $ProvinceModelCopyWith<$Res>? get province;@override $CityModelCopyWith<$Res>? get city; + +} +/// @nodoc +class __$AddressModelCopyWithImpl<$Res> + implements _$AddressModelCopyWith<$Res> { + __$AddressModelCopyWithImpl(this._self, this._then); + + final _AddressModel _self; + final $Res Function(_AddressModel) _then; + +/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? province = freezed,Object? city = freezed,Object? address = freezed,Object? postalCode = freezed,}) { + return _then(_AddressModel( +province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as ProvinceModel?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as CityModel?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ProvinceModelCopyWith<$Res>? get province { + if (_self.province == null) { + return null; + } + + return $ProvinceModelCopyWith<$Res>(_self.province!, (value) { + return _then(_self.copyWith(province: value)); + }); +}/// Create a copy of AddressModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityModelCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityModelCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$ProvinceModel { + + String? get key; String? get name; +/// Create a copy of ProvinceModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ProvinceModelCopyWith get copyWith => _$ProvinceModelCopyWithImpl(this as ProvinceModel, _$identity); + + /// Serializes this ProvinceModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ProvinceModel&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'ProvinceModel(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $ProvinceModelCopyWith<$Res> { + factory $ProvinceModelCopyWith(ProvinceModel value, $Res Function(ProvinceModel) _then) = _$ProvinceModelCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$ProvinceModelCopyWithImpl<$Res> + implements $ProvinceModelCopyWith<$Res> { + _$ProvinceModelCopyWithImpl(this._self, this._then); + + final ProvinceModel _self; + final $Res Function(ProvinceModel) _then; + +/// Create a copy of ProvinceModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ProvinceModel]. +extension ProvinceModelPatterns on ProvinceModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ProvinceModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ProvinceModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ProvinceModel value) $default,){ +final _that = this; +switch (_that) { +case _ProvinceModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ProvinceModel value)? $default,){ +final _that = this; +switch (_that) { +case _ProvinceModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ProvinceModel() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _ProvinceModel(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _ProvinceModel() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ProvinceModel implements ProvinceModel { + _ProvinceModel({this.key, this.name}); + factory _ProvinceModel.fromJson(Map json) => _$ProvinceModelFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of ProvinceModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ProvinceModelCopyWith<_ProvinceModel> get copyWith => __$ProvinceModelCopyWithImpl<_ProvinceModel>(this, _$identity); + +@override +Map toJson() { + return _$ProvinceModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProvinceModel&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'ProvinceModel(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$ProvinceModelCopyWith<$Res> implements $ProvinceModelCopyWith<$Res> { + factory _$ProvinceModelCopyWith(_ProvinceModel value, $Res Function(_ProvinceModel) _then) = __$ProvinceModelCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$ProvinceModelCopyWithImpl<$Res> + implements _$ProvinceModelCopyWith<$Res> { + __$ProvinceModelCopyWithImpl(this._self, this._then); + + final _ProvinceModel _self; + final $Res Function(_ProvinceModel) _then; + +/// Create a copy of ProvinceModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_ProvinceModel( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$CityModel { + + String? get key; String? get name; +/// Create a copy of CityModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityModelCopyWith get copyWith => _$CityModelCopyWithImpl(this as CityModel, _$identity); + + /// Serializes this CityModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CityModel&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'CityModel(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $CityModelCopyWith<$Res> { + factory $CityModelCopyWith(CityModel value, $Res Function(CityModel) _then) = _$CityModelCopyWithImpl; +@useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class _$CityModelCopyWithImpl<$Res> + implements $CityModelCopyWith<$Res> { + _$CityModelCopyWithImpl(this._self, this._then); + + final CityModel _self; + final $Res Function(CityModel) _then; + +/// Create a copy of CityModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CityModel]. +extension CityModelPatterns on CityModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CityModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CityModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CityModel value) $default,){ +final _that = this; +switch (_that) { +case _CityModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CityModel value)? $default,){ +final _that = this; +switch (_that) { +case _CityModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CityModel() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String? name) $default,) {final _that = this; +switch (_that) { +case _CityModel(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String? name)? $default,) {final _that = this; +switch (_that) { +case _CityModel() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CityModel implements CityModel { + _CityModel({this.key, this.name}); + factory _CityModel.fromJson(Map json) => _$CityModelFromJson(json); + +@override final String? key; +@override final String? name; + +/// Create a copy of CityModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CityModelCopyWith<_CityModel> get copyWith => __$CityModelCopyWithImpl<_CityModel>(this, _$identity); + +@override +Map toJson() { + return _$CityModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CityModel&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'CityModel(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$CityModelCopyWith<$Res> implements $CityModelCopyWith<$Res> { + factory _$CityModelCopyWith(_CityModel value, $Res Function(_CityModel) _then) = __$CityModelCopyWithImpl; +@override @useResult +$Res call({ + String? key, String? name +}); + + + + +} +/// @nodoc +class __$CityModelCopyWithImpl<$Res> + implements _$CityModelCopyWith<$Res> { + __$CityModelCopyWithImpl(this._self, this._then); + + final _CityModel _self; + final $Res Function(_CityModel) _then; + +/// Create a copy of CityModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = freezed,}) { + return _then(_CityModel( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$GetPosStatusModel { + + int? get lenActiveSessions; bool? get hasPons; bool? get hasActivePons; +/// Create a copy of GetPosStatusModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GetPosStatusModelCopyWith get copyWith => _$GetPosStatusModelCopyWithImpl(this as GetPosStatusModel, _$identity); + + /// Serializes this GetPosStatusModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetPosStatusModel&&(identical(other.lenActiveSessions, lenActiveSessions) || other.lenActiveSessions == lenActiveSessions)&&(identical(other.hasPons, hasPons) || other.hasPons == hasPons)&&(identical(other.hasActivePons, hasActivePons) || other.hasActivePons == hasActivePons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lenActiveSessions,hasPons,hasActivePons); + +@override +String toString() { + return 'GetPosStatusModel(lenActiveSessions: $lenActiveSessions, hasPons: $hasPons, hasActivePons: $hasActivePons)'; +} + + +} + +/// @nodoc +abstract mixin class $GetPosStatusModelCopyWith<$Res> { + factory $GetPosStatusModelCopyWith(GetPosStatusModel value, $Res Function(GetPosStatusModel) _then) = _$GetPosStatusModelCopyWithImpl; +@useResult +$Res call({ + int? lenActiveSessions, bool? hasPons, bool? hasActivePons +}); + + + + +} +/// @nodoc +class _$GetPosStatusModelCopyWithImpl<$Res> + implements $GetPosStatusModelCopyWith<$Res> { + _$GetPosStatusModelCopyWithImpl(this._self, this._then); + + final GetPosStatusModel _self; + final $Res Function(GetPosStatusModel) _then; + +/// Create a copy of GetPosStatusModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? lenActiveSessions = freezed,Object? hasPons = freezed,Object? hasActivePons = freezed,}) { + return _then(_self.copyWith( +lenActiveSessions: freezed == lenActiveSessions ? _self.lenActiveSessions : lenActiveSessions // ignore: cast_nullable_to_non_nullable +as int?,hasPons: freezed == hasPons ? _self.hasPons : hasPons // ignore: cast_nullable_to_non_nullable +as bool?,hasActivePons: freezed == hasActivePons ? _self.hasActivePons : hasActivePons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GetPosStatusModel]. +extension GetPosStatusModelPatterns on GetPosStatusModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GetPosStatusModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GetPosStatusModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GetPosStatusModel value) $default,){ +final _that = this; +switch (_that) { +case _GetPosStatusModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GetPosStatusModel value)? $default,){ +final _that = this; +switch (_that) { +case _GetPosStatusModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GetPosStatusModel() when $default != null: +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons) $default,) {final _that = this; +switch (_that) { +case _GetPosStatusModel(): +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? lenActiveSessions, bool? hasPons, bool? hasActivePons)? $default,) {final _that = this; +switch (_that) { +case _GetPosStatusModel() when $default != null: +return $default(_that.lenActiveSessions,_that.hasPons,_that.hasActivePons);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GetPosStatusModel implements GetPosStatusModel { + _GetPosStatusModel({this.lenActiveSessions, this.hasPons, this.hasActivePons}); + factory _GetPosStatusModel.fromJson(Map json) => _$GetPosStatusModelFromJson(json); + +@override final int? lenActiveSessions; +@override final bool? hasPons; +@override final bool? hasActivePons; + +/// Create a copy of GetPosStatusModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GetPosStatusModelCopyWith<_GetPosStatusModel> get copyWith => __$GetPosStatusModelCopyWithImpl<_GetPosStatusModel>(this, _$identity); + +@override +Map toJson() { + return _$GetPosStatusModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetPosStatusModel&&(identical(other.lenActiveSessions, lenActiveSessions) || other.lenActiveSessions == lenActiveSessions)&&(identical(other.hasPons, hasPons) || other.hasPons == hasPons)&&(identical(other.hasActivePons, hasActivePons) || other.hasActivePons == hasActivePons)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lenActiveSessions,hasPons,hasActivePons); + +@override +String toString() { + return 'GetPosStatusModel(lenActiveSessions: $lenActiveSessions, hasPons: $hasPons, hasActivePons: $hasActivePons)'; +} + + +} + +/// @nodoc +abstract mixin class _$GetPosStatusModelCopyWith<$Res> implements $GetPosStatusModelCopyWith<$Res> { + factory _$GetPosStatusModelCopyWith(_GetPosStatusModel value, $Res Function(_GetPosStatusModel) _then) = __$GetPosStatusModelCopyWithImpl; +@override @useResult +$Res call({ + int? lenActiveSessions, bool? hasPons, bool? hasActivePons +}); + + + + +} +/// @nodoc +class __$GetPosStatusModelCopyWithImpl<$Res> + implements _$GetPosStatusModelCopyWith<$Res> { + __$GetPosStatusModelCopyWithImpl(this._self, this._then); + + final _GetPosStatusModel _self; + final $Res Function(_GetPosStatusModel) _then; + +/// Create a copy of GetPosStatusModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? lenActiveSessions = freezed,Object? hasPons = freezed,Object? hasActivePons = freezed,}) { + return _then(_GetPosStatusModel( +lenActiveSessions: freezed == lenActiveSessions ? _self.lenActiveSessions : lenActiveSessions // ignore: cast_nullable_to_non_nullable +as int?,hasPons: freezed == hasPons ? _self.hasPons : hasPons // ignore: cast_nullable_to_non_nullable +as bool?,hasActivePons: freezed == hasActivePons ? _self.hasActivePons : hasActivePons // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.g.dart b/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.g.dart new file mode 100644 index 0000000..a8dc384 --- /dev/null +++ b/packages/chicken/lib/data/models/response/waiting_arrival/waiting_arrival.g.dart @@ -0,0 +1,302 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'waiting_arrival.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_WaitingArrivalModel _$WaitingArrivalModelFromJson( + Map json, +) => _WaitingArrivalModel( + id: (json['id'] as num?)?.toInt(), + product: json['product'] == null + ? null + : ProductModel.fromJson(json['product'] as Map), + killHouse: json['kill_house'], + toKillHouse: json['to_kill_house'], + steward: json['steward'] == null + ? null + : StewardModel.fromJson(json['steward'] as Map), + toSteward: json['to_steward'] == null + ? null + : StewardModel.fromJson(json['to_steward'] as Map), + guilds: json['guilds'], + toGuilds: json['to_guilds'], + toColdHouse: json['to_cold_house'], + indexWeight: (json['index_weight'] as num?)?.toInt(), + dateTimestamp: (json['date_timestamp'] as num?)?.toInt(), + newState: (json['new_state'] as num?)?.toInt(), + newReceiverState: (json['new_receiver_state'] as num?)?.toInt(), + newAllocationState: (json['new_allocation_state'] as num?)?.toInt(), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(), + realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(), + receiverRealNumberOfCarcasses: + (json['receiver_real_number_of_carcasses'] as num?)?.toInt(), + weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(), + realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(), + receiverRealWeightOfCarcasses: + (json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(), + weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(), + finalRegistration: json['final_registration'] as bool?, + sellType: json['sell_type'] as String?, + productName: json['product_name'] as String?, + sellerType: json['seller_type'] as String?, + type: json['type'] as String?, + saleType: json['sale_type'] as String?, + allocationType: json['allocation_type'] as String?, + systemRegistrationCode: json['system_registration_code'] as bool?, + registrationCode: (json['registration_code'] as num?)?.toInt(), + amount: (json['amount'] as num?)?.toInt(), + totalAmount: (json['total_amount'] as num?)?.toInt(), + totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(), + totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(), + loggedRegistrationCode: json['logged_registration_code'], + state: json['state'] as String?, + receiverState: json['receiver_state'] as String?, + allocationState: json['allocation_state'] as String?, + date: json['date'] as String?, + role: json['role'], + stewardTempKey: json['steward_temp_key'], + approvedPriceStatus: json['approved_price_status'] as bool?, + calculateStatus: json['calculate_status'] as bool?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + overhead: json['overhead'] as bool?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + wareHouse: json['ware_house'], + stewardWareHouse: json['steward_ware_house'], + car: json['car'], + dispenser: json['dispenser'], +); + +Map _$WaitingArrivalModelToJson( + _WaitingArrivalModel instance, +) => { + 'id': instance.id, + 'product': instance.product, + 'kill_house': instance.killHouse, + 'to_kill_house': instance.toKillHouse, + 'steward': instance.steward, + 'to_steward': instance.toSteward, + 'guilds': instance.guilds, + 'to_guilds': instance.toGuilds, + 'to_cold_house': instance.toColdHouse, + 'index_weight': instance.indexWeight, + 'date_timestamp': instance.dateTimestamp, + 'new_state': instance.newState, + 'new_receiver_state': instance.newReceiverState, + 'new_allocation_state': instance.newAllocationState, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'number_of_carcasses': instance.numberOfCarcasses, + 'real_number_of_carcasses': instance.realNumberOfCarcasses, + 'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses, + 'weight_of_carcasses': instance.weightOfCarcasses, + 'real_weight_of_carcasses': instance.realWeightOfCarcasses, + 'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses, + 'weight_loss_of_carcasses': instance.weightLossOfCarcasses, + 'final_registration': instance.finalRegistration, + 'sell_type': instance.sellType, + 'product_name': instance.productName, + 'seller_type': instance.sellerType, + 'type': instance.type, + 'sale_type': instance.saleType, + 'allocation_type': instance.allocationType, + 'system_registration_code': instance.systemRegistrationCode, + 'registration_code': instance.registrationCode, + 'amount': instance.amount, + 'total_amount': instance.totalAmount, + 'total_amount_paid': instance.totalAmountPaid, + 'total_amount_remain': instance.totalAmountRemain, + 'logged_registration_code': instance.loggedRegistrationCode, + 'state': instance.state, + 'receiver_state': instance.receiverState, + 'allocation_state': instance.allocationState, + 'date': instance.date, + 'role': instance.role, + 'steward_temp_key': instance.stewardTempKey, + 'approved_price_status': instance.approvedPriceStatus, + 'calculate_status': instance.calculateStatus, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'overhead': instance.overhead, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'ware_house': instance.wareHouse, + 'steward_ware_house': instance.stewardWareHouse, + 'car': instance.car, + 'dispenser': instance.dispenser, +}; + +_ProductModel _$ProductModelFromJson(Map json) => + _ProductModel( + name: json['name'] as String?, + weightAverage: (json['weight_average'] as num?)?.toDouble(), + ); + +Map _$ProductModelToJson(_ProductModel instance) => + { + 'name': instance.name, + 'weight_average': instance.weightAverage, + }; + +_StewardModel _$StewardModelFromJson(Map json) => + _StewardModel( + id: (json['id'] as num?)?.toInt(), + user: json['user'] == null + ? null + : StewardUserModel.fromJson(json['user'] as Map), + address: json['address'] == null + ? null + : AddressModel.fromJson(json['address'] as Map), + guildAreaActivity: json['guild_area_activity'], + guildTypeActivity: json['guild_type_activity'], + killHouse: json['kill_house'] as List?, + stewardKillHouse: json['steward_kill_house'] as List?, + stewards: json['stewards'] as List?, + getPosStatus: json['get_pos_status'] == null + ? null + : GetPosStatusModel.fromJson( + json['get_pos_status'] as Map, + ), + key: json['key'] as String?, + createDate: json['create_date'] as String?, + modifyDate: json['modify_date'] as String?, + trash: json['trash'] as bool?, + active: json['active'] as bool?, + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + guildsId: json['guilds_id'] as String?, + licenseNumber: json['license_number'] as String?, + guildsName: json['guilds_name'] as String?, + phone: json['phone'] as String?, + typeActivity: json['type_activity'] as String?, + areaActivity: json['area_activity'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + steward: json['steward'] as bool?, + hasPos: json['has_pos'] as bool?, + allocationLimit: (json['allocation_limit'] as num?)?.toInt(), + limitationAllocation: json['limitation_allocation'] as bool?, + provinceAcceptState: json['province_accept_state'] as String?, + stewardActive: json['steward_active'] as bool?, + stewardLimitationAllocation: + json['steward_limitation_allocation'] as bool?, + license: json['license'] as bool?, + wallet: (json['wallet'] as num?)?.toInt(), + cars: json['cars'] as List?, + userLevel: json['user_level'] as List?, + ); + +Map _$StewardModelToJson(_StewardModel instance) => + { + 'id': instance.id, + 'user': instance.user, + 'address': instance.address, + 'guild_area_activity': instance.guildAreaActivity, + 'guild_type_activity': instance.guildTypeActivity, + 'kill_house': instance.killHouse, + 'steward_kill_house': instance.stewardKillHouse, + 'stewards': instance.stewards, + 'get_pos_status': instance.getPosStatus, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'active': instance.active, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'guilds_id': instance.guildsId, + 'license_number': instance.licenseNumber, + 'guilds_name': instance.guildsName, + 'phone': instance.phone, + 'type_activity': instance.typeActivity, + 'area_activity': instance.areaActivity, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'steward': instance.steward, + 'has_pos': instance.hasPos, + 'allocation_limit': instance.allocationLimit, + 'limitation_allocation': instance.limitationAllocation, + 'province_accept_state': instance.provinceAcceptState, + 'steward_active': instance.stewardActive, + 'steward_limitation_allocation': instance.stewardLimitationAllocation, + 'license': instance.license, + 'wallet': instance.wallet, + 'cars': instance.cars, + 'user_level': instance.userLevel, + }; + +_StewardUserModel _$StewardUserModelFromJson(Map json) => + _StewardUserModel( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + nationalId: json['national_id'] as String?, + city: json['city'] as String?, + ); + +Map _$StewardUserModelToJson(_StewardUserModel instance) => + { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'national_id': instance.nationalId, + 'city': instance.city, + }; + +_AddressModel _$AddressModelFromJson(Map json) => + _AddressModel( + province: json['province'] == null + ? null + : ProvinceModel.fromJson(json['province'] as Map), + city: json['city'] == null + ? null + : CityModel.fromJson(json['city'] as Map), + address: json['address'] as String?, + postalCode: json['postal_code'] as String?, + ); + +Map _$AddressModelToJson(_AddressModel instance) => + { + 'province': instance.province, + 'city': instance.city, + 'address': instance.address, + 'postal_code': instance.postalCode, + }; + +_ProvinceModel _$ProvinceModelFromJson(Map json) => + _ProvinceModel(key: json['key'] as String?, name: json['name'] as String?); + +Map _$ProvinceModelToJson(_ProvinceModel instance) => + {'key': instance.key, 'name': instance.name}; + +_CityModel _$CityModelFromJson(Map json) => + _CityModel(key: json['key'] as String?, name: json['name'] as String?); + +Map _$CityModelToJson(_CityModel instance) => + {'key': instance.key, 'name': instance.name}; + +_GetPosStatusModel _$GetPosStatusModelFromJson(Map json) => + _GetPosStatusModel( + lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(), + hasPons: json['has_pons'] as bool?, + hasActivePons: json['has_active_pons'] as bool?, + ); + +Map _$GetPosStatusModelToJson(_GetPosStatusModel instance) => + { + 'len_active_sessions': instance.lenActiveSessions, + 'has_pons': instance.hasPons, + 'has_active_pons': instance.hasActivePons, + }; diff --git a/packages/chicken/lib/data/repositories/auth/auth_repository.dart b/packages/chicken/lib/data/repositories/auth/auth_repository.dart new file mode 100644 index 0000000..c7914c5 --- /dev/null +++ b/packages/chicken/lib/data/repositories/auth/auth_repository.dart @@ -0,0 +1,12 @@ +import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; + +abstract class AuthRepository { + Future login({required Map authRequest}); + + Future logout(); + + Future hasAuthenticated(); + + Future getUserInfo(String phoneNumber); +} diff --git a/packages/chicken/lib/data/repositories/auth/auth_repository_imp.dart b/packages/chicken/lib/data/repositories/auth/auth_repository_imp.dart new file mode 100644 index 0000000..1b84d61 --- /dev/null +++ b/packages/chicken/lib/data/repositories/auth/auth_repository_imp.dart @@ -0,0 +1,25 @@ +import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart'; +import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; + +import 'auth_repository.dart'; + +class AuthRepositoryImpl implements AuthRepository { + final AuthRemoteDataSource authRemote; + + AuthRepositoryImpl(this.authRemote); + + @override + Future login({required Map authRequest}) async => + await authRemote.login(authRequest: authRequest); + + @override + Future logout() async => await authRemote.logout(); + + @override + Future hasAuthenticated() async => await authRemote.hasAuthenticated(); + + @override + Future getUserInfo(String phoneNumber) async => + await authRemote.getUserInfo(phoneNumber); +} diff --git a/packages/chicken/lib/data/repositories/chicken/chicken_repository.dart b/packages/chicken/lib/data/repositories/chicken/chicken_repository.dart new file mode 100644 index 0000000..62b4404 --- /dev/null +++ b/packages/chicken/lib/data/repositories/chicken/chicken_repository.dart @@ -0,0 +1,166 @@ +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; +import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart'; +import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart'; +import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart'; +import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; +import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; +import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' + hide ProductModel; +import 'package:rasadyar_core/core.dart'; + +import '../../models/request/create_steward_free_bar/create_steward_free_bar.dart'; + +abstract class ChickenRepository { + //region Remote + Future?> getInventory({required String token, CancelToken? cancelToken}); + + Future getKillHouseDistributionInfo({required String token}); + + Future getGeneralBarInformation({ + required String token, + Map? queryParameters, + }); + + Future?> getWaitingArrivals({ + required String token, + Map? queryParameters, + }); + + Future setSateForArrivals({required String token, required Map request}); + + Future?> getImportedLoadsModel({ + required String token, + Map? queryParameters, + }); + + Future?> getAllocatedMade({ + required String token, + Map? queryParameters, + }); + + Future confirmAllocation({required String token, required Map allocation}); + + Future denyAllocation({required String token, required String allocationToken}); + + Future confirmAllAllocation({ + required String token, + required List allocationTokens, + }); + + Future?> getRolesProducts({required String token}); + + Future?> getGuilds({ + required String token, + Map? queryParameters, + }); + + Future getProfile({required String token}); + + Future postSubmitStewardAllocation({ + required String token, + required SubmitStewardAllocation request, + }); + + Future deleteStewardAllocation({ + required String token, + Map? queryParameters, + }); + + Future updateStewardAllocation({required String token, required ConformAllocation request}); + + Future getStewardDashboard({ + required String token, + required String stratDate, + required String endDate, + }); + + Future getDashboardKillHouseFreeBar({ + required String token, + required String stratDate, + required String endDate, + }); + + Future?> getStewardPurchasesOutSideOfTheProvince({ + required String token, + Map? queryParameters, + }); + + Future createStewardPurchasesOutSideOfTheProvince({ + required String token, + required CreateStewardFreeBar body, + }); + + Future deleteStewardPurchasesOutSideOfTheProvince({ + required String token, + required String stewardFreeBarKey, + }); + + Future?> getOutProvinceCarcassesBuyer({ + required String token, + Map? queryParameters, + }); + + Future createOutProvinceCarcassesBuyer({ + required String token, + required OutProvinceCarcassesBuyer body, + }); + + Future?> getProvince({CancelToken? cancelToken}); + + Future?> getCity({required String provinceName}); + + Future?> getStewardFreeSaleBar({ + required String token, + Map? queryParameters, + }); + + Future createOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }); + + Future updateOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }); + + Future getUserProfile({required String token}); + + Future updateUserProfile({required String token, required UserProfile userProfile}); + + Future updatePassword({required String token, required ChangePasswordRequestModel model}); + + Future?> getSegmentation({ + required String token, + Map? queryParameters, + }); + + Future createSegmentation({required String token, required SegmentationModel model}); + + Future editSegmentation({required String token, required SegmentationModel model}); + + Future deleteSegmentation({required String token, required String key}); + + //endregion + + //region local + Future initWidleyUsed(); + + WidelyUsedLocalModel? getAllWidely(); + //endregion +} diff --git a/packages/chicken/lib/data/repositories/chicken/chicken_repository_imp.dart b/packages/chicken/lib/data/repositories/chicken/chicken_repository_imp.dart new file mode 100644 index 0000000..d9d829e --- /dev/null +++ b/packages/chicken/lib/data/repositories/chicken/chicken_repository_imp.dart @@ -0,0 +1,335 @@ +import 'package:rasadyar_chicken/data/data_source/local/chicken_local_imp.dart'; +import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote_imp.dart'; +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; +import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart'; +import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart'; +import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart'; +import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; +import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; +import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' + hide ProductModel; +import 'package:rasadyar_core/core.dart'; + +import 'chicken_repository.dart'; + +class ChickenRepositoryImp implements ChickenRepository { + final ChickenRemoteDatasourceImp remote; + final ChickenLocalDataSourceImp local; + + ChickenRepositoryImp({required this.remote, required this.local}); + + //region Remote + @override + Future?> getInventory({ + required String token, + CancelToken? cancelToken, + }) async { + var res = await remote.getInventory(token: token, cancelToken: cancelToken); + return res; + } + + @override + Future getKillHouseDistributionInfo({required String token}) async { + var res = await remote.getKillHouseDistributionInfo(token: token); + return res; + } + + @override + Future getGeneralBarInformation({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getGeneralBarInformation(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future?> getWaitingArrivals({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getWaitingArrivals(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future setSateForArrivals({ + required String token, + required Map request, + }) async { + await remote.setSateForArrivals(token: token, request: request); + } + + @override + Future?> getImportedLoadsModel({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getImportedLoadsModel(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future?> getAllocatedMade({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getAllocatedMade(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future confirmAllocation({ + required String token, + required Map allocation, + }) async { + await remote.confirmAllocation(token: token, allocation: allocation); + } + + @override + Future denyAllocation({required String token, required String allocationToken}) async { + await remote.denyAllocation(token: token, allocationToken: allocationToken); + } + + @override + Future confirmAllAllocation({ + required String token, + required List allocationTokens, + }) async { + await remote.confirmAllAllocation(token: token, allocationTokens: allocationTokens); + } + + @override + Future?> getRolesProducts({required String token}) async { + var res = await remote.getRolesProducts(token: token); + return res; + } + + @override + Future?> getGuilds({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getGuilds(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future getProfile({required String token}) async { + var res = await remote.getProfile(token: token); + return res; + } + + @override + Future postSubmitStewardAllocation({ + required String token, + required SubmitStewardAllocation request, + }) async { + await remote.postSubmitStewardAllocation(token: token, request: request); + } + + @override + Future deleteStewardAllocation({ + required String token, + Map? queryParameters, + }) async { + await remote.deleteStewardAllocation(token: token, queryParameters: queryParameters); + } + + @override + Future updateStewardAllocation({ + required String token, + required ConformAllocation request, + }) async { + await remote.updateStewardAllocation(token: token, request: request); + } + + @override + Future getStewardDashboard({ + required String token, + required String stratDate, + required String endDate, + }) async { + var res = await remote.getStewardDashboard( + token: token, + stratDate: stratDate, + endDate: endDate, + ); + return res; + } + + @override + Future getDashboardKillHouseFreeBar({ + required String token, + required String stratDate, + required String endDate, + }) async { + var res = await remote.getDashboardKillHouseFreeBar( + token: token, + stratDate: stratDate, + endDate: endDate, + ); + return res; + } + + @override + Future?> getStewardPurchasesOutSideOfTheProvince({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getStewardPurchasesOutSideOfTheProvince( + token: token, + queryParameters: queryParameters, + ); + return res; + } + + @override + Future?> getCity({required String provinceName}) async { + var res = await remote.getCity(provinceName: provinceName); + return res; + } + + @override + Future?> getProvince({CancelToken? cancelToken}) async { + var res = await remote.getProvince(cancelToken: cancelToken); + return res; + } + + @override + Future createStewardPurchasesOutSideOfTheProvince({ + required String token, + required CreateStewardFreeBar body, + }) async { + await remote.createStewardPurchasesOutSideOfTheProvince(token: token, body: body); + } + + @override + Future deleteStewardPurchasesOutSideOfTheProvince({ + required String token, + required String stewardFreeBarKey, + }) async { + await remote.deleteStewardPurchasesOutSideOfTheProvince( + token: token, + stewardFreeBarKey: stewardFreeBarKey, + ); + } + + @override + Future?> getOutProvinceCarcassesBuyer({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getOutProvinceCarcassesBuyer( + token: token, + queryParameters: queryParameters, + ); + return res; + } + + @override + Future createOutProvinceCarcassesBuyer({ + required String token, + required OutProvinceCarcassesBuyer body, + }) async { + await remote.createOutProvinceCarcassesBuyer(token: token, body: body); + } + + @override + Future?> getStewardFreeSaleBar({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getStewardFreeSaleBar(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future createOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }) async { + await remote.createOutProvinceStewardFreeBar(token: token, body: body); + } + + @override + Future updateOutProvinceStewardFreeBar({ + required String token, + required StewardFreeSaleBarRequest body, + }) async { + await remote.updateOutProvinceStewardFreeBar(token: token, body: body); + } + + @override + Future getUserProfile({required String token}) async { + var res = await remote.getUserProfile(token: token); + return res; + } + + @override + Future updateUserProfile({required String token, required UserProfile userProfile}) async { + await remote.updateUserProfile(token: token, userProfile: userProfile); + } + + @override + Future updatePassword({ + required String token, + required ChangePasswordRequestModel model, + }) async { + await remote.updatePassword(token: token, model: model); + } + + @override + Future?> getSegmentation({ + required String token, + Map? queryParameters, + }) async { + var res = await remote.getSegmentation(token: token, queryParameters: queryParameters); + return res; + } + + @override + Future createSegmentation({required String token, required SegmentationModel model}) async { + await remote.createSegmentation(token: token, model: model); + } + + @override + Future editSegmentation({required String token, required SegmentationModel model}) async { + await remote.editSegmentation(token: token, model: model); + } + + @override + Future deleteSegmentation({ + required String token, + required String key, + }) async { + var res = await remote.deleteSegmentation(token: token, key: key); + return res; + } + + //endregion + + //region local + @override + WidelyUsedLocalModel? getAllWidely() => local.getAllWidely(); + + @override + Future initWidleyUsed() async => local.initWidleyUsed(); + //endregion +} diff --git a/packages/chicken/lib/hive_registrar.g.dart b/packages/chicken/lib/hive_registrar.g.dart new file mode 100644 index 0000000..25d0c02 --- /dev/null +++ b/packages/chicken/lib/hive_registrar.g.dart @@ -0,0 +1,20 @@ +// Generated by Hive CE +// Do not modify +// Check in to version control + +import 'package:hive_ce/hive.dart'; +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; + +extension HiveRegistrar on HiveInterface { + void registerAdapters() { + registerAdapter(WidelyUsedLocalItemAdapter()); + registerAdapter(WidelyUsedLocalModelAdapter()); + } +} + +extension IsolatedHiveRegistrar on IsolatedHiveInterface { + void registerAdapters() { + registerAdapter(WidelyUsedLocalItemAdapter()); + registerAdapter(WidelyUsedLocalModelAdapter()); + } +} diff --git a/packages/chicken/lib/presentation/pages/auth/logic.dart b/packages/chicken/lib/presentation/pages/auth/logic.dart new file mode 100644 index 0000000..bec91ab --- /dev/null +++ b/packages/chicken/lib/presentation/pages/auth/logic.dart @@ -0,0 +1,165 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/common/dio_error_handler.dart'; +import 'package:rasadyar_chicken/data/di/chicken_di.dart'; +import 'package:rasadyar_chicken/data/models/request/login_request/login_request_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; +import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart'; +import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +enum AuthType { useAndPass, otp } + +enum AuthStatus { init } + +enum OtpStatus { init, sent, verified, reSend } + +class AuthLogic extends GetxController with GetTickerProviderStateMixin { + GlobalKey formKey = GlobalKey(); + + late AnimationController _textAnimationController; + late Animation textAnimation; + RxBool showCard = false.obs; + + Rx> formKeyOtp = GlobalKey().obs; + Rx> formKeySentOtp = GlobalKey().obs; + Rx usernameController = TextEditingController().obs; + Rx passwordController = TextEditingController().obs; + Rx phoneOtpNumberController = TextEditingController().obs; + Rx otpCodeController = TextEditingController().obs; + + var captchaController = Get.find(); + + RxnString phoneNumber = RxnString(null); + RxBool isLoading = false.obs; + RxBool isDisabled = true.obs; + TokenStorageService tokenStorageService = Get.find(); + + Rx authType = AuthType.useAndPass.obs; + Rx authStatus = AuthStatus.init.obs; + Rx otpStatus = OtpStatus.init.obs; + + RxInt secondsRemaining = 120.obs; + Timer? _timer; + + AuthRepositoryImpl authRepository = diChicken.get(); + + final Module _module = Get.arguments; + + @override + void onInit() { + super.onInit(); + + _textAnimationController = + AnimationController(vsync: this, duration: const Duration(milliseconds: 1200)) + ..repeat(reverse: true, count: 2).whenComplete(() { + showCard.value = true; + }); + + textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut); + } + + @override + void onReady() { + super.onReady(); + + } + + @override + void onClose() { + _timer?.cancel(); + super.onClose(); + } + + void startTimer() { + _timer?.cancel(); + secondsRemaining.value = 120; + + _timer = Timer.periodic(const Duration(seconds: 1), (timer) { + if (secondsRemaining.value > 0) { + secondsRemaining.value--; + } else { + timer.cancel(); + } + }); + } + + void stopTimer() { + _timer?.cancel(); + } + + String get timeFormatted { + final minutes = secondsRemaining.value ~/ 60; + final seconds = secondsRemaining.value % 60; + return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}'; + } + + bool _isFormValid() { + final isCaptchaValid = captchaController.formKey.currentState?.validate() ?? false; + final isFormValid = formKey.currentState?.validate() ?? false; + return isCaptchaValid && isFormValid; + } + + LoginRequestModel _buildLoginRequest() { + final phone = usernameController.value.text; + final pass = passwordController.value.text; + final code = captchaController.textController.value.text; + final key = captchaController.captchaKey.value; + + return LoginRequestModel.createWithCaptcha( + username: phone, + password: pass, + captchaCode: code, + captchaKey: key!, + ); + } + + Future submitLoginForm() async { + if (!_isFormValid()) return; + AuthRepositoryImpl authTmp = diChicken.get(instanceName: 'newUrl'); + isLoading.value = true; + await safeCall( + call: () => authTmp.login( + authRequest: { + "username": usernameController.value.text, + "password": passwordController.value.text, + }, + ), + onSuccess: (result) async { + await tokenStorageService.saveModule(_module); + await tokenStorageService.saveAccessToken(result?.accessToken ?? ''); + await tokenStorageService.saveRefreshToken(result?.accessToken ?? ''); + }, + onError: (error, stackTrace) { + if (error is DioException) { + diChicken.get().handle(error); + } + captchaController.getCaptcha(); + }, + ); + isLoading.value = false; + } + + Future getUserInfo(String value) async { + isLoading.value = true; + await safeCall( + call: () async => await authRepository.getUserInfo(value), + onSuccess: (result) async { + if (result != null) { + await newSetupAuthDI(result.backend ?? ''); + await tokenStorageService.saveApiKey(result.apiKey ?? ''); + await tokenStorageService.saveBaseUrl(result.backend ?? ''); + } + }, + onError: (error, stackTrace) { + if (error is DioException) { + diChicken.get().handle(error); + } + captchaController.getCaptcha(); + }, + ); + isLoading.value = false; + } +} diff --git a/packages/chicken/lib/presentation/pages/auth/view.dart b/packages/chicken/lib/presentation/pages/auth/view.dart new file mode 100644 index 0000000..1700994 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/auth/view.dart @@ -0,0 +1,543 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/widget/captcha/view.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class AuthPage extends GetView { + const AuthPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + alignment: Alignment.center, + + children: [ + Assets.vec.bgAuthSvg.svg(fit: BoxFit.fill), + + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.r), + child: FadeTransition( + opacity: controller.textAnimation, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'به سامانه رصدیار خوش آمدید!', + textAlign: TextAlign.right, + style: AppFonts.yekan25Bold.copyWith(color: Colors.white), + ), + Text( + 'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), + ), + ), + + Obx(() { + final screenHeight = MediaQuery.of(context).size.height; + final targetTop = (screenHeight - 676) / 2; + + return AnimatedPositioned( + duration: const Duration(milliseconds: 1200), + curve: Curves.linear, + top: controller.showCard.value ? targetTop : screenHeight, + left: 10.r, + right: 10.r, + child: Container( + width: 381.w, + height: 676.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(40), + ), + child: Column( + children: [ + SizedBox(height: 50.h), + LogoWidget(), + SizedBox(height: 20.h), + useAndPassFrom(), + SizedBox(height: 24.h), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'مطالعه بیانیه ', + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark), + ), + TextSpan( + recognizer: TapGestureRecognizer() + ..onTap = () { + Get.bottomSheet( + privacyPolicyWidget(), + isScrollControlled: true, + enableDrag: true, + ignoreSafeArea: false, + ); + }, + text: 'حریم خصوصی', + style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ], + ), + ), + ); + }), + ], + ), + ); + } + + Widget useAndPassFrom() { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 30.r), + child: Form( + key: controller.formKey, + child: AutofillGroup( + child: Column( + children: [ + RTextField( + label: 'نام کاربری', + maxLength: 11, + maxLines: 1, + controller: controller.usernameController.value, + keyboardType: TextInputType.number, + initText: controller.usernameController.value.text, + autofillHints: [AutofillHints.username], + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: AppColor.textColor, width: 1), + ), + onChanged: (value) async { + controller.usernameController.value.text = value; + if (value.length == 11) { + await controller.getUserInfo(value); + } + }, + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 6, 8), + child: Assets.vec.callSvg.svg(width: 12, height: 12), + ), + suffixIcon: controller.usernameController.value.text.trim().isNotEmpty + ? clearButton(() { + controller.usernameController.value.clear(); + controller.usernameController.refresh(); + }) + : null, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ شماره موبایل را وارد کنید'; + } else if (value.length < 10) { + return '⚠️ شماره موبایل باید 11 رقم باشد'; + } + return null; + }, + style: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal), + labelStyle: AppFonts.yekan13, + boxConstraints: const BoxConstraints( + maxHeight: 40, + minHeight: 40, + maxWidth: 40, + minWidth: 40, + ), + ), + const SizedBox(height: 26), + ObxValue( + (passwordController) => RTextField( + label: 'رمز عبور', + filled: false, + obscure: true, + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: AppColor.textColor, width: 1), + ), + controller: passwordController.value, + autofillHints: [AutofillHints.password], + variant: RTextFieldVariant.password, + initText: passwordController.value.text, + onChanged: (value) { + passwordController.refresh(); + }, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ رمز عبور را وارد کنید'; + } + return null; + }, + style: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal), + labelStyle: AppFonts.yekan13, + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 8, 8), + child: Assets.vec.keySvg.svg(width: 12, height: 12), + ), + boxConstraints: const BoxConstraints( + maxHeight: 34, + minHeight: 34, + maxWidth: 34, + minWidth: 34, + ), + ), + controller.passwordController, + ), + SizedBox(height: 26), + CaptchaWidget(), + SizedBox(height: 23), + + Obx(() { + return RElevated( + text: 'ورود', + isLoading: controller.isLoading.value, + onPressed: controller.isDisabled.value + ? null + : () async { + await controller.submitLoginForm(); + }, + width: Get.width, + height: 48, + ); + }), + ], + ), + ), + ), + ); + } + + Widget privacyPolicyWidget() { + return BaseBottomSheet( + child: Column( + spacing: 5, + children: [ + Container( + padding: EdgeInsets.all(8.w), + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 3, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'بيانيه حريم خصوصی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Text( + 'اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب می‌شود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران می‌شود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیت‌های جاری می‌گردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت می‌گردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت می‌کند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید.', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8), + ), + ], + ), + ), + Container( + padding: EdgeInsets.all(8.w), + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + 'چگونگی جمع آوری و استفاده از اطلاعات کاربران', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Text( + '''الف: اطلاعاتی که شما خود در اختيار این سامانه قرار می‌دهيد، شامل موارد زيرهستند: +اقلام اطلاعاتی شامل شماره تلفن همراه، تاریخ تولد، کد پستی و کد ملی کاربران را دریافت مینماییم که از این اقلام، صرفا جهت احراز هویت کاربران استفاده خواهد شد. +ب: برخی اطلاعات ديگر که به صورت خودکار از شما دريافت میشود شامل موارد زير می‌باشد: +⦁ دستگاهی که از طریق آن سامانه رصد یار را مشاهده می‌نمایید( تلفن همراه، تبلت، رایانه). +⦁ نام و نسخه سیستم عامل و browser کامپیوتر شما. +⦁ اطلاعات صفحات بازدید شده. +⦁ تعداد بازدیدهای روزانه در درگاه. +⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم. +''', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8), + ), + ], + ), + ), + Container( + padding: EdgeInsets.all(8.w), + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + 'امنیت اطلاعات', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Text( + 'متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوه‌‌های لازم استفاده می‌کنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری می‌کنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینک‌ها از سامانه ما خارج می‌شوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند.', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8), + ), + ], + ), + ), + ], + ), + ); + } + + /* + Widget sendCodeForm() { + return ObxValue((data) { + return Form( + key: data.value, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 30, vertical: 50), + child: Column( + children: [ + SizedBox(height: 26), + ObxValue((phoneController) { + return TextFormField( + controller: phoneController.value, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + gapPadding: 11, + ), + labelText: 'شماره موبایل', + labelStyle: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith( + color: AppColor.redNormal, + ), + prefixIconConstraints: BoxConstraints( + maxHeight: 40, + minHeight: 40, + maxWidth: 40, + minWidth: 40, + ), + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 6, 8), + child: vecWidget(Assets.vecCallSvg), + ), + suffix: + phoneController.value.text.trim().isNotEmpty + ? clearButton(() { + phoneController.value.clear(); + phoneController.refresh(); + }) + : null, + counterText: '', + ), + keyboardType: TextInputType.numberWithOptions( + decimal: false, + signed: false, + ), + maxLines: 1, + maxLength: 11, + onChanged: (value) { + if (controller.isOnError.value) { + controller.isOnError.value = !controller.isOnError.value; + data.value.currentState?.reset(); + data.refresh(); + phoneController.value.text = value; + } + phoneController.refresh(); + }, + textInputAction: TextInputAction.next, + validator: (value) { + if (value == null) { + return '⚠️ شماره موبایل را وارد کنید'; + } else if (value.length < 11) { + return '⚠️ شماره موبایل باید 11 رقم باشد'; + } + return null; + }, + style: AppFonts.yekan13, + ); + }, controller.phoneOtpNumberController), + + SizedBox(height: 26), + + CaptchaWidget(), + + SizedBox(height: 23), + RElevated( + text: 'ارسال رمز یکبار مصرف', + onPressed: () { + if (data.value.currentState?.validate() == true) { + controller.otpStatus.value = OtpStatus.sent; + controller.startTimer(); + } + }, + width: Get.width, + height: 48, + ), + ], + ), + ), + ); + }, controller.formKeyOtp); + } + + Widget confirmCodeForm() { + return ObxValue((data) { + return Form( + key: data.value, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 30, vertical: 50), + child: Column( + children: [ + SizedBox(height: 26), + + ObxValue((passwordController) { + return TextFormField( + controller: passwordController.value, + obscureText: controller.hidePassword.value, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + gapPadding: 11, + ), + labelText: 'رمز عبور', + labelStyle: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith( + color: AppColor.redNormal, + ), + + prefixIconConstraints: BoxConstraints( + maxHeight: 34, + minHeight: 34, + maxWidth: 34, + minWidth: 34, + ), + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 8, 8), + child: vecWidget(Assets.vecKeySvg), + ), + suffix: + passwordController.value.text.trim().isNotEmpty + ? GestureDetector( + onTap: () { + controller.hidePassword.value = + !controller.hidePassword.value; + }, + child: Icon( + controller.hidePassword.value + ? CupertinoIcons.eye + : CupertinoIcons.eye_slash, + ), + ) + : null, + counterText: '', + ), + textInputAction: TextInputAction.done, + keyboardType: TextInputType.visiblePassword, + maxLines: 1, + onChanged: (value) { + if (controller.isOnError.value) { + controller.isOnError.value = !controller.isOnError.value; + data.value.currentState?.reset(); + passwordController.value.text = value; + } + passwordController.refresh(); + }, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ رمز عبور را وارد کنید'; // "Please enter the password" + } + return null; + }, + style: AppFonts.yekan13, + ); + }, controller.passwordController), + + SizedBox(height: 23), + + ObxValue((timer) { + if (timer.value == 0) { + return TextButton( + onPressed: () { + controller.otpStatus.value = OtpStatus.reSend; + controller.startTimer(); + }, + child: Text( + style: AppFonts.yekan13.copyWith( + color: AppColor.blueNormal, + ), + 'ارسال مجدد کد یکبار مصرف', + ), + ); + } else { + return Text( + 'اعتبار رمز ارسال شده ${controller.timeFormatted}', + style: AppFonts.yekan13, + ); + } + }, controller.secondsRemaining), + + RichText( + text: TextSpan( + children: [ + TextSpan( + text: ' کد ارسال شده به شماره ', + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDark, + ), + ), + TextSpan( + text: controller.phoneOtpNumberController.value.text, + style: AppFonts.yekan13Bold.copyWith( + color: AppColor.darkGreyDark, + ), + ), + TextSpan( + recognizer: + TapGestureRecognizer() + ..onTap = () { + controller.otpStatus.value = OtpStatus.init; + }, + text: ' ویرایش', + style: AppFonts.yekan14.copyWith( + color: AppColor.blueNormal, + ), + ), + ], + ), + ), + + SizedBox(height: 23), + RElevated( + text: 'ورود', + onPressed: () { + if (controller.formKeyOtp.value.currentState?.validate() == + true) {} + }, + width: Get.width, + height: 48, + ), + ], + ), + ), + ); + }, controller.formKeySentOtp); + }*/ +} diff --git a/packages/chicken/lib/presentation/pages/buy/logic.dart b/packages/chicken/lib/presentation/pages/buy/logic.dart new file mode 100644 index 0000000..57b8aab --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy/logic.dart @@ -0,0 +1,25 @@ +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_core/core.dart'; + +class BuyLogic extends GetxController { + RootLogic rootLogic = Get.find(); + + List routesName = ['خرید']; + + @override + void onInit() { + super.onInit(); + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/packages/chicken/lib/presentation/pages/buy/view.dart b/packages/chicken/lib/presentation/pages/buy/view.dart new file mode 100644 index 0000000..27be7b2 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy/view.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/sale_buy_card_item.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class BuyPage extends GetView { + const BuyPage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + routes: controller.routesName, + isBase: true, + widgets: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Wrap( + alignment: WrapAlignment.center, + spacing: 14.w, + children: [ + saleOrBuyItemCard( + title: 'خرید داخل استان', + iconPath: Assets.vec.cubeSvg.path, + color: AppColor.greenNormalActive, + onTap: () { + Get.toNamed(ChickenRoutes.buysInProvince, id: 0); + }, + ), + saleOrBuyItemCard( + title: 'خرید خارج استان', + iconPath: Assets.vec.truckFastSvg.path, + color: AppColor.greenNormalActive, + onTap: () { + Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0); + }, + ), + ], + ), + ], + ), + ], + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart b/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart new file mode 100644 index 0000000..93cf531 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart @@ -0,0 +1,84 @@ +import 'package:rasadyar_chicken/presentation/pages/buy/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_all/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_waiting/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +class BuyInProvinceLogic extends GetxController { + RxList routesName = RxList(); + RxList isExpandedList = [].obs; + RxnString searchedValue = RxnString(); + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + + RootLogic get rootLogic => Get.find(); + + BuyLogic get buyLogic => Get.find(); + RxInt selectedSegmentIndex = 0.obs; + + BuyInProvinceAllLogic buyAllLogic = Get.find(); + BuyInProvinceWaitingLogic buyWaitingLogic = Get.find(); + + @override + void onInit() { + super.onInit(); + routesName.value = [...buyLogic.routesName, 'داخل استان'].toList(); + routesName.add(selectedSegmentIndex.value == 0 ? 'در انتظار' : 'همه'); + ever(selectedSegmentIndex, (callback) { + routesName.removeLast(); + routesName.add(callback == 0 ? 'در انتظار' : 'همه'); + }); + + ever(fromDateFilter, (callback) => _setFromDateFilter(callback)); + ever(toDateFilter, (callback) => _setToDateFilter(callback)); + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + void _setFromDateFilter(Jalali jalali) { + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.fromDateFilter.value = fromDateFilter.value; + } else { + buyAllLogic.fromDateFilter.value = fromDateFilter.value; + } + } + + void _setToDateFilter(Jalali jalali) { + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.toDateFilter.value = fromDateFilter.value; + } else { + buyAllLogic.toDateFilter.value = fromDateFilter.value; + } + } + + Future submitFilter() async { + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.getWaitingArrivals(); + } else { + buyAllLogic.getAllArrivals(); + } + } + + void setSearchValue(String? data) { + searchedValue.value = data?.trim(); + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.searchedValue.value = searchedValue.value; + } else { + buyAllLogic.searchedValue.value = searchedValue.value; + } + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_in_province/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province/view.dart new file mode 100644 index 0000000..6343fd4 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province/view.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_all/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_waiting/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; +import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class BuyInProvincePage extends GetView { + const BuyInProvincePage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName), + onBackPressed: () => Get.back(id: 0), + onSearchChanged: (data) => controller.setSearchValue(data), + filteringWidget: filterBottomSheet(), + widgets: [ + inventoryWidget(controller.rootLogic), + segmentWidget(), + ObxValue((index) { + return Expanded( + child: index.value == 0 ? BuyInProvinceWaitingPage() : BuyInProvinceAllPage(), + ); + }, controller.selectedSegmentIndex), + ], + ); + } + + Padding segmentWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 8), + child: Row( + children: [ + Expanded( + child: RSegment( + children: ['در انتظار', 'بایگانی'], + selectedIndex: 0, + borderColor: const Color(0xFFB4B4B4), + selectedBorderColor: AppColor.blueNormal, + selectedBackgroundColor: AppColor.blueLight, + onSegmentSelected: (index) => controller.selectedSegmentIndex.value = index, + backgroundColor: AppColor.whiteGreyNormal, + ), + ), + ], + ), + ); + } + + Widget filterBottomSheet() { + return BaseBottomSheet( + height: 200, + child: Column( + spacing: 16, + children: [ + Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + Row( + spacing: 8, + children: [ + Expanded( + child: dateFilterWidget( + date: controller.fromDateFilter, + onChanged: (jalali) => controller.fromDateFilter.value = jalali, + ), + ), + Expanded( + child: dateFilterWidget( + isFrom: false, + date: controller.toDateFilter, + onChanged: (jalali) => controller.toDateFilter.value = jalali, + ), + ), + ], + ), + + RElevated( + text: 'اعمال فیلتر', + + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + onPressed: () { + controller.submitFilter(); + Get.back(); + }, + height: 40, + ), + SizedBox(height: 16), + ], + ), + ); + } + + +} diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart b/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart new file mode 100644 index 0000000..8c08473 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart @@ -0,0 +1,145 @@ +import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +class BuyInProvinceAllLogic extends GetxController { + RxList isExpandedList = [].obs; + Rxn fromDateFilter = Rxn(); + Rxn toDateFilter = Rxn(); + RxnString searchedValue = RxnString(); + RxMap isLoadingConfirmMap = RxMap(); + final RxBool isLoadingMoreAllocationsMade = false.obs; + RxInt currentPage = 1.obs; + + RootLogic rootLogic = Get.find(); + + Rx>> allProduct = + Resource>.loading().obs; + + @override + void onInit() { + super.onInit(); + getAllArrivals(); + } + + @override + void onReady() { + debounce(searchedValue, (callback) => getAllArrivals(), time: Duration(milliseconds: 2000)); + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + Future getAllArrivals([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + allProduct.value = Resource>.loading(); + } + + if (searchedValue.value != null && + searchedValue.value!.trim().isNotEmpty && + currentPage.value > 1) { + currentPage.value = 1; + } + + safeCall( + call: () async => await rootLogic.chickenRepository.getWaitingArrivals( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + queryParams: {'type': 'all'}, + pageSize: 20, + page: currentPage.value, + search: 'filter', + role: 'Steward', + value: searchedValue.value, + fromDate: fromDateFilter.value?.toDateTime(), + toDate: toDateFilter.value?.toDateTime(), + ), + ), + onSuccess: (res) async { + await Future.delayed(Duration(milliseconds: 200)); + if ((res?.count ?? 0) == 0) { + allProduct.value = Resource>.empty(); + } else { + allProduct.value = Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: [...(allProduct.value.data?.results ?? []), ...(res?.results ?? [])], + ), + ); + } + }, + ); + } + + Future acceptEntries(WaitingArrivalModel model) async { + var request = StewardAllocationRequest( + allocationKey: model.key, + checkAllocation: true, + state: 'accepted', + receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0, + receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0, + registrationCode: model.registrationCode ?? 0, + weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0, + ).toJson(); + request.removeWhere((key, value) => value == null); + + safeCall( + call: () async => await rootLogic.chickenRepository.setSateForArrivals( + token: rootLogic.tokenService.accessToken.value!, + request: request, + ), + onError: (error, stackTrace) { + eLog(error); + }, + onSuccess: (result) { + getAllArrivals(); + rootLogic.getInventory(); + }, + ); + } + + Future denyEntries(WaitingArrivalModel model) async { + var request = StewardAllocationRequest( + allocationKey: model.key, + checkAllocation: true, + state: 'rejected', + ).toJson(); + request.removeWhere((key, value) => value == null); + + safeCall( + call: () async => await rootLogic.chickenRepository.setSateForArrivals( + token: rootLogic.tokenService.accessToken.value!, + request: request, + ), + onError: (error, stackTrace) { + eLog(error); + }, + onSuccess: (result) { + getAllArrivals(); + rootLogic.getInventory(); + }, + ); + } + + String getVecPathItem(String? item) { + switch (item) { + case 'pending': + return Assets.vec.timerSvg.path; + case 'accepted': + return Assets.vec.checkSquareSvg.path; + case 'rejected': + return Assets.vec.closeCircleSvg.path; + default: + return Assets.vec.timerSvg.path; + } + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart new file mode 100644 index 0000000..8a01cbc --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart @@ -0,0 +1,269 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; +import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2; + +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class BuyInProvinceAllPage extends GetView { + const BuyInProvinceAllPage({super.key}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + labelColor: getLabelColor(item.receiverState), + labelIcon: controller.getVecPathItem(item.receiverState), + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + onLoadMore: () async => controller.getAllArrivals(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getAllArrivals(); + }, + ); + }, controller.allProduct), + ); + } + + Row itemListWidget(WaitingArrivalModel item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 20), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 3, + children: [ + Text( + item.toSteward?.user?.fullname ?? 'N/A', + textAlign: TextAlign.start, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + Text( + item.date?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 3, + child: Column( + spacing: 3, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 6, + children: [ + Visibility( + visible: item.product?.name?.contains('مرغ گرم') ?? false, + child: Assets.vec.hotChickenSvg.svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + Text( + '${item.weightOfCarcasses?.separatedByComma}kg', + textAlign: TextAlign.left, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + item.steward?.guildsName ?? 'N/A', + textAlign: TextAlign.start, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Assets.vec.scanSvg.svg( + width: 32.w, + height: 32.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ], + ); + } + + Container itemListExpandedWidget(WaitingArrivalModel item) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + item.steward?.user?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + Spacer(), + Text( + item.receiverState?.faItem, + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark), + ), + SizedBox(width: 7), + SvgGenImage.vec( + controller.getVecPathItem(item.receiverState), + ).svg(width: 16.w, height: 16.h, + colorFilter: ColorFilter.mode(AppColor.darkGreyDark, BlendMode.srcIn) + ), + + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + item.date?.toJalali.formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${item.date?.toJalali.formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + + buildRow( + title: 'مشخصات فروشنده', + value: item.steward?.user?.fullname ?? 'N/A', + ), + buildRow( + title: 'تلفن فروشنده', + value: item.steward?.user?.mobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow( + title: 'نوع تخصیص', + value: item.allocationType?.faAllocationType ?? 'N/A', + ), + buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'), + buildRow( + title: 'وزن خریداری شده', + value: '${item.weightOfCarcasses?.separatedByComma} کیلوگرم', + ), + buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByComma} ریال'), + Visibility( + visible: item.receiverState == 'pending', + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + ObxValue((data) { + return RElevated( + text: 'تایید', + width: 150.w, + height: 40.h, + isLoading: data[item.key!] ?? false, + onPressed: () async { + data[item.key!] = !(data[item.key!] ?? false); + await controller.acceptEntries(item); + data.remove(item.key!); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ); + }, controller.isLoadingConfirmMap), + ROutlinedElevated( + text: 'رد', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildWarningDialog( + title: 'اخطار', + middleText: 'آیا از رد شدن این مورد اطمینان دارید؟', + onConfirm: () => controller.denyEntries(item), + onRefresh: () => controller.getAllArrivals(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ), + ], + ), + ); + } + + Color getLabelColor(String? item) { + switch (item) { + case 'pending': + return AppColor.blueLight; + case 'accepted': + + return AppColor.greenLightHover; + case 'rejected': + return AppColor.redLightHover; + default: + return AppColor.blueLight; + } + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart new file mode 100644 index 0000000..8d3ccd4 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart @@ -0,0 +1,160 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class BuyInProvinceWaitingLogic extends GetxController { + RxList isExpandedList = [].obs; + Rxn fromDateFilter = Rxn(); + Rxn toDateFilter = Rxn(); + RxnString searchedValue = RxnString(); + RxMap isLoadingConfirmMap = RxMap(); + Rx bgConfirmAllColor = AppColor.blueNormal.obs; + RxInt currentPage = 1.obs; + final RxBool isLoadingMoreAllocationsMade = false.obs; + RootLogic rootLogic = Get.find(); + + Rx>> waitingProduct = + Resource>.loading().obs; + + + + @override + void onInit() { + super.onInit(); + debounce( + searchedValue, + (callback) => getWaitingArrivals(), + time: Duration(milliseconds: timeDebounce), + ); + } + + @override + void onReady() { + super.onReady(); + getWaitingArrivals(); + + } + + @override + void onClose() { + super.onClose(); + } + + void setSearchValue(String? data) { + searchedValue.value = data?.trim(); + } + + Future getWaitingArrivals([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + waitingProduct.value = Resource>.loading(); + } + + if (searchedValue.value != null && + searchedValue.value!.trim().isNotEmpty && + currentPage.value > 1) { + currentPage.value = 1; + } + + safeCall( + call: () async => await rootLogic.chickenRepository.getWaitingArrivals( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + queryParams: {'type': 'not_entered'}, + pageSize: 20, + page: currentPage.value, + search: 'filter', + role: 'Steward', + value: searchedValue.value, + fromDate: fromDateFilter.value?.toDateTime(), + toDate: toDateFilter.value?.toDateTime(), + ), + ), + onSuccess: (res) async { + await Future.delayed(Duration(milliseconds: 200)); + if ((res?.count ?? 0) == 0) { + waitingProduct.value = Resource>.empty(); + } else { + waitingProduct.value = Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: [...(waitingProduct.value.data?.results ?? []), ...(res?.results ?? [])], + ), + ); + flashingFabBgColor(); + } + }, + ); + } + + + + Future acceptEntries(WaitingArrivalModel model) async { + var request = StewardAllocationRequest( + allocationKey: model.key, + checkAllocation: true, + state: 'accepted', + receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0, + receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0, + registrationCode: model.registrationCode ?? 0, + weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0, + ).toJson(); + request.removeWhere((key, value) => value == null); + + safeCall( + call: () async => await rootLogic.chickenRepository.setSateForArrivals( + token: rootLogic.tokenService.accessToken.value!, + request: request, + ), + onError: (error, stackTrace) { + eLog(error); + }, + onSuccess: (result) { + getWaitingArrivals(); + // getBarGeneralInformation(); + }, + ); + } + + Future denyEntries(WaitingArrivalModel model) async { + var request = StewardAllocationRequest( + allocationKey: model.key, + checkAllocation: true, + state: 'rejected', + ).toJson(); + request.removeWhere((key, value) => value == null); + + safeCall( + call: () async => await rootLogic.chickenRepository.setSateForArrivals( + token: rootLogic.tokenService.accessToken.value!, + request: request, + ), + onError: (error, stackTrace) { + eLog(error); + }, + onSuccess: (result) { + getWaitingArrivals(); + //TODO + // getBarGeneralInformation(); + }, + ); + } + + void flashingFabBgColor() { + Timer.periodic(Duration(seconds: 2), (timer) { + if (bgConfirmAllColor.value == AppColor.blueNormal) { + bgConfirmAllColor.value = AppColor.blueLightHover; + } else { + bgConfirmAllColor.value = AppColor.blueNormal; + } + }); + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart new file mode 100644 index 0000000..d556141 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart @@ -0,0 +1,264 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; +import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2; + +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class BuyInProvinceWaitingPage extends GetView { + const BuyInProvinceWaitingPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.timerSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + onLoadMore: () async => controller.getWaitingArrivals(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getWaitingArrivals(); + }, + ); + }, controller.waitingProduct), + ), + /* floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, + floatingActionButton: ObxValue((data) { + if ((data.value.data?.results?.length ?? 0) > 1) { + return AnimatedFab( + onPressed: () { + //TODO FAB + }, + message: 'تایید یکجا', + icon: Assets.vec.clipboardTaskSvg.svg(width: 45.w, height: 42.h), + backgroundColor: controller.bgConfirmAllColor.value, + ); + } else { + return SizedBox.shrink(); + } + }, controller.waitingProduct),*/ + ); + } + + Row itemListWidget(WaitingArrivalModel item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 20), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 3, + children: [ + Text( + item.steward?.user?.fullname ?? 'N/A', + textAlign: TextAlign.start, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + Text( + item.date?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 3, + child: Column( + spacing: 3, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 6, + children: [ + Visibility( + visible: item.product?.name?.contains('مرغ گرم') ?? false, + child: Assets.vec.hotChickenSvg.svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + Text( + '${item.weightOfCarcasses?.separatedByComma}kg', + textAlign: TextAlign.left, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + item.steward?.guildsName ?? 'N/A', + textAlign: TextAlign.start, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Assets.vec.scanSvg.svg( + width: 32.w, + height: 32.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ], + ); + } + + Container itemListExpandedWidget(WaitingArrivalModel item) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + item.steward?.user?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + Spacer(), + Text( + 'در انتظار', + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark), + ), + SizedBox(width: 7), + Assets.vec.clockSvg.svg(width: 16.w, height: 16.h), + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + item.date?.toJalali.formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${item.date?.toJalali.formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + + buildRow( + title: 'مشخصات فروشنده', + value: item.steward?.user?.fullname ?? 'N/A', + ), + buildRow( + title: 'تلفن فروشنده', + value: item.steward?.user?.mobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow( + title: 'نوع تخصیص', + value: item.allocationType?.faAllocationType ?? 'N/A', + ), + buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'), + buildRow( + title: 'وزن خریداری شده', + value: '${item.weightOfCarcasses?.separatedByComma} کیلوگرم', + ), + buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByComma} ریال'), + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + ObxValue((data) { + return RElevated( + text: 'تایید', + width: 150.w, + height: 40.h, + isLoading: data[item.key!] ?? false, + onPressed: () async { + data[item.key!] = !(data[item.key!] ?? false); + await controller.acceptEntries(item); + data.remove(item.key!); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ); + }, controller.isLoadingConfirmMap), + ROutlinedElevated( + text: 'رد', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildWarningDialog( + title: 'اخطار', + middleText: 'آیا از رد شدن این مورد اطمینان دارید؟', + onConfirm: () => controller.denyEntries(item), + onRefresh: () => controller.getWaitingArrivals(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_out_of_province/logic.dart b/packages/chicken/lib/presentation/pages/buy_out_of_province/logic.dart new file mode 100644 index 0000000..4a0e78a --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_out_of_province/logic.dart @@ -0,0 +1,239 @@ +import 'package:flutter/cupertino.dart'; + +import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class BuyOutOfProvinceLogic extends GetxController { + late List routesName; + RxBool isExpanded = false.obs; + RxBool isSubmitButtonEnabled = false.obs; + RxList isExpandedList = [].obs; + final RxInt currentPage = 1.obs; + final RxBool isLoadingMoreAllocationsMade = false.obs; + final RxBool isOnLoadingSubmitOrEdit = false.obs; + + //TODO add this to Di + ImagePicker imagePicker = ImagePicker(); + + Rx>> purchaseOutOfProvinceList = + Resource>.loading().obs; + Rxn selectedProduct = Rxn(); + + RxList cites = [].obs; + Rxn selectedProvince = Rxn(); + Rxn selectedCity = Rxn(); + Rxn selectedImage = Rxn(); + RxnString _base64Image = RxnString(); + RxnString editImageUrl = RxnString(); + + RootLogic get rootLogic => Get.find(); + + BuyLogic get buyLogic => Get.find(); + + SaleLogic get outOfTheProvinceLogic => Get.find(); + + GlobalKey formKey = GlobalKey(); + TextEditingController sellerNameController = TextEditingController(); + TextEditingController sellerPhoneController = TextEditingController(); + TextEditingController carcassWeightController = TextEditingController(); + + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + + @override + void onInit() { + super.onInit(); + routesName = [...buyLogic.routesName, 'خارج استان'].toList(); + } + + @override + void onReady() { + super.onReady(); + getStewardPurchaseOutOfProvince(); + selectedProvince.listen((p0) => getCites()); + + selectedProduct.value = rootLogic.rolesProductsModel.first; + setupListeners(); + + debounce( + searchedValue, + (callback) => getStewardPurchaseOutOfProvince(), + time: Duration(milliseconds: timeDebounce), + ); + } + + @override + void onClose() { + sellerNameController.dispose(); + sellerPhoneController.dispose(); + carcassWeightController.dispose(); + isExpandedList.clear(); + + super.onClose(); + } + + void setSearchValue(String? data) { + searchedValue.value = data?.trim(); + } + + Future getStewardPurchaseOutOfProvince([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + purchaseOutOfProvinceList.value = Resource>.loading(); + } + + if (searchedValue.value != null && + searchedValue.value!.trim().isNotEmpty && + currentPage.value > 1) { + currentPage.value = 1; // Reset to first page if search value is set + } + await safeCall( + call: () => rootLogic.chickenRepository.getStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + pageSize: 20, + page: currentPage.value, + search: 'filter', + role: 'Steward', + value: searchedValue.value, + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), + ), + ), + onSuccess: (res) async { + await Future.delayed(Duration(milliseconds: 500)); + if ((res?.count ?? 0) == 0) { + purchaseOutOfProvinceList.value = Resource>.empty(); + } else { + purchaseOutOfProvinceList.value = Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: [ + ...(purchaseOutOfProvinceList.value.data?.results ?? []), + ...(res?.results ?? []), + ], + ), + ); + } + }, + ); + } + + Future getCites() async { + await safeCall( + call: () => + rootLogic.chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''), + onSuccess: (result) { + if (result != null && result.isNotEmpty) { + cites.value = result; + } + }, + ); + } + + void setupListeners() { + sellerNameController.addListener(checkFormValid); + sellerPhoneController.addListener(checkFormValid); + carcassWeightController.addListener(checkFormValid); + + ever(selectedProvince, (_) => checkFormValid()); + ever(selectedCity, (_) => checkFormValid()); + ever(selectedProduct, (_) => checkFormValid()); + ever(selectedImage, (data) async { + checkFormValid(); + if (data?.path != null) { + _base64Image.value = await convertImageToBase64(data!.path); + } + }); + } + + void checkFormValid() { + isSubmitButtonEnabled.value = + sellerNameController.text.isNotEmpty && + sellerPhoneController.text.isNotEmpty && + carcassWeightController.text.isNotEmpty && + selectedProvince.value != null && + selectedCity.value != null && + selectedProduct.value != null && + selectedImage.value != null; + } + + Future createStewardPurchaseOutOfProvince() async { + bool res = false; + isOnLoadingSubmitOrEdit.value = true; + if (!(formKey.currentState?.validate() ?? false)) { + return res; + } + await safeCall( + call: () async { + CreateStewardFreeBar createStewardFreeBar = CreateStewardFreeBar( + productKey: selectedProduct.value!.key, + killHouseName: sellerNameController.text, + killHouseMobile: sellerPhoneController.text, + province: selectedProvince.value!.name, + city: selectedCity.value!.name, + weightOfCarcasses: int.parse(carcassWeightController.text.clearComma), + barImage: _base64Image.value, + date: DateTime.now().formattedYHMS, + ); + final res = await rootLogic.chickenRepository.createStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + body: createStewardFreeBar, + ); + }, + onSuccess: (result) { + getStewardPurchaseOutOfProvince(); + resetSubmitForm(); + res = true; + }, + ); + isOnLoadingSubmitOrEdit.value = false; + return res; + } + + void resetSubmitForm() { + sellerNameController.clear(); + sellerPhoneController.clear(); + carcassWeightController.clear(); + selectedProvince.value = null; + selectedCity.value = null; + selectedImage.value = null; + _base64Image.value = null; + editImageUrl.value = null; + + isSubmitButtonEnabled.value = false; + } + + void setEditData(StewardFreeBar item) { + editImageUrl.value = item.barImage; + sellerNameController.text = item.killHouseName ?? ''; + sellerPhoneController.text = item.killHouseMobile ?? ''; + carcassWeightController.text = item.weightOfCarcasses?.toInt().toString() ?? ''; + selectedProvince.value = IranProvinceCityModel(name: item.province); + selectedCity.value = IranProvinceCityModel(name: item.city); + selectedProduct.value = rootLogic.rolesProductsModel.firstWhere( + (element) => element.key == item.product!.key, + ); + isSubmitButtonEnabled.value = true; + } + + Future deleteStewardPurchaseOutOfProvince(String key) async { + await safeCall( + call: () => rootLogic.chickenRepository.deleteStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + stewardFreeBarKey: key, + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart new file mode 100644 index 0000000..e05f5a6 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart @@ -0,0 +1,596 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; + + +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class BuyOutOfProvincePage extends GetView { + const BuyOutOfProvincePage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + routes: controller.routesName, + onBackPressed: () => Get.back(id: 0), + onSearchChanged: (data) => controller.setSearchValue(data), + filteringWidget: filterBottomSheet(), + widgets: [ + inventoryWidget(controller.rootLogic), + Expanded( + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.truckFastOutlinedSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + onLoadMore: () async => controller.getStewardPurchaseOutOfProvince(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getStewardPurchaseOutOfProvince(); + }, + ); + }, controller.purchaseOutOfProvinceList), + ), + ], + floatingActionButton: RFab.add( + onPressed: () { + Get.bottomSheet( + addPurchasedInformationBottomSheet(), + isScrollControlled: true, + ignoreSafeArea: false, + ).whenComplete(() { + controller.resetSubmitForm(); + + },); + }, + ), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + Container itemListExpandedWidget(StewardFreeBar item) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + '${item.province}-${item.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + item.date?.toJalali.formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${item.date?.toJalali.formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + + buildRow(title: 'مشخصات فروشنده', value: item.killHouseName ?? 'N/A'), + + buildRow( + title: 'تلفن فروشنده', + value: item.killHouseMobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'), + buildRow( + title: 'وزن خریداری شده', + value: '${item.weightOfCarcasses?.separatedByComma} کیلوگرم', + ), + buildRowOnTapped( + title: 'مشاهده بارنامه', + titleStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + valueWidget: Assets.vec.clipboardEyeSvg.svg( + width: 20, + height: 24, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + onTap: () { + Get.bottomSheet( + BaseBottomSheet( + height: 400, + child: Column( + spacing: 16, + children: [ + Text( + 'بارنامه', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + + Image.network( + item.barImage ?? '', + fit: BoxFit.cover, + height: 300, + errorBuilder: (context, error, stackTrace) { + eLog(error.toString()); + return Center(child: Text('خطایی پیش آمده!')); + }, + loadingBuilder: (context, child, loadingProgress) { + if (loadingProgress == null) return child; + return CupertinoActivityIndicator(); + }, + ), + ], + ), + ), + ); + }, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + onPressed: () { + controller.setEditData(item); + Get.bottomSheet( + addPurchasedInformationBottomSheet(true), + isScrollControlled: true, + ).whenComplete(() { + + controller.resetSubmitForm(); + }); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () => controller.deleteStewardPurchaseOutOfProvince(item.key!), + onRefresh: () => controller.getStewardPurchaseOutOfProvince(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ], + ), + ); + } + + Row itemListWidget(StewardFreeBar item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 20), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 3, + children: [ + Text( + item.killHouseName ?? 'N/A', + textAlign: TextAlign.start, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + Text( + item.date?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 3, + children: [ + Visibility( + visible: item.product?.name?.contains('مرغ گرم') ?? false, + child: Assets.vec.hotChickenSvg.svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + Text( + '${item.weightOfCarcasses?.separatedByComma}kg', + textAlign: TextAlign.left, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + SizedBox(height: 2), + + Text( + '${item.province}', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Assets.vec.scanSvg.svg( + width: 32.w, + height: 32.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ], + ); + } + + Widget addPurchasedInformationBottomSheet([bool isOnEdit = false]) { + return BaseBottomSheet( + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text( + isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + _productDropDown(), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + + child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]), + ), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + + child: Column( + spacing: 12, + children: [ + RTextField( + controller: controller.sellerNameController, + label: 'نام فروشنده', + borderColor: AppColor.darkGreyLight, + filled: true, + filledColor: AppColor.bgLight, + ), + RTextField( + controller: controller.sellerPhoneController, + label: 'تلفن فروشنده', + keyboardType: TextInputType.phone, + borderColor: AppColor.darkGreyLight, + maxLength: 11, + filled: true, + filledColor: AppColor.bgLight, + validator: (value) { + if (value == null || value.isEmpty) { + return 'لطفاً شماره موبایل را وارد کنید'; + } + String cleaned = value.replaceAll(',', ''); + if (cleaned.length != 11) { + return 'شماره موبایل باید ۱۱ رقم باشد'; + } + if (!cleaned.startsWith('09')) { + return 'شماره موبایل باید با 09 شروع شود'; + } + return null; + }, + ), + + UnitTextField( + controller: controller.carcassWeightController, + hint: 'وزن', + unit: 'کیلوگرم', + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + ), + ], + ), + ), + _imageCarcasesWidget(isOnEdit), + submitButtonWidget(isOnEdit), + SizedBox(), + ], + ), + ), + ); + } + + Widget submitButtonWidget(bool isOnEdit) { + return Obx(() { + return RElevated( + text: isOnEdit ? 'ویرایش' : 'ثبت', + width: Get.width, + backgroundColor: AppColor.greenNormal, + isLoading: controller.isOnLoadingSubmitOrEdit.value, + onPressed: controller.isSubmitButtonEnabled.value + ? () async { + var res = await controller.createStewardPurchaseOutOfProvince(); + if (res) { + Get.back(); + } + } + : null, + height: 40, + ); + }); + } + + Widget _productDropDown() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.rolesProductsModel, + height: 56, + hasDropIcon: false, + background: Colors.white, + onChanged: (value) { + controller.selectedProduct.value = value; + }, + selectedItem: controller.selectedProduct.value, + initialValue: controller.selectedProduct.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Row( + spacing: 8, + children: [ + (item?.name?.contains('مرغ گرم') ?? false) + ? Assets.images.chicken.image(width: 40, height: 40) + : Assets.vec.placeHolderSvg.svg(width: 40, height: 40), + + Text(item?.name ?? 'انتخاب محصول'), + Spacer(), + Text( + 'موجودی:${controller.rootLogic.inventoryModel.value?.totalRemainWeight.separatedByComma ?? 0}', + ), + ], + ), + ); + }); + } + + Widget _provinceWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.provinces, + onChanged: (value) { + controller.selectedProvince.value = value; + }, + selectedItem: controller.selectedProvince.value, + itemBuilder: (item) => Text( + item.name ?? 'بدون نام', + style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker), + ), + labelBuilder: (item) => item?.name != null + ? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)) + : Text( + 'انتخاب استان', + style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight), + ), + ); + }); + } + + Widget _cityWidget() { + return ObxValue((data) { + return OverlayDropdownWidget( + items: data, + onChanged: (value) { + controller.selectedCity.value = value; + }, + selectedItem: controller.selectedCity.value, + itemBuilder: (item) => Text( + item.name ?? 'بدون نام', + style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker), + ), + labelBuilder: (item) => item?.name != null + ? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)) + : Text('انتخاب شهر', style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight)), + ); + }, controller.cites); + } + + SizedBox _imageCarcasesWidget(bool isOnEdit) { + return SizedBox( + width: Get.width, + height: 370, + child: Card( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + spacing: 8, + children: [ + Text('بارنامه', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + Expanded( + child: ObxValue((data) { + return Container( + width: Get.width, + height: 270, + decoration: BoxDecoration( + color: AppColor.lightGreyNormal, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLight), + ), + child: Center( + child: isOnEdit + ? Image.network(controller.editImageUrl.value ?? '') + : data.value == null + ? Padding( + padding: const EdgeInsets.fromLTRB(30, 10, 10, 30), + child: Assets.vec.placeHolderSvg.svg(width: 200.w, height: 150.h), + ) + : Image.file(File(data.value!.path), fit: BoxFit.cover), + ), + ); + }, controller.selectedImage), + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + text: 'گالری', + width: 150.w, + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + onPressed: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.gallery, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + ), + SizedBox(width: 16), + ROutlinedElevated( + text: 'دوربین', + width: 150.w, + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal), + onPressed: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.camera, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + ), + ], + ), + ], + ), + ), + ), + ); + } + + Widget filterBottomSheet() { + return BaseBottomSheet( + height: 200, + child: Column( + spacing: 16, + children: [ + Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + Row( + spacing: 8, + children: [ + Expanded( + child: dateFilterWidget( + date: controller.fromDateFilter, + onChanged: (jalali) => controller.fromDateFilter.value = jalali, + ), + ), + Expanded( + child: dateFilterWidget( + isFrom: false, + date: controller.toDateFilter, + onChanged: (jalali) => controller.toDateFilter.value = jalali, + ), + ), + ], + ), + RElevated( + text: 'اعمال فیلتر', + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + onPressed: () { + controller.getStewardPurchaseOutOfProvince(); + Get.back(); + }, + height: 40, + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/home/logic.dart b/packages/chicken/lib/presentation/pages/home/logic.dart new file mode 100644 index 0000000..e348934 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/home/logic.dart @@ -0,0 +1,70 @@ + +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_core/core.dart'; + +class HomeLogic extends GetxController { + RootLogic rootLogic = Get.find(); + RxnInt totalWeightTodayBars = RxnInt(); + Rxn killHouseDistributionInfo = Rxn(); + Rxn barInformation = Rxn(); + + RxBool isExpanded = false.obs; + + @override + void onReady() { + super.onReady(); + getGeneralBarsInformation(); + getTodayBars(); + getDistributionInformation(); + } + + Future getGeneralBarsInformation() async { + await safeCall( + call: () async => await rootLogic.chickenRepository.getGeneralBarInformation( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams(role: 'Steward'), + ), + onSuccess: (result) { + if (result != null) { + barInformation.value = result; + } + }, + onError: (error, stackTrace) {}, + ); + } + + Future getTodayBars() async { + await safeCall( + call: () async => await rootLogic.chickenRepository.getGeneralBarInformation( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + fromDate: DateTime.now(), + toDate: DateTime.now(), + role: 'Steward', + ), + ), + onSuccess: (result) { + if (result != null) { + totalWeightTodayBars.value = result.totalBarsWeight?.toInt(); + } + }, + onError: (error, stackTrace) {}, + ); + } + + Future getDistributionInformation() async { + await safeCall( + call: () async => await rootLogic.chickenRepository.getKillHouseDistributionInfo( + token: rootLogic.tokenService.accessToken.value!, + ), + onSuccess: (result) { + if (result != null) { + killHouseDistributionInfo.value = result; + } + }, + onError: (error, stackTrace) {}, + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/home/view.dart b/packages/chicken/lib/presentation/pages/home/view.dart new file mode 100644 index 0000000..03e804d --- /dev/null +++ b/packages/chicken/lib/presentation/pages/home/view.dart @@ -0,0 +1,636 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_chicken/presentation/widget/app_bar.dart'; +import 'package:rasadyar_chicken/presentation/widget/widely_used/view.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class HomePage extends GetView { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.bgLight, + appBar: chickenAppBar(hasBack: false, hasFilter: false, hasSearch: false), + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + spacing: 8, + children: [ + InkWell( + onTap: () { + controller.isExpanded.value = !controller.isExpanded.value; + }, + child: Card( + margin: EdgeInsetsGeometry.all(6), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide(width: 0.50, color: const Color(0xFFA9A9A9)), + ), + + child: ObxValue((data) { + return AnimatedSize( + duration: Duration(milliseconds: 300), + child: data.value + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + spacing: 8, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 40, + height: 40, + decoration: ShapeDecoration( + image: DecorationImage( + image: AssetImage(Assets.images.chicken.path), + fit: BoxFit.cover, + ), + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.25, + color: const Color(0xFFB0B0B0), + ), + borderRadius: BorderRadius.circular(4), + ), + ), + ), + Text( + 'مرغ گرم', + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith( + color: AppColor.darkGreyDarkActive, + ), + ), + Spacer(), + AnimatedRotation( + turns: 180, + duration: Duration(milliseconds: 3000), + child: Icon(CupertinoIcons.chevron_up, size: 18), + ), + ], + ), + SizedBox(height: 8), + _todayShipmentWidget(), + + _inventoryWidget(), + + Row( + children: [ + Text( + 'اطلاعات بارها', + textAlign: TextAlign.right, + style: AppFonts.yekan16, + ), + ], + ), + + _informationShipment(), + + Row( + children: [ + Text( + 'اطلاعات توزیع', + textAlign: TextAlign.right, + style: AppFonts.yekan16, + ), + ], + ), + + distributionInformationWidget(), + ], + ), + ) + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + spacing: 8, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 40, + height: 40, + decoration: ShapeDecoration( + image: DecorationImage( + image: AssetImage(Assets.images.chicken.path), + fit: BoxFit.cover, + ), + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.25, + color: const Color(0xFFB0B0B0), + ), + borderRadius: BorderRadius.circular(4), + ), + ), + ), + Text( + 'مرغ گرم', + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith( + color: AppColor.darkGreyDarkActive, + ), + ), + Spacer(), + Icon(CupertinoIcons.chevron_down, size: 18), + ], + ), + _todayShipmentWidget(), + _inventoryWidget(), + ], + ), + ), + ); + }, controller.isExpanded), + ), + ), + + WidelyUsedWidget(), + SizedBox(height: 20,) + ], + ), + ), + ); + } + + Widget distributionInformationWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 0, 13), + child: ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Expanded( + child: _informationIconCard( + title: 'توزیع داخل استان', + isLoading: data.value == null, + description: data.value?.freeSalesWeight.separatedByComma ?? '0', + iconPath: Assets.vec.truckSvg.path, + iconColor: const Color.fromRGBO(85, 97, 93, 1), + bgDescriptionColor: const Color(0xFFE6FAF5), + bgLabelColor: const Color(0xFFB0EFDF), + ), + ), + Expanded( + child: _informationIconCard( + title: 'توزیع خارج استان', + isLoading: data.value == null, + description: data.value?.stewardAllocationsWeight.separatedByComma ?? '0', + iconPath: Assets.vec.truckFastSvg.path, + iconColor: Color(0xFF647379), + bgDescriptionColor: const Color(0xFFEAEFFF), + bgLabelColor: const Color(0xFFD4DEFF), + ), + ), + Expanded( + child: _informationIconCard( + title: 'قطعه بندی', + description: '2،225،256', + iconPath: Assets.vec.convertCubeSvg.path, + iconColor: const Color(0xFF6F6164), + bgDescriptionColor: const Color(0xFFEDDCE0), + bgLabelColor: const Color(0xFFE0BCC5), + ), + ), + ], + ); + }, controller.killHouseDistributionInfo), + ); + } + + Widget _informationShipment() { + return Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 0, 13), + child: ObxValue((data) { + return Row( + spacing: 8, + children: [ + Expanded( + child: _informationLabelCard( + title: 'داخل استان', + isLoading: data.value == null, + description: data.value != null + ? ((data.value?.provinceGovernmentalCarcassesWeight ?? 0) + + (data.value?.provinceFreeCarcassesWeight ?? 0)) + .separatedByComma + : '0', + iconPath: Assets.vec.a3dCubeSquareSvg.path, + iconColor: const Color(0xFF6C5D60), + bgDescriptionColor: const Color(0xFFEDDCE0), + bgLabelColor: const Color(0xFFDDC0C7), + ), + ), + Expanded( + child: _informationLabelCard( + title: 'خارج استان', + isLoading: data.value == null, + description: data.value?.freeBuyingCarcassesWeight.separatedByComma ?? '0', + iconPath: Assets.vec.cubeSearchSvg.path, + iconColor: Color(0xFF2D5FFF), + bgLabelColor: const Color(0xFFAFCBFF), + bgDescriptionColor: const Color(0xFFCEDFFF), + ), + ), + ], + ); + }, controller.rootLogic.inventoryModel), + ); + } + + Widget _inventoryWidget() { + return ObxValue((data) { + return Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 0, 13), + child: Row( + spacing: 8, + children: [ + Expanded( + child: _informationLabelCard( + title: 'مانده انبار', + isLoading: data.value == null, + description: data.value?.totalRemainWeight.separatedByComma ?? '0', + iconPath: Assets.vec.cubeSearchSvg.path, + iconColor: const Color(0xFF426060), + bgDescriptionColor: const Color(0xFFC7DFE0), + bgLabelColor: const Color(0xFFA5D1D2), + ), + ), + Expanded( + child: _informationLabelCard( + title: 'توزیع شده', + isLoading: data.value == null, + description: data.value?.realAllocatedWeight.separatedByComma ?? '0', + iconPath: Assets.vec.cubeRotateSvg.path, + iconColor: Color(0xFF5C4D64), + bgLabelColor: Color(0xFFC8B8D1), + bgDescriptionColor: Color(0xFFDAD4DD), + ), + ), + ], + ), + ); + }, controller.rootLogic.inventoryModel); + } + + Widget _todayShipmentWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 0, 13), + child: Row( + spacing: 8, + children: [ + Expanded( + child: ObxValue( + (data) => _informationLabelCard( + title: 'بارهای امروز', + titleColor: AppColor.blueNormal, + isLoading: data.value == null, + description: data.value?.separatedByComma ?? '0', + iconPath: Assets.vec.cubeSearchSvg.path, + iconColor: AppColor.blueNormal, + bgDescriptionColor: Colors.white, + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [AppColor.blueLight, Colors.white], + ), + ), + controller.totalWeightTodayBars, + ), + ), + + Expanded( + child: ObxValue((data) { + return _informationLabelCard( + title: 'درانتظار تایید', + isLoading: data.value == null, + description: data.value?.totalNotEnteredBars.separatedByComma ?? '0', + unit: + '(${data.value?.totalNotEnteredKillHouseRequestsWeight.separatedByComma})\nکیلوگرم', + iconPath: Assets.vec.cubeWattingSvg.path, + bgDescriptionColor: Colors.white, + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [const Color(0xFFFFE7BB), Colors.white], + ), + ); + }, controller.barInformation), + ), + ], + ), + ); + } + + Container _informationLabelCard({ + required String title, + required String description, + required String iconPath, + required Color bgDescriptionColor, + String unit = 'کیلوگرم', + bool isLoading = false, + Color? iconColor, + Color? titleColor, + Color? bgLabelColor, + LinearGradient? gradient, + }) { + return Container( + height: 82, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)), + clipBehavior: Clip.hardEdge, + child: Row( + children: [ + // Left side with icon and title + Expanded( + child: Container( + height: 82, + decoration: BoxDecoration( + color: gradient == null ? bgLabelColor : null, + borderRadius: BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + gradient: gradient, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: iconColor != null + ? ColorFilter.mode(iconColor, BlendMode.srcIn) + : null, + ), + Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith( + color: titleColor ?? AppColor.mediumGreyDarkActive, + ), + ), + ], + ), + ), + ), + // Right side with description and unit + Expanded( + child: Container( + decoration: BoxDecoration( + color: bgDescriptionColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + ), + ), + child: isLoading + ? Center(child: CupertinoActivityIndicator()) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + description, + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive), + ), + Text( + unit, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive), + ), + ], + ), + ), + ), + ], + ), + ); + } + + Container _informationIconCard({ + required String title, + required String description, + String unit = 'کیلوگرم', + bool isLoading = false, + required String iconPath, + required Color iconColor, + required Color bgDescriptionColor, + required Color bgLabelColor, + }) { + return Container( + height: 110, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)), + clipBehavior: Clip.hardEdge, + child: Stack( + alignment: Alignment.topCenter, + children: [ + Positioned( + bottom: 0, + right: 0, + left: 0, + child: Container( + height: 91, + decoration: BoxDecoration( + color: bgDescriptionColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 0.25, color: const Color(0xFFB4B4B4)), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive), + ), + + isLoading + ? Center(child: CupertinoActivityIndicator()) + : Text( + description, + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive), + ), + Text( + unit, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive), + ), + ], + ), + ), + ), + Positioned( + top: 0, + child: Container( + width: 32, + height: 32, + decoration: ShapeDecoration( + color: bgLabelColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + side: BorderSide(width: 0.25, color: const Color(0xFFD5D5D5)), + ), + ), + child: Center( + child: SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn), + ), + ), + ), + ), + ], + ), + ); + } + + Widget inventoryItem({ + required bool isExpanded, + required int index, + required InventoryModel model, + }) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + buildRow('نام محصول', model.name ?? ''), + Visibility( + visible: isExpanded, + child: Column( + spacing: 8, + children: [ + buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'), + buildRow( + 'وزن خریدهای آزاد داخل استان (کیلوگرم)', + model.receiveFreeCarcassesWeight.toString(), + ), + buildRow( + 'وزن خریدهای خارج استان (کیلوگرم)', + model.freeBuyingCarcassesWeight.toString(), + ), + buildRow( + 'کل ورودی به انبار (کیلوگرم)', + model.totalFreeBarsCarcassesWeight.toString(), + ), + buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()), + buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()), + ], + ), + ), + ], + ); + } + + Widget buildRow(String title, String value) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 2, + child: Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + Flexible( + flex: 1, + child: Text( + value, + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + ], + ), + ); + } + + Widget broadcastInformationWidget(KillHouseDistributionInfo? model) { + return Container( + height: 140, + margin: const EdgeInsets.all(8), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.blueNormal, width: 1), + ), + child: model != null + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 10, + children: [ + Text( + 'اطلاعات ارسالی', + textAlign: TextAlign.right, + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + const SizedBox(height: 12), + buildRow( + 'فروش و توزیع داخل استان (کیلوگرم)', + model.stewardAllocationsWeight!.toInt().toString(), + ), + buildRow( + 'فروش و توزیع خارج استان (کیلوگرم)', + model.freeSalesWeight!.toInt().toString(), + ), + ], + ) + : const Center(child: CircularProgressIndicator()), + ); + } + + Widget cardWidget({ + required String title, + required String iconPath, + required VoidCallback onTap, + }) { + return Container( + width: Get.width / 4, + height: 130, + child: GestureDetector( + onTap: onTap, + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide(width: 1, color: AppColor.blueNormal), + ), + child: Padding( + padding: EdgeInsets.all(16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgGenImage(iconPath).svg(width: 50, height: 50), + SizedBox(height: 4), + Text( + title, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/profile/logic.dart b/packages/chicken/lib/presentation/pages/profile/logic.dart new file mode 100644 index 0000000..e339341 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/profile/logic.dart @@ -0,0 +1,149 @@ +import 'package:flutter/material.dart'; + +import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +class ProfileLogic extends GetxController { + RootLogic rootLogic = Get.find(); + RxInt selectedInformationType = 0.obs; + Rxn birthDate = Rxn(); + + Rx> userProfile = Rx>(Resource.loading()); + + TextEditingController nameController = TextEditingController(); + TextEditingController lastNameController = TextEditingController(); + TextEditingController nationalCodeController = TextEditingController(); + TextEditingController nationalIdController = TextEditingController(); + TextEditingController birthdayController = TextEditingController(); + + TextEditingController oldPasswordController = TextEditingController(); + TextEditingController newPasswordController = TextEditingController(); + TextEditingController retryNewPasswordController = TextEditingController(); + + RxList cites = [].obs; + Rxn selectedProvince = Rxn(); + Rxn selectedCity = Rxn(); + + GlobalKey formKey = GlobalKey(); + ImagePicker imagePicker = ImagePicker(); + Rxn selectedImage = Rxn(); + RxnString _base64Image = RxnString(); + RxBool isOnLoading = false.obs; + + @override + void onInit() { + super.onInit(); + ever(selectedImage, (data) async { + if (data?.path != null) { + _base64Image.value = await convertImageToBase64(data!.path); + } + }); + } + + @override + void onReady() { + super.onReady(); + getUserProfile(); + selectedProvince.listen((p0) => getCites()); + userProfile.listen((data) { + nameController.text = data.data?.firstName ?? ''; + lastNameController.text = data.data?.lastName ?? ''; + nationalCodeController.text = data.data?.nationalCode ?? ''; + nationalIdController.text = data.data?.nationalId ?? ''; + birthdayController.text = data.data?.birthday?.toJalali.formatCompactDate() ?? ''; + birthDate.value = data.data?.birthday?.toJalali; + selectedProvince.value = IranProvinceCityModel( + name: data.data?.province ?? '', + id: data.data?.provinceNumber ?? 0, + ); + + selectedCity.value = IranProvinceCityModel( + name: data.data?.city ?? '', + id: data.data?.cityNumber ?? 0, + ); + }); + } + + @override + void onClose() { + super.onClose(); + } + + Future getUserProfile() async { + userProfile.value = Resource.loading(); + await safeCall( + call: () async => await rootLogic.chickenRepository.getUserProfile( + token: rootLogic.tokenService.accessToken.value!, + ), + onSuccess: (result) { + if (result != null) { + userProfile.value = Resource.success(result); + } + }, + onError: (error, stackTrace) {}, + ); + } + + Future getCites() async { + await safeCall( + call: () => + rootLogic.chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''), + onSuccess: (result) { + if (result != null && result.isNotEmpty) { + cites.value = result; + } + }, + ); + } + + Future updateUserProfile() async { + UserProfile userProfile = UserProfile( + firstName: nameController.text, + lastName: lastNameController.text, + nationalCode: nationalCodeController.text, + nationalId: nationalIdController.text, + birthday: birthDate.value?.toDateTime().formattedDashedGregorian.toString(), + image: _base64Image.value, + personType: 'self', + type: 'self_profile', + ); + isOnLoading.value = true; + await safeCall( + call: () async => await rootLogic.chickenRepository.updateUserProfile( + token: rootLogic.tokenService.accessToken.value!, + userProfile: userProfile, + ), + onSuccess: (result) { + isOnLoading.value = false; + }, + onError: (error, stackTrace) { + isOnLoading.value = false; + }, + ); + } + + Future updatePassword() async { + if (formKey.currentState?.validate() ?? false) { + ChangePasswordRequestModel model = ChangePasswordRequestModel( + username: userProfile.value.data?.mobile, + password: newPasswordController.text, + ); + + await safeCall( + call: () async => await rootLogic.chickenRepository.updatePassword( + token: rootLogic.tokenService.accessToken.value!, + model: model, + ), + ); + } + } + + void clearPasswordForm() { + oldPasswordController.clear(); + newPasswordController.clear(); + retryNewPasswordController.clear(); + } +} diff --git a/packages/chicken/lib/presentation/pages/profile/view.dart b/packages/chicken/lib/presentation/pages/profile/view.dart new file mode 100644 index 0000000..23ccba7 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/profile/view.dart @@ -0,0 +1,643 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart'; + +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class ProfilePage extends GetView { + const ProfilePage({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + spacing: 30, + children: [ + Expanded( + flex: 1, + child: Container( + color: AppColor.blueNormal, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(), + ObxValue( + (data) { + final status = data.value.status; + + if (status == ResourceStatus.loading) { + return Container( + width: 128.w, + height: 128.h, + child: Center(child: CupertinoActivityIndicator(color: AppColor + .greenNormal,)), + ); + } + + if (status == ResourceStatus.error) { + return Container( + width: 128.w, + height: 128.h, + child: Center(child: Text('خطا در دریافت اطلاعات')), + ); + } + + + // Default UI + return Container( + width: 128.w, + height: 128.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: AppColor.blueLightActive, + ), + child: Center( + child: CircleAvatar( + radius: 64.w, + backgroundImage: + NetworkImage(data.value.data!.image!) + + + ), + ), + ); + }, + controller.userProfile, + ) + ], + ), + ), + ), + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 16, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10), + child: userProfileInformation(), + ), + ), + + Center( + child: Wrap( + alignment: WrapAlignment.center, + spacing: 20, + runSpacing: 10, + children: [ + cardActionWidget( + title: 'تغییر رمز عبور', + selected: true, + onPressed: () { + Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true); + }, + icon: Assets.vec.lockSvg.path, + ), + cardActionWidget( + title: 'خروج', + selected: true, + color: ColorFilter.mode(Colors.redAccent, BlendMode.srcIn), + cardColor: Color(0xFFEFEFEF), + textColor: AppColor.redDarkerText, + onPressed: () { + Get.bottomSheet(exitBottomSheet(), isScrollControlled: true); + }, + icon: Assets.vec.logoutSvg.path, + ), + ], + ), + ), + + SizedBox(height: 100), + ], + ), + ), + ], + ); + } + + Container invoiceIssuanceInformation() => Container(); + + Widget bankInformationWidget() => + Column( + spacing: 16, + children: [ + itemList(title: 'نام بانک', content: 'سامان'), + itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'), + itemList(title: 'شماره کارت ', content: '54154545415'), + itemList(title: 'شماره حساب', content: '62565263263652'), + itemList(title: 'شماره شبا', content: '62565263263652'), + ], + ); + + Widget userProfileInformation() { + return ObxValue((data) { + if (data.value.status == ResourceStatus.loading) { + return LoadingWidget(); + } else if (data.value.status == ResourceStatus.error) { + return ErrorWidget('خطا در دریافت اطلاعات کاربر'); + } else if (data.value.status == ResourceStatus.success) { + UserProfile item = data.value.data!; + return Column( + spacing: 6, + children: [ + buildRowOnTapped( + onTap: () { + Get.bottomSheet( + userInformationBottomSheet(), isScrollControlled: true, ignoreSafeArea: false); + }, + titleWidget: Column( + spacing: 3, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'اطلاعات هویتی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Container(width: 37.w, height: 1.h, color: AppColor.greenNormal), + ], + ), + valueWidget: Assets.vec.editSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + itemList( + title: 'نام و نام خانوادگی', + content: item.fullname ?? 'نامشخص', + icon: Assets.vec.userSvg.path, + hasColoredBox: true, + ), + itemList( + title: 'موبایل', + content: item.mobile ?? 'نامشخص', + icon: Assets.vec.callSvg.path, + ), + itemList( + title: 'کدملی', + content: item.nationalId ?? 'نامشخص', + icon: Assets.vec.tagUserSvg.path, + ), + itemList( + title: 'شماره شناسنامه', + content: item.nationalCode ?? 'نامشخص', + icon: Assets.vec.userSquareSvg.path, + ), + itemList( + title: 'تاریخ تولد', + content: item.birthday?.toJalali.formatCompactDate() ?? 'نامشخص', + icon: Assets.vec.calendarSvg.path, + ), + itemList( + title: 'استان', + content: item.province ?? 'نامشخص', + icon: Assets.vec.pictureFrameSvg.path, + ), + itemList(title: 'شهر', content: item.city ?? 'نامشخص', icon: Assets.vec.mapSvg.path), + ], + ); + } else { + return SizedBox.shrink(); + } + }, controller.userProfile); + } + + Widget itemList({ + required String title, + required String content, + String? icon, + bool hasColoredBox = false, + }) => + Container( + padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h), + decoration: BoxDecoration( + color: hasColoredBox ? AppColor.greenLight : Colors.transparent, + borderRadius: BorderRadius.circular(8), + border: hasColoredBox + ? Border.all(width: 0.25, color: AppColor.bgDark) + : Border.all(width: 0, color: Colors.transparent), + ), + child: Row( + spacing: 4, + children: [ + if (icon != null) + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: SvgGenImage.vec(icon).svg( + width: 20.w, + height: 20.h, + colorFilter: ColorFilter.mode(AppColor.mediumGreyNormalActive, BlendMode.srcIn), + ), + ), + Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyNormalActive)), + Spacer(), + Text(content, style: AppFonts.yekan13.copyWith(color: AppColor.mediumGreyNormalHover)), + ], + ), + ); + + Widget cardActionWidget({ + required String title, + required VoidCallback onPressed, + required String icon, + bool selected = false, + ColorFilter? color, + Color? cardColor, + Color? textColor, + }) { + return GestureDetector( + onTap: onPressed, + child: Column( + spacing: 4, + children: [ + Container( + width: 52, + height: 52, + padding: EdgeInsets.all(8), + decoration: ShapeDecoration( + color: cardColor ?? AppColor.blueLight, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: SvgGenImage.vec(icon).svg( + width: 40, + height: 40, + colorFilter: + color ?? + ColorFilter.mode( + selected ? AppColor.blueNormal : AppColor.whiteLight, + BlendMode.srcIn, + ), + ), + ), + SizedBox(height: 2), + Text( + title, + style: AppFonts.yekan10.copyWith( + color: textColor ?? (selected ? AppColor.blueNormal : AppColor.blueLightActive), + ), + textAlign: TextAlign.center, + ), + ], + ), + ); + } + + Widget userInformationBottomSheet() { + return BaseBottomSheet( + height: 750.h, + child: SingleChildScrollView( + child: Column( + spacing: 8, + children: [ + Text( + 'ویرایش اطلاعات هویتی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), + ), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + RTextField( + controller: controller.nameController, + label: 'نام', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.lastNameController, + label: 'نام خانوادگی', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.nationalCodeController, + label: 'شماره شناسنامه', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.nationalIdController, + label: 'کد ملی', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + + ObxValue((data) { + return RTextField( + controller: controller.birthdayController, + label: 'تاریخ تولد', + initText: data.value?.formatCompactDate() ?? '', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + onTap: () {}, + ); + }, controller.birthDate), + + SizedBox(), + + + ], + ), + ), + SizedBox(), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 8, + children: [ + Text('عکس پروفایل', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + ObxValue((data) { + return Container( + width: Get.width, + height: 270, + decoration: BoxDecoration( + color: AppColor.lightGreyNormal, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLight), + ), + child: Center( + child: data.value == null + ? Padding( + padding: const EdgeInsets.fromLTRB(30, 10, 10, 30), + child: Image.network(controller.userProfile.value.data?.image ?? '') + ) + : Image.file(File(data.value!.path), fit: BoxFit.cover), + ), + ); + }, controller.selectedImage), + + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + text: 'گالری', + width: 150.w, + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + onPressed: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.gallery, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + ), + SizedBox(width: 16), + ROutlinedElevated( + text: 'دوربین', + width: 150.w, + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal), + onPressed: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.camera, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + ), + ], + ), + ], + ), + ), + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ObxValue((data) { + return RElevated( + height: 40.h, + text: 'ویرایش', + isLoading: data.value, + onPressed: () async { + await controller.updateUserProfile(); + controller.getUserProfile(); + Get.back(); + }, + ); + },controller.isOnLoading), + ROutlinedElevated( + height: 40.h, + text: 'انصراف', + borderColor: AppColor.blueNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + ); + } + + Widget _provinceWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.provinces, + onChanged: (value) { + controller.selectedProvince.value = value; + }, + selectedItem: controller.selectedProvince.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'), + ); + }); + } + + Widget _cityWidget() { + return ObxValue((data) { + return OverlayDropdownWidget( + items: data, + onChanged: (value) { + controller.selectedCity.value = value; + }, + selectedItem: controller.selectedCity.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'), + ); + }, controller.cites); + } + + Widget changePasswordBottomSheet() { + return BaseBottomSheet( + height: 400.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text( + 'تغییر رمز عبور', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), + ), + SizedBox(), + RTextField( + controller: controller.oldPasswordController, + hintText: 'رمز عبور قبلی', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'رمز عبور را وارد کنید'; + } else if (controller.userProfile.value.data?.password != value) { + return 'رمز عبور صحیح نیست'; + } + return null; + }, + ), + RTextField( + controller: controller.newPasswordController, + hintText: 'رمز عبور جدید', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'رمز عبور را وارد کنید'; + } else if (value.length < 6) { + return 'رمز عبور باید بیش از 6 کارکتر باشد.'; + } + return null; + }, + ), + RTextField( + controller: controller.retryNewPasswordController, + hintText: 'تکرار رمز عبور جدید', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'رمز عبور را وارد کنید'; + } else if (value.length < 6) { + return 'رمز عبور باید بیش از 6 کارکتر باشد.'; + } else if (controller.newPasswordController.text != value) { + return 'رمز عبور جدید یکسان نیست'; + } + return null; + }, + ), + + SizedBox(), + + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + height: 40.h, + text: 'ویرایش', + onPressed: () async { + if (controller.formKey.currentState?.validate() != true) { + return; + } + await controller.updatePassword(); + controller.getUserProfile(); + controller.clearPasswordForm(); + Get.back(); + }, + ), + ROutlinedElevated( + height: 40.h, + text: 'انصراف', + borderColor: AppColor.blueNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + ), + ); + } + + Widget exitBottomSheet() { + return BaseBottomSheet( + height: 220.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text('خروج', style: AppFonts.yekan16Bold.copyWith(color: AppColor.error)), + SizedBox(), + Text( + 'آیا مطمئن هستید که می‌خواهید از حساب کاربری خود خارج شوید؟', + textAlign: TextAlign.center, + style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor), + ), + + SizedBox(), + + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + height: 40.h, + text: 'خروج', + backgroundColor: AppColor.error, + onPressed: () async { + await controller.rootLogic.tokenService.deleteTokens().then((value) { + Get.back(); + Get.offAllNamed(ChickenRoutes.auth, arguments: Module.chicken); + }); + }, + ), + ROutlinedElevated( + height: 40.h, + text: 'انصراف', + borderColor: AppColor.blueNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/root/logic.dart b/packages/chicken/lib/presentation/pages/root/logic.dart new file mode 100644 index 0000000..570614a --- /dev/null +++ b/packages/chicken/lib/presentation/pages/root/logic.dart @@ -0,0 +1,160 @@ +import 'dart:async'; + +import 'package:flutter/widgets.dart'; +import 'package:rasadyar_chicken/data/data_source/local/chicken_local_imp.dart'; +import 'package:rasadyar_chicken/data/di/chicken_di.dart'; +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; +import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart'; +import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository_imp.dart'; + +import 'package:rasadyar_chicken/presentation/pages/buy/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/home/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/profile/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/segmentation/view.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +enum ErrorLocationType { serviceDisabled, permissionDenied, none } + +class RootLogic extends GetxController { + RxInt currentPage = 2.obs; + List pages = [BuyPage(), SalePage(), HomePage(), SegmentationPage(), ProfilePage()]; + + final defaultRoutes = {0: ChickenRoutes.buy, 1: ChickenRoutes.sale}; + RxList rolesProductsModel = RxList(); + Rxn widelyUsedList = Rxn(); + + late DioRemote dioRemote; + var tokenService = Get.find(); + late ChickenRepository chickenRepository; + late ChickenLocalDataSourceImp localDatasource; + + RxList errorLocationType = RxList(); + RxMap inventoryExpandedList = RxMap(); + Rxn inventoryModel = Rxn(); + RxList provinces = [].obs; + + // Cancel tokens for API calls + CancelToken? _inventoryCancelToken; + CancelToken? _provincesCancelToken; + + @override + void onInit() { + super.onInit(); + localDatasource = diChicken.get(); + chickenRepository = diChicken.get(); + localDatasource.openBox().then((value) async { + widelyUsedList.value = localDatasource.getAllWidely(); + }); + + + } + + @override + void onReady() { + super.onReady(); + + if (provinces.isEmpty) { + getProvinces(); + } + if (inventoryModel.value == null) { + getInventory(); + } + if (rolesProductsModel.isEmpty) { + getRolesProducts(); + } + + if (widelyUsedList.value?.hasInit != true) { + localDatasource.initWidleyUsed().then((value) => localDatasource.getAllWidely()); + } + } + + @override + void onClose() { + // Cancel any ongoing requests when controller is disposed + _inventoryCancelToken?.cancel(); + _provincesCancelToken?.cancel(); + super.onClose(); + } + + void toggleExpanded(int index) { + if (inventoryExpandedList.keys.contains(index)) { + inventoryExpandedList.remove(index); + } else { + inventoryExpandedList[index] = false; + } + } + + Future getInventory() async { + // Cancel previous request if still running + _inventoryCancelToken?.cancel(); + _inventoryCancelToken = CancelToken(); + + await safeCall?>( + call: () async => await chickenRepository.getInventory( + token: tokenService.accessToken.value!, + cancelToken: _inventoryCancelToken, + ), + onSuccess: (result) { + if (result != null) { + inventoryModel.value = result.first; + } + }, + onError: (error, stackTrace) { + if (error is DioException && error.type == DioExceptionType.cancel) { + // Request was cancelled, ignore the error + return; + } + }, + ); + } + + void rootErrorHandler(DioException error) { + handleGeneric(error, () { + tokenService.deleteTokens(); + }); + } + + void changePage(int index) { + currentPage.value = index; + } + + Future getProvinces() async { + // Cancel previous request if still running + _provincesCancelToken?.cancel(); + _provincesCancelToken = CancelToken(); + + try { + final res = await chickenRepository.getProvince(cancelToken: _provincesCancelToken); + if (res != null) { + provinces.clear(); + provinces.value = res; + } + } catch (e) { + if (e is DioException && e.type == DioExceptionType.cancel) { + // Request was cancelled, ignore the error + return; + } + provinces.clear(); + } + } + + Future getRolesProducts() async { + safeCall( + call: () async => + await chickenRepository.getRolesProducts(token: tokenService.accessToken.value!), + onSuccess: (result) { + if (result != null) { + rolesProductsModel.value = result; + } + }, + onError: (error, stacktrace) {}, + ); + } + +} diff --git a/packages/chicken/lib/presentation/pages/root/view.dart b/packages/chicken/lib/presentation/pages/root/view.dart new file mode 100644 index 0000000..cceffb6 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/root/view.dart @@ -0,0 +1,641 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart'; +import 'package:rasadyar_core/core.dart'; + +class RootPage extends GetView { + RootPage({super.key}); + + DateTime? _lastBackPressed; + + @override + Widget build(BuildContext context) { + return ObxValue((data) { + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) async { + final nestedKey = Get.nestedKey(controller.currentPage.value); + final currentNavigator = nestedKey?.currentState; + + if (currentNavigator?.canPop() ?? false) { + currentNavigator?.pop(); + } else { + final now = DateTime.now(); + if (_lastBackPressed == null || + now.difference(_lastBackPressed!) > Duration(seconds: 2)) { + _lastBackPressed = now; + Get.snackbar( + 'خروج از برنامه', + 'برای خروج دوباره بازگشت را بزنید', + snackPosition: SnackPosition.TOP, + duration: Duration(seconds: 2), + backgroundColor: AppColor.warning, + ); + } else { + await SystemNavigator.pop(); + } + } + }, + child: Scaffold( + backgroundColor: AppColor.bgLight, + body: IndexedStack( + children: [ + Navigator( + key: Get.nestedKey(0), + onGenerateRoute: (settings) { + final page = ChickenPages.pages.firstWhere( + (e) => e.name == settings.name, + orElse: () => ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.buy), + ); + + return buildRouteFromGetPage(page); + }, + ), + Navigator( + key: Get.nestedKey(1), + onGenerateRoute: (settings) { + final page = ChickenPages.pages.firstWhere( + (e) => e.name == settings.name, + orElse: () => + ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.sale), + ); + + return buildRouteFromGetPage(page); + }, + ), + Navigator( + key: Get.nestedKey(2), + onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]), + ), + Navigator( + key: Get.nestedKey(3), + onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]), + ), + Navigator( + key: Get.nestedKey(4), + onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]), + ), + ], + index: data.value, + ), + + bottomNavigationBar: RBottomNavigation( + items: [ + RBottomNavigationItem( + label: 'خرید', + icon: Assets.vec.buySvg.path, + isSelected: controller.currentPage.value == 0, + onTap: () { + Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); + + controller.changePage(0); + }, + ), + RBottomNavigationItem( + label: 'فروش', + icon: Assets.vec.saleSvg.path, + isSelected: controller.currentPage.value == 1, + onTap: () { + Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); + controller.changePage(1); + }, + ), + RBottomNavigationItem( + label: 'خانه', + icon: Assets.vec.homeSvg.path, + isSelected: controller.currentPage.value == 2, + onTap: () { + Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); + Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); + controller.changePage(2); + }, + ), + RBottomNavigationItem( + label: 'قطعه بندی', + icon: Assets.vec.convertCubeSvg.path, + isSelected: controller.currentPage.value == 3, + onTap: () { + Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); + Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); + controller.changePage(3); + }, + ), + RBottomNavigationItem( + label: 'پروفایل', + icon: Assets.vec.profileCircleSvg.path, + isSelected: controller.currentPage.value == 4, + onTap: () { + Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); + Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); + + controller.changePage(4); + }, + ), + ], + ), + ), + ); + }, controller.currentPage); + } + + Container _todayShipmentWidget() { + return Container( + height: 70, + width: Get.width / 2, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + clipBehavior: Clip.hardEdge, + child: Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [const Color(0xFFEAEFFF), Colors.white], + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Assets.icons.cubeScan.svg(width: 30.w, height: 30), + Text( + 'بارهای امروز', + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + '2،225،256', + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith(color: AppColor.textColor), + ), + Text( + 'کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + ], + ), + ); + } + + Container _informationLabelCard({ + required String title, + required String description, + String unit = 'کیلوگرم', + required String iconPath, + required Color iconColor, + required Color bgDescriptionColor, + required Color bgLabelColor, + }) { + return Container( + height: 82, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)), + clipBehavior: Clip.hardEdge, + child: Row( + children: [ + // Left side with icon and title + Expanded( + child: Container( + height: 82, + decoration: BoxDecoration( + color: bgLabelColor, + borderRadius: BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn), + ), + Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive), + ), + ], + ), + ), + ), + // Right side with description and unit + Expanded( + child: Container( + decoration: BoxDecoration( + color: bgDescriptionColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + description, + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive), + ), + Text( + unit, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive), + ), + ], + ), + ), + ), + ], + ), + ); + } + + Container _informationIconCard({ + required String title, + required String description, + String unit = 'کیلوگرم', + required String iconPath, + required Color iconColor, + required Color bgDescriptionColor, + required Color bgLabelColor, + }) { + return Container( + height: 110, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)), + clipBehavior: Clip.hardEdge, + child: Stack( + alignment: Alignment.topCenter, + children: [ + Positioned( + bottom: 0, + right: 0, + left: 0, + child: Container( + height: 91, + decoration: BoxDecoration( + color: bgDescriptionColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 0.25, color: const Color(0xFFB4B4B4)), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive), + ), + Text( + description, + textAlign: TextAlign.right, + style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive), + ), + Text( + unit, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive), + ), + ], + ), + ), + ), + Positioned( + top: 0, + child: Container( + width: 32, + height: 32, + decoration: ShapeDecoration( + color: bgLabelColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + side: BorderSide(width: 0.25, color: const Color(0xFFD5D5D5)), + ), + ), + child: Center( + child: SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn), + ), + ), + ), + ), + ], + ), + ); + } + + Widget widelyUsed({ + required String title, + required String iconPath, + required VoidCallback onTap, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + spacing: 4, + children: [ + Container( + width: 48, + height: 48, + padding: EdgeInsets.all(4), + decoration: ShapeDecoration( + color: const Color(0xFFBECDFF), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Container( + width: 40, + height: 40, + decoration: ShapeDecoration( + color: AppColor.blueNormal, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + fit: BoxFit.cover, + ), + ), + ), + Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + ], + ); + } + + Widget addWidelyUsed({required VoidCallback onTap}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + spacing: 4, + children: [ + Container( + width: 48, + height: 48, + padding: EdgeInsets.all(4), + decoration: ShapeDecoration( + color: const Color(0xFFD9F7F0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Assets.vec.messageAddSvg.svg( + width: 40, + height: 40, + colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn), + fit: BoxFit.cover, + ), + ), + Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)), + ], + ); + } + + /*Column oldPage() { + return Column( + children: [ + inventoryWidget(), + ObxValue((data) => broadcastInformationWidget(data.value), controller.killHouseDistributionInfo), + SizedBox(height: 20), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + cardWidget( + title: 'ورود به انبار', + iconPath: Assets.icons.whareHouse.path, + onTap: () { + Get.toNamed(ChickenRoutes.enteringTheWarehouse); + }, + ), + cardWidget( + title: 'فروش داخل استان', + iconPath: Assets.icons.inside.path, + onTap: () { + Get.toNamed(ChickenRoutes.salesInProvince); + }, + ), + cardWidget( + title: 'فروش خارج استان', + iconPath: Assets.icons.outside.path, + onTap: () { + Get.toNamed(ChickenRoutes.salesOutOfProvince); + }, + ), + ], + ), + ), + ], + ); + } + + Widget inventoryWidget() { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + children: [ + const SizedBox(height: 20), + Align( + alignment: Alignment.centerRight, + child: Text('موجودی انبار', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + ), + SizedBox(height: 4), + ObxValue( + (data) => + data.isEmpty + ? Container( + margin: const EdgeInsets.symmetric(vertical: 2), + height: 80, + padding: EdgeInsets.all(6), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.blueNormal, width: 1), + ), + child: Center(child: CircularProgressIndicator()), + ) + : ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: controller.inventoryList.length, + separatorBuilder: (context, index) => const SizedBox(height: 8), + itemBuilder: (context, index) { + return ObxValue((expand) { + return GestureDetector( + onTap: () { + controller.toggleExpanded(index); + }, + behavior: HitTestBehavior.opaque, + child: AnimatedContainer( + onEnd: () { + controller.inventoryExpandedList[index] = !controller.inventoryExpandedList[index]!; + }, + margin: const EdgeInsets.symmetric(vertical: 2), + padding: EdgeInsets.all(6), + curve: Curves.easeInOut, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.blueNormal, width: 1), + ), + duration: const Duration(seconds: 1), + height: expand.keys.contains(index) ? 250 : 80, + child: inventoryItem( + isExpanded: expand.keys.contains(index) && expand[index]!, + index: index, + model: controller.inventoryList[index], + ), + ), + ); + }, controller.inventoryExpandedList); + }, + ), + controller.inventoryList, + ), + ], + ), + ); + } + + Widget inventoryItem({required bool isExpanded, required int index, required InventoryModel model}) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + buildRow('نام محصول', model.name ?? ''), + Visibility( + visible: isExpanded, + child: Column( + spacing: 8, + children: [ + buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'), + buildRow('وزن خریدهای آزاد داخل استان (کیلوگرم)', model.receiveFreeCarcassesWeight.toString()), + buildRow('وزن خریدهای خارج استان (کیلوگرم)', model.freeBuyingCarcassesWeight.toString()), + buildRow('کل ورودی به انبار (کیلوگرم)', model.totalFreeBarsCarcassesWeight.toString()), + buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()), + buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()), + ], + ), + ), + ], + ); + }*/ + + Widget buildRow(String title, String value) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 2, + child: Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + Flexible( + flex: 1, + child: Text( + value, + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + ], + ), + ); + } + + Widget broadcastInformationWidget(KillHouseDistributionInfo? model) { + return Container( + height: 140, + margin: const EdgeInsets.all(8), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.blueNormal, width: 1), + ), + child: model != null + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 10, + children: [ + Text( + 'اطلاعات ارسالی', + textAlign: TextAlign.right, + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + const SizedBox(height: 12), + buildRow( + 'فروش و توزیع داخل استان (کیلوگرم)', + model.stewardAllocationsWeight!.toInt().toString(), + ), + buildRow( + 'فروش و توزیع خارج استان (کیلوگرم)', + model.freeSalesWeight!.toInt().toString(), + ), + ], + ) + : const Center(child: CircularProgressIndicator()), + ); + } + + Widget cardWidget({ + required String title, + required String iconPath, + required VoidCallback onTap, + }) { + return Container( + width: Get.width / 4, + height: 130, + child: GestureDetector( + onTap: onTap, + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide(width: 1, color: AppColor.blueNormal), + ), + child: Padding( + padding: EdgeInsets.all(16), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgGenImage(iconPath).svg(width: 50, height: 50), + SizedBox(height: 4), + Text( + title, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/sale/logic.dart b/packages/chicken/lib/presentation/pages/sale/logic.dart new file mode 100644 index 0000000..0b39907 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sale/logic.dart @@ -0,0 +1,117 @@ + +import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +class SaleLogic extends GetxController { + Rxn?> allocatedMadeModel = Rxn?>(); + + RxList guildsModel = [].obs; + + Rxn stewardFreeDashboard = Rxn(); + + RootLogic rootLogic = Get.find(); + + List routesName = ['فروش']; + + + @override + void onReady() { + super.onReady(); + getStewardDashBord(); + + } + + Future getAllocatedMade() async { + safeCall( + call: () async => await rootLogic.chickenRepository.getAllocatedMade( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams(page: 1, pageSize: 20, search: 'filter', role: 'Steward'), + ), + onSuccess: (result) { + if (result != null) { + allocatedMadeModel.value = result.results; + } + }, + onError: (error, stacktrace) {}, + ); + } + + void checkVerfication() {} + + void confirmAllocation(ConformAllocation allocation) { + safeCall( + call: () async => await rootLogic.chickenRepository.confirmAllocation( + token: rootLogic.tokenService.accessToken.value!, + allocation: allocation.toJson(), + ), + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stacktrace) {}, + ); + } + + void denyAllocation(String token) { + safeCall( + call: () async => await rootLogic.chickenRepository.denyAllocation( + token: rootLogic.tokenService.accessToken.value!, + allocationToken: token, + ), + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stacktrace) {}, + ); + } + + Future confirmAllAllocations() async { + safeCall( + call: () async => await rootLogic.chickenRepository.confirmAllAllocation( + token: rootLogic.tokenService.accessToken.value!, + allocationTokens: allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [], + ), + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stacktrace) {}, + ); + } + + + Future getGuilds() async {} + + Future addSale() async {} + + void setSelectedGuild(GuildModel value) {} + + void setSelectedProduct(ProductModel value) {} + + Future getStewardDashBord() async { + safeCall( + call: () async => await rootLogic.chickenRepository.getStewardDashboard( + token: rootLogic.tokenService.accessToken.value!, + stratDate: DateTime.now().formattedDashedGregorian, + endDate: DateTime.now().formattedDashedGregorian, + ), + onSuccess: (result) { + if (result != null) { + stewardFreeDashboard.value = result; + } + }, + onError: (error, stacktrace) {}, + ); + } + + Future submitAllocation() async {} + + @override + void dispose() { + rootLogic.inventoryExpandedList.clear(); + super.dispose(); + } +} diff --git a/packages/chicken/lib/presentation/pages/sale/view.dart b/packages/chicken/lib/presentation/pages/sale/view.dart new file mode 100644 index 0000000..12710e7 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sale/view.dart @@ -0,0 +1,186 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/sale_buy_card_item.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SalePage extends GetView { + SalePage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + routes: controller.routesName, + isBase: true, + widgets: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Wrap( + alignment: WrapAlignment.center, + spacing: 14.w, + children: [ + saleOrBuyItemCard( + title: 'فروش داخل استان', + iconPath: Assets.vec.cubeSvg.path, + onTap: () { + Get.toNamed(ChickenRoutes.salesInProvince, id: 1); + }, + ), + saleOrBuyItemCard( + title: 'فروش خارج استان', + iconPath: Assets.vec.truckFastSvg.path, + onTap: () { + Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1); + }, + ), + ], + ), + ], + ), + ], + ); + } + + Widget addSaleOutOfTheProvinceBottomSheet() { + return BaseBottomSheet( + child: Column( + children: [ + const SizedBox(height: 20), + Align( + alignment: Alignment.centerRight, + child: Text( + 'ثبت فروش خارج استان', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + ), + SizedBox(height: 4), + RElevated(text: 'ثبت توزیع/ فروش', onPressed: () {}), + ], + ), + ); + } + + Widget _typeOuterInfoCard({ + required String title, + required String iconPath, + required Color foregroundColor, + VoidCallback? onTap, + }) { + return InkWell( + onTap: onTap, + child: Container( + height: 180, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: foregroundColor), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + Positioned( + top: -41, + child: SvgGenImage.vec(iconPath).svg( + width: 45, + height: 45, + colorFilter: ColorFilter.mode(foregroundColor, BlendMode.srcIn), + ), + ), + + Assets.vec.shoppingBasketSvg.svg( + width: 55, + height: 60, + colorFilter: ColorFilter.mode(foregroundColor, BlendMode.srcIn), + fit: BoxFit.cover, + ), + ], + ), + const SizedBox(height: 15), + + Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan16Bold.copyWith(color: foregroundColor), + ), + ], + ), + ), + ); + } + + Widget summaryOfInformation(StewardFreeBarDashboard? model) { + return Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + children: [ + Text( + 'خلاصه اطلاعات', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + Container( + height: 140, + margin: const EdgeInsets.all(8), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.blueNormal, width: 1), + ), + child: model == null + ? const Center(child: CircularProgressIndicator()) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 10, + children: [ + const SizedBox(height: 12), + buildRow('تعداد کل بارها', model.totalQuantity?.toString() ?? '0'), + buildRow('تعداد کل', model.totalBars?.toString() ?? '0'), + buildRow('وزن کل (کیلوگرم)', model.totalWeight?.toString() ?? '0'), + ], + ), + ), + ], + ); + } + + Widget buildRow(String title, String value) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 2, + child: Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + Flexible( + flex: 2, + child: Text( + value, + textAlign: TextAlign.left, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_in_province/logic.dart b/packages/chicken/lib/presentation/pages/sales_in_province/logic.dart new file mode 100644 index 0000000..2d255d8 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_in_province/logic.dart @@ -0,0 +1,419 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; + +import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart'; +import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class SalesInProvinceLogic extends GetxController { + RootLogic rootLogic = Get.find(); + SaleLogic saleLogic = Get.find(); + RxnString searchedValue = RxnString(); + RxList isExpandedList = [].obs; + RxList routesName = RxList(); + Rx bgConfirmAllColor = AppColor.blueNormal.obs; + final RxBool isLoadingMoreAllocationsMade = false.obs; + Timer? _flashingTimer; + + Rx>> allocatedList = + Resource>.loading().obs; + + RxList rolesProductsModel = RxList(); + + RxList guildsModel = [].obs; + + GlobalKey formKey = GlobalKey(); + + Rxn fromDateFilter = Rxn(null); + Rxn toDateFilter = Rxn(null); + Rxn selectedProductModel = Rxn(); + Rxn selectedGuildModel = Rxn(); + Rxn guildProfile = Rxn(); + RxInt saleType = 1.obs; + RxInt weight = 0.obs; + RxInt pricePerKilo = 0.obs; + RxInt totalCost = 0.obs; + RxBool isValid = false.obs; + final weightController = TextEditingController(); + final pricePerKiloController = TextEditingController(); + final totalCostController = TextEditingController(); + + final ScrollController scrollControllerAllocationsMade = ScrollController(); + final RxInt currentPage = 1.obs; + final RxBool addPageAllocationsMade = false.obs; + final RxBool hasMoreDataAllocationsMade = true.obs; + + Rxn selectedAllocationModelForUpdate = Rxn(); + SubmitStewardAllocation? tmpStewardAllocation; + + @override + void onInit() { + super.onInit(); + routesName.value = [...saleLogic.routesName, 'داخل استان'].toList(); + getAllocatedMade(); + getRolesProducts(); + getGuilds(); + getGuildProfile(); + ever(saleType, (callback) { + getGuilds(); + }); + debounce(weight, time: Duration(milliseconds: 110), (callback) { + totalCost.value = callback * weight.value; + }); + + debounce(pricePerKilo, time: Duration(milliseconds: 100), (callback) { + totalCost.value = callback * weight.value; + }); + + + totalCost.listen((data) { + totalCostController.text = data + .toString() + .separatedByComma; + + isValid.value = + weight.value > 0 && + pricePerKilo.value > 0 && + totalCost.value > 0 && + selectedProductModel.value != null && + selectedGuildModel.value != null; + }); + everAll([ + totalCost, + weight, + pricePerKilo, + totalCost, + selectedProductModel, + selectedGuildModel + ], (callback) => checkVerification(),); + + scrollControllerAllocationsMade.addListener(() { + if (scrollControllerAllocationsMade.position.pixels >= + scrollControllerAllocationsMade.position.maxScrollExtent - 100) { + addPageAllocationsMade.value = true; + getAllocatedMade(); + } + }); + + debounce( + searchedValue, + (callback) => getAllocatedMade(), + time: Duration(milliseconds: timeDebounce), + ); + } + + Future getAllocatedMade([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + allocatedList.value = Resource>.loading(); + } + + if (searchedValue.value != null && + searchedValue.value!.trim().isNotEmpty && + currentPage.value > 1) { + currentPage.value = 1; // Reset to first page if search value is set + } + + safeCall( + call: () async => + await rootLogic.chickenRepository.getAllocatedMade( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + page: currentPage.value, + pageSize: 20, + search: 'filter', + role: 'Steward', + value: searchedValue.value, + ), + ), + onSuccess: (res) async { + await Future.delayed(Duration(milliseconds: 200)); + if ((res?.count ?? 0) == 0) { + allocatedList.value = Resource>.empty(); + } else { + allocatedList.value = Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: isLoadingMore + ? [...(allocatedList.value.data?.results ?? []), ...(res?.results ?? [])] + : res?.results ?? [], + ), + ); + isLoadingMoreAllocationsMade.value = false; + if ((allocatedList.value.data?.results?.length ?? 0) > 1) { + flashingFabBgColor(); + } + } + }, + onError: (error, stacktrace) { + isLoadingMoreAllocationsMade.value = false; + }, + ); + } + + void checkVerification() { + isValid.value = + weight.value > 0 && + pricePerKilo.value > 0 && + totalCost.value > 0 && + selectedProductModel.value != null && + selectedGuildModel.value != null; + } + + void confirmAllocation(ConformAllocation allocation) { + safeCall( + call: () async => + await rootLogic.chickenRepository.confirmAllocation( + token: rootLogic.tokenService.accessToken.value!, + allocation: allocation.toJson(), + ), + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stacktrace) {}, + ); + } + + void denyAllocation(String token) { + safeCall( + call: () async => + await rootLogic.chickenRepository.denyAllocation( + token: rootLogic.tokenService.accessToken.value!, + allocationToken: token, + ), + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stacktrace) {}, + ); + } + + Future confirmAllAllocations() async { + safeCall( + call: () async => + await rootLogic.chickenRepository.confirmAllAllocation( + token: rootLogic.tokenService.accessToken.value!, + allocationTokens: allocatedList.value.data?.results?.map((e) => e.key!).toList() ?? [], + ), + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stacktrace) {}, + ); + } + + Future getRolesProducts() async { + safeCall( + call: () async => + await rootLogic.chickenRepository.getRolesProducts( + token: rootLogic.tokenService.accessToken.value!, + ), + onSuccess: (result) { + if (result != null) { + rolesProductsModel.value = result; + selectedProductModel.value = result.first; + } + }, + onError: (error, stacktrace) {}, + ); + } + + Future getGuilds() async { + safeCall( + call: () async => + await rootLogic.chickenRepository.getGuilds( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + queryParams: {'free': saleType.value == 2 ? true : false}, + role: 'Steward', + ), + ), + onSuccess: (result) { + if (result != null) { + guildsModel.clear(); + guildsModel.addAll(result); + } + }, + onError: (error, stacktrace) {}, + ); + } + + Future addSale() async {} + + void setSelectedGuild(GuildModel value) { + selectedGuildModel.value = value; + update(); + } + + void setSelectedProduct(ProductModel value) { + selectedProductModel.value = value; + update(); + } + + Future getGuildProfile() async { + await safeCall( + call: () async => + await rootLogic.chickenRepository.getProfile( + token: rootLogic.tokenService.accessToken.value!, + ), + onError: (error, stackTrace) {}, + onSuccess: (result) { + guildProfile.value = result; + }, + ); + } + + void setSubmitData() { + tmpStewardAllocation = SubmitStewardAllocation( + approvedPriceStatus: false, + allocationType: + '${guildProfile.value?.steward == true ? "steward" : "guild"}_${selectedGuildModel.value + ?.steward == true ? "steward" : "guild"}', + sellerType: guildProfile.value?.steward == true ? "Steward" : "Guild", + buyerType: selectedGuildModel.value?.steward == true ? "Steward" : "Guild", + amount: pricePerKilo.value, + totalAmount: totalCost.value, + weightOfCarcasses: weight.value, + sellType: saleType.value == 2 ? "free" : 'exclusive', + numberOfCarcasses: 0, + guildKey: selectedGuildModel.value?.key, + productKey: selectedProductModel.value?.key, + date: DateTime + .now() + .formattedDashedGregorian, + type: "manual", + ); + } + + Future submitAllocation() async { + safeCall( + call: () async => + await rootLogic.chickenRepository.postSubmitStewardAllocation( + token: rootLogic.tokenService.accessToken.value!, + request: tmpStewardAllocation!, + ), + + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stackTrace) {}, + ); + } + + Future deleteAllocation(AllocatedMadeModel model) async { + safeCall( + call: () async => + await rootLogic.chickenRepository.deleteStewardAllocation( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: {'steward_allocation_key': model.key}, + ), + + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stackTrace) {}, + ); + } + + @override + void dispose() { + rootLogic.inventoryExpandedList.clear(); + stopFlashing(); + super.dispose(); + } + + void setEditData(AllocatedMadeModel item) { + selectedAllocationModelForUpdate.value = item; + selectedProductModel.value = rolesProductsModel.first; + selectedGuildModel.value = GuildModel(guildsName: 'tst'); + weight.value = item.weightOfCarcasses ?? 0; + pricePerKilo.value = item.amount ?? 0; + totalCost.value = item.totalAmount ?? 0; + weightController.text = weight.value + .toString() + .separatedByComma; + pricePerKiloController.text = pricePerKilo.value + .toString() + .separatedByComma; + totalCostController.text = totalCost.value + .toString() + .separatedByComma; + isValid.value = true; + } + + void clearForm() { + selectedGuildModel.value = null; + weight.value = 0; + pricePerKilo.value = 0; + totalCost.value = 0; + weightController.clear(); + pricePerKiloController.clear(); + totalCostController.clear(); + isValid.value = false; + } + + Future updateAllocation() async { + ConformAllocation updatedAllocationModel = ConformAllocation( + allocation_key: selectedAllocationModelForUpdate.value?.key, + amount: pricePerKilo.value, + total_amount: totalCost.value, + number_of_carcasses: 0, + weight_of_carcasses: weight.value, + ); + + safeCall( + call: () async => + await rootLogic.chickenRepository.updateStewardAllocation( + token: rootLogic.tokenService.accessToken.value!, + request: updatedAllocationModel, + ), + + onSuccess: (result) { + getAllocatedMade(); + }, + onError: (error, stackTrace) {}, + ); + } + + void setSearchValue(String? data) { + searchedValue.value = data?.trim(); + } + + void flashingFabBgColor() { + _flashingTimer?.cancel(); + + _flashingTimer = Timer.periodic(Duration(seconds: 2), (timer) { + if (bgConfirmAllColor.value == AppColor.blueNormal) { + bgConfirmAllColor.value = AppColor.blueLightHover; + } else { + bgConfirmAllColor.value = AppColor.blueNormal; + } + }); + } + + void stopFlashing() { + _flashingTimer?.cancel(); + _flashingTimer = null; + bgConfirmAllColor.value = AppColor.blueNormal; // بازگرداندن به رنگ پیش‌فرض + } + + Steward? getBuyerInformation(AllocatedMadeModel model) { + if (model.allocationType?.buyerIsGuild) { + return model.toGuilds; + } else { + return model.steward; + } + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart new file mode 100644 index 0000000..6930717 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart @@ -0,0 +1,831 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; + +import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SalesInProvincePage extends GetView { + SalesInProvincePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: BasePage( + routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName), + onBackPressed: () => Get.back(id: 1), + onSearchChanged: (data) => controller.setSearchValue(data), + filteringWidget: filterBottomSheet(), + widgets: [ + inventoryWidget(controller.rootLogic), + Expanded( + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + isPaginating: controller.isLoadingMoreAllocationsMade.value, + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getAllocatedMade(); + }, + onLoadMore: () async { + controller.currentPage.value++; + iLog(controller.currentPage.value); + await controller.getAllocatedMade(true); + }, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item, index), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.timerSvg.path, + labelIconColor: item.registrationCode == null + ? AppColor.darkGreyDark + : AppColor.error, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.allocatedList), + ), + ], + ), + floatingActionButton: SizedBox( + width: Get.width - 30, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RFab.add( + onPressed: () { + Get.bottomSheet( + addOrEditBottomSheet(), + isScrollControlled: true, + backgroundColor: Colors.transparent, + ).whenComplete(() { + controller.clearForm(); + }); + }, + ), + + ObxValue((data) { + return Visibility( + visible: (data.value.data?.results?.length ?? 0) > 1, + child: AnimatedFab( + onPressed: () async { + Get.defaultDialog( + title: 'تایید یکجا', + middleText: 'آیا از تایید تمامی تخصیص ها اطمینان دارید؟', + confirm: ElevatedButton( + onPressed: () async { + await controller.confirmAllAllocations(); + controller.getAllocatedMade(); + controller.rootLogic.getInventory(); + Get.back(); + }, + child: Text('تایید'), + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.blueNormal, + foregroundColor: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + ), + cancel: OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: AppColor.error, + enableFeedback: true, + side: BorderSide(color: AppColor.error, width: 1), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + onPressed: () { + Get.back(); + }, + child: Text('لغو'), + ), + ); + }, + message: 'تایید یکجا', + icon: Assets.vec.clipboardTaskSvg.svg(width: 40.w, height: 40.h), + backgroundColor: controller.bgConfirmAllColor.value, + ), + ); + }, controller.allocatedList), + ], + ), + ), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + itemListWidget(AllocatedMadeModel item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 20), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + controller.getBuyerInformation(item)?.user?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + SizedBox(height: 2), + Text( + item.createDate?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 6, + children: [ + Visibility( + visible: item.product?.name?.contains('مرغ گرم') ?? false, + child: Assets.vec.hotChickenSvg.svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + Text( + '${item.weightOfCarcasses?.separatedByComma}kg', + textAlign: TextAlign.left, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ], + ), + SizedBox(height: 2), + Text( + '${item.amount.separatedByComma} ریال', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + ), + + SizedBox(width: 8), + + Expanded( + flex: 1, + child: Assets.vec.scanSvg.svg( + width: 32.w, + height: 32.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ], + ); + } + + itemListExpandedWidget(AllocatedMadeModel item, int index) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + + + Text( + controller.getBuyerInformation(item)?.user?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + Spacer(), + Text( + item.registrationCode == null ? 'در انتظار' : 'در انتظار تایید خریدار', + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith( + color: item.registrationCode == null ? AppColor.darkGreyDark : AppColor.error, + ), + ), + SizedBox(width: 7), + Assets.vec.clockSvg.svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode( + item.registrationCode == null ? AppColor.darkGreyDark : AppColor.error, + BlendMode.srcIn, + ), + ), + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + item.date?.toJalali.formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${item.date?.toJalali.formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + + /* buildRow( + title: 'مشخصات خریدار', + value: controller.getBuyerInformation(item)?.user?.fullname ?? 'N/A', + ),*/ + + buildRow( + title: 'تلفن خریدار', + value: controller.getBuyerInformation(item)?.user?.mobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow(title: 'نوع فروش', value: item.sellType?.faItem ?? 'N/A'), + buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'), + buildRow( + title: 'نوع تخصیص', + value: item.allocationType?.faAllocationType ?? 'N/A', + ), + buildRow( + title: 'وزن خریداری شده', + value: '${item.weightOfCarcasses?.separatedByComma} کیلوگرم', + ), + buildRow( + title: 'افت وزن(کیلوگرم)', + value: item.weightLossOfCarcasses?.toInt().toString() ?? 'N/A', + ), + buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByComma} ریال'), + + buildRow(title: 'کداحراز', value: item.registrationCode?.toString() ?? 'ندارد'), + buildRow( + title: 'وضعیت کد احراز', + value: item.systemRegistrationCode == true ? "ارسال شده" : "ارسال نشده", + ), + + Visibility( + visible: item.registrationCode == null, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + onPressed: () { + controller.setEditData(item); + Get.bottomSheet( + addOrEditBottomSheet(true), + isScrollControlled: true, + backgroundColor: Colors.transparent, + ).whenComplete(() { + controller.clearForm(); + }); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + controller.isExpandedList.remove(index); + // controller.denyAllocation(item.key ?? ''); + //await controller.deleteAllocation(item); + }, + onRefresh: () => controller.getAllocatedMade(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ), + ], + ), + ); + } + + Widget addOrEditBottomSheet([bool isEditMode = false]) { + return BaseBottomSheet( + height: Get.height * (isEditMode ? 0.45 : 0.75), + child: Form( + key: controller.formKey, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '${isEditMode ? 'ویرایش' : 'ثبت'} توزیع/ فروش', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + const SizedBox(height: 12), + productDropDown(), + const SizedBox(height: 12), + Visibility( + visible: isEditMode == false, + child: Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + + child: Column( + children: [ + const SizedBox(height: 8), + SizedBox( + height: 40, + child: ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Radio( + value: 1, + groupValue: controller.saleType.value, + onChanged: (value) { + controller.saleType.value = value!; + + controller.selectedGuildModel.value = null; + controller.selectedGuildModel.refresh(); + }, + ), + Text('فروش اختصاصی', style: AppFonts.yekan14), + SizedBox(width: 12), + Radio( + value: 2, + groupValue: controller.saleType.value, + onChanged: (value) { + controller.saleType.value = value!; + }, + ), + Text('فروش آزاد', style: AppFonts.yekan14), + ], + ); + }, controller.saleType), + ), + const SizedBox(height: 12), + + guildsDropDown(), + ], + ), + ), + ), + const SizedBox(height: 12), + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + Visibility( + visible: isEditMode == false, + child: Column( + children: [ + const SizedBox(height: 8), + ObxValue((data) { + return RTextField( + controller: TextEditingController(), + filledColor: AppColor.bgLight, + filled: true, + label: 'تاریخ', + onTap: () { + Get.bottomSheet( + modalDatePicker((value) { + controller.fromDateFilter.value = value; + controller.fromDateFilter.refresh(); + }), + ); + }, + borderColor: AppColor.darkGreyLight, + initText: (data.value ?? Jalali.now()).formatCompactDate(), + ); + }, controller.fromDateFilter), + ], + ), + ), + + RTextField( + controller: controller.weightController, + keyboardType: TextInputType.number, + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + validator: (value) { + if (int.parse(value!.clearComma) > + (controller.rootLogic.inventoryModel.value?.totalRemainWeight?.toInt() ?? + 100)) { + return 'وزن تخصیصی بیشتر از موجودی انبار است'; + } + return null; + }, + onChanged: (p0) { + controller.weight.value = int.tryParse(p0.clearComma) ?? 0; + }, + label: 'وزن لاشه', + ), + + RTextField( + controller: controller.pricePerKiloController, + borderColor: AppColor.darkGreyLight, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + filledColor: AppColor.bgLight, + filled: true, + onChanged: (p0) { + controller.pricePerKilo.value = int.tryParse(p0.clearComma) ?? 0; + }, + keyboardType: TextInputType.number, + label: 'قیمت هر کیلو', + ), + + RTextField( + variant: RTextFieldVariant.noBorder, + enabled: false, + keyboardType: TextInputType.number, + filledColor: AppColor.bgLight, + filled: true, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + controller: controller.totalCostController, + label: 'هزینه کل', + ), + + ObxValue((data) { + return RElevated( + text: isEditMode ? 'ویرایش' : 'ثبت', + isFullWidth: true, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + height: 40, + onPressed: data.value + ? () async { + if (isEditMode) { + await controller.updateAllocation(); + controller.clearForm(); + controller.getAllocatedMade(); + controller.rootLogic.getInventory(); + Get.back(); + } else { + if (controller.formKey.currentState?.validate() ?? false) { + controller.setSubmitData(); + await Get.bottomSheet(show2StepAddBottomSheet()); + } + } + } + : null, + ); + }, controller.isValid), + ], + ), + ), + const SizedBox(height: 20), + ], + ), + ), + ); + } + + Widget guildsDropDown() { + return Obx(() { + final item = controller.selectedGuildModel.value; + return OverlayDropdownWidget( + key: ValueKey(item?.user?.fullname ?? ''), + items: controller.guildsModel, + onChanged: (value) { + controller.selectedGuildModel.value = value; + }, + selectedItem: item, + itemBuilder: (item) => Text( + item.user != null + ? '${item.steward == true ? 'مباشر' : 'صنف'} ${item.user!.fullname} (${item.user!.mobile})' + : 'بدون نام', + ), + labelBuilder: (item) => Text( + item?.user != null + ? '${item?.steward == true ? 'مباشر' : 'صنف'} ${item?.user!.fullname} (${item?.user!.mobile})' + : 'انتخاب مباشر/صنف', + ), + ); + }); + } + + Widget productDropDown() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rolesProductsModel, + height: 56, + hasDropIcon: false, + background: Colors.white, + onChanged: (value) { + controller.selectedProductModel.value = value; + }, + selectedItem: controller.selectedProductModel.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Row( + spacing: 8, + children: [ + (item?.name?.contains('مرغ گرم') ?? false) + ? Assets.images.chicken.image(width: 40, height: 40) + : Assets.vec.placeHolderSvg.svg(width: 40, height: 40), + + Text(item?.name ?? 'انتخاب محصول'), + Spacer(), + Text( + 'موجودی:${controller.rootLogic.inventoryModel.value?.totalRemainWeight.separatedByComma ?? 0}', + ), + ], + ), + ); + }); + } + + Widget filterBottomSheet() { + return BaseBottomSheet( + height: 200, + child: Column( + spacing: 16, + children: [ + Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + Row( + spacing: 8, + children: [ + Expanded( + child: timeFilterWidget( + date: controller.fromDateFilter, + onChanged: (jalali) => controller.fromDateFilter.value = jalali, + ), + ), + Expanded( + child: timeFilterWidget( + isFrom: false, + date: controller.toDateFilter, + onChanged: (jalali) => controller.toDateFilter.value = jalali, + ), + ), + ], + ), + RElevated( + text: 'اعمال فیلتر', + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + onPressed: () { + controller.getAllocatedMade(); + Get.back(); + }, + height: 40, + ), + ], + ), + ); + } + + GestureDetector timeFilterWidget({ + isFrom = true, + required Rxn date, + required Function(Jalali jalali) onChanged, + }) { + return GestureDetector( + onTap: () { + Get.bottomSheet(modalDatePicker((value) => onChanged(value))); + }, + child: Container( + height: 35, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blueNormal), + ), + padding: EdgeInsets.symmetric(horizontal: 11, vertical: 4), + child: Row( + spacing: 8, + children: [ + Assets.vec.calendarSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + Text( + isFrom ? 'از' : 'تا', + style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + ), + Expanded( + child: ObxValue((data) { + return Text( + date.value?.formatCompactDate() ?? Jalali.now().formatCompactDate(), + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive), + ); + }, date), + ), + ], + ), + ), + ); + } + + Container modalDatePicker(ValueChanged onDateSelected) { + Jalali? tempPickedDate; + return Container( + height: 250, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: Row( + children: [ + SizedBox(width: 20), + RElevated( + height: 35, + width: 70, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'تایید', + ), + Spacer(), + RElevated( + height: 35, + width: 70, + backgroundColor: AppColor.error, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'لغو', + ), + SizedBox(width: 20), + ], + ), + ), + Divider(height: 0, thickness: 1), + Expanded( + child: Container( + child: PersianCupertinoDatePicker( + initialDateTime: Jalali.now(), + mode: PersianCupertinoDatePickerMode.date, + onDateTimeChanged: (dateTime) { + tempPickedDate = dateTime; + }, + ), + ), + ), + ], + ), + ); + } + + Widget show2StepAddBottomSheet() { + return BaseBottomSheet( + height: Get.height * .39, + child: Column( + spacing: 8, + children: [ + buildRow( + title: 'تاریخ ثبت', + value: controller.tmpStewardAllocation?.date?.formattedJalaliDate ?? 'N/A', + ), + buildRow( + title: 'نام و نام خانوادگی خریدار', + value: + controller.guildsModel + .firstWhere((p0) => p0.key == controller.tmpStewardAllocation?.guildKey) + .user + ?.fullname ?? + 'N/A', + ), + buildRow( + title: 'شماره خریدار', + value: + controller.guildsModel + .firstWhere((p0) => p0.key == controller.tmpStewardAllocation?.guildKey) + .user + ?.mobile ?? + 'N/A', + ), + + buildRow( + title: 'قیمت هر کیلو', + value: '${controller.tmpStewardAllocation?.amount.separatedByComma ?? 0} ریال ', + ), + buildRow( + title: 'وزن تخصیصی', + value: + '${controller.tmpStewardAllocation?.weightOfCarcasses?.toInt().separatedByComma ?? 0} کیلوگرم', + ), + buildRow( + title: 'قیمت کل', + value: '${controller.tmpStewardAllocation?.totalAmount.separatedByComma ?? 0} ریال', + ), + + Row( + spacing: 10, + children: [ + Expanded( + child: RElevated( + backgroundColor: AppColor.greenNormal, + height: 40, + text: 'ثبت', + textStyle: AppFonts.yekan18.copyWith(color: Colors.white), + onPressed: () async { + await controller.submitAllocation(); + Get + ..back() + ..back(); + }, + ), + ), + Expanded( + child: ROutlinedElevated( + height: 40, + borderColor: AppColor.error, + text: ' بازگشت', + textStyle: AppFonts.yekan18.copyWith(color: AppColor.error), + onPressed: () { + Get + ..back() + ..back(); + }, + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart new file mode 100644 index 0000000..d031d0b --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/logic.dart @@ -0,0 +1,214 @@ +import 'package:flutter/material.dart'; + +import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_sales_list/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class SalesOutOfProvinceLogic extends GetxController { + RootLogic get rootLogic => Get.find(); + + SaleLogic get saleLogic => Get.find(); + + SalesOutOfProvinceBuyersLogic get buyersLogic => Get.find(); + + SalesOutOfProvinceSalesListLogic get saleListLogic => + Get.find(); + + SalesOutOfProvinceBuyersLogic get buyerLogic => Get.find(); + + RxBool isExpanded = false.obs; + RxInt currentPage = 1.obs; + RxBool isSaleSubmitButtonEnabled = false.obs; + RxList isExpandedList = [].obs; + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + RxList routesName = RxList(); + RxBool isLoadingMoreAllocationsMade = false.obs; + Rxn selectedCity = Rxn(); + + + GlobalKey formKey = GlobalKey(); + TextEditingController quarantineCodeController = TextEditingController(); + TextEditingController saleWeightController = TextEditingController(); + Rx saleDate = Jalali.now().obs; + String? key; + + Rx>> salesList = + Resource>.loading().obs; + + Rxn selectedProduct = Rxn(); + Rxn selectedBuyer = Rxn(); + + @override + void onInit() { + super.onInit(); + routesName.value = [...saleLogic.routesName, 'خارج استان'].toList(); + } + + @override + void onReady() { + super.onReady(); + getOutProvinceSales(); + selectedProduct.value = rootLogic.rolesProductsModel.first; + debounce( + searchedValue, + (callback) => getOutProvinceSales(), + time: Duration(milliseconds: timeDebounce), + ); + setupListeners(); + } + + void setSearchValue(String? value) { + searchedValue.value = value?.trim(); + } + + void submitFilter() { + fromDateFilter.value = fromDateFilter.value; + toDateFilter.value = toDateFilter.value; + getOutProvinceSales(); + } + + Future getOutProvinceSales([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + salesList.value = Resource>.loading(); + } + await safeCall( + call: () => rootLogic.chickenRepository.getStewardFreeSaleBar( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + pageSize: 20, + page: currentPage.value, + state: 'buyer-list', + search: 'filter', + role: 'Steward', + value: searchedValue.value ?? '', + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), + ), + ), + onSuccess: (res) { + if ((res?.count ?? 0) == 0) { + salesList.value = Resource>.empty(); + } else { + salesList.value = Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: [...(salesList.value.data?.results ?? []), ...(res?.results ?? [])], + ), + ); + + isLoadingMoreAllocationsMade.value = false; + } + }, + ); + } + + void setupListeners() { + saleWeightController.addListener(checkSalesFormValid); + quarantineCodeController.addListener(checkSalesFormValid); + ever(selectedBuyer, (_) => checkSalesFormValid); + ever(selectedProduct, (_) => checkSalesFormValid); + ever(saleDate, (_) => checkSalesFormValid()); + } + + void checkSalesFormValid() { + isSaleSubmitButtonEnabled.value = + saleDate.value.toString().isNotEmpty && + selectedProduct.value != null && + selectedBuyer.value != null && + saleWeightController.text.isNotEmpty && + quarantineCodeController.text.isNotEmpty; + } + + void setEditDataSales(StewardFreeSaleBar item) { + quarantineCodeController.text = item.clearanceCode ?? ''; + saleWeightController.text = item.weightOfCarcasses?.toInt().toString() ?? ''; + saleDate.value = Jalali.fromDateTime(DateTime.parse(item.date!)); + selectedCity.value = IranProvinceCityModel(name: item.city); + selectedBuyer.value = buyerLogic.buyerList.value.data?.results?.firstWhere( + (element) => element.key == item.buyer?.key, + ); + selectedProduct.value = rootLogic.rolesProductsModel.first; + key = item.key; + isSaleSubmitButtonEnabled.value = true; + } + + Future deleteStewardPurchaseOutOfProvince(String key) async { + await safeCall( + call: () => rootLogic.chickenRepository.deleteStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + stewardFreeBarKey: key, + ), + ); + } + + Future createSale() async { + bool res = false; + StewardFreeSaleBarRequest requestBody = StewardFreeSaleBarRequest( + buyerKey: selectedBuyer.value?.key, + numberOfCarcasses: 0, + weightOfCarcasses: int.tryParse(saleWeightController.text.clearComma), + date: saleDate.value.toDateTime().formattedDashedGregorian, + clearanceCode: quarantineCodeController.text, + productKey: selectedProduct.value?.key, + ); + await safeCall( + call: () => rootLogic.chickenRepository.createOutProvinceStewardFreeBar( + token: rootLogic.tokenService.accessToken.value!, + body: requestBody, + ), + onSuccess: (_) { + res = true; + }, + ); + return res; + } + + void clearSaleForm() { + quarantineCodeController.clear(); + saleWeightController.clear(); + saleDate.value = Jalali.now(); + selectedBuyer.value = null; + selectedProduct.value = null; + } + + Future editSale() async { + bool res = false; + StewardFreeSaleBarRequest requestBody = StewardFreeSaleBarRequest( + numberOfCarcasses: 0, + weightOfCarcasses: int.tryParse(saleWeightController.text.clearComma), + date: saleDate.value.toDateTime().formattedDashedGregorian, + clearanceCode: quarantineCodeController.text, + key: key, + ); + await safeCall( + call: () => rootLogic.chickenRepository.updateOutProvinceStewardFreeBar( + token: rootLogic.tokenService.accessToken.value!, + body: requestBody, + ), + onSuccess: (_) { + res = true; + }, + ); + return res; + } + + void resetSubmitForm() { + selectedCity.value = null; + selectedProduct.value = null; + key = null; + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart new file mode 100644 index 0000000..6d89403 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart @@ -0,0 +1,526 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_sales_list/view.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; +import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart'; + +import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SalesOutOfProvincePage extends GetView { + const SalesOutOfProvincePage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName), + onBackPressed: () => Get.back(id: 1), + onSearchChanged: (data) => controller.setSearchValue(data), + filteringWidget: filterBottomSheet(), + widgets: [ + inventoryWidget(controller.rootLogic), + Expanded( + child: ObxValue((data) { + return RPaginatedListView( + onLoadMore: () async => controller.getOutProvinceSales(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getOutProvinceSales(); + }, + hasMore: data.value.data?.next != null, + listType: ListType.separated, + resource: data.value, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item, index), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.timerSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.salesList), + ), + ], + floatingActionButton: Row( + children: [ + RFab.add( + onPressed: () { + Get.bottomSheet(addOrEditSaleBottomSheet(), isScrollControlled: true); + }, + ), + Spacer(), + RFab( + icon: Icon(CupertinoIcons.person_add_solid, color: Colors.white, size: 35.w), + backgroundColor: AppColor.blueNormal, + onPressed: () { + Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyer, id: 1); + }, + ), + SizedBox(width: 25), + ], + ), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + /* Padding segmentWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 8), + child: Row( + children: [ + Expanded( + child: RSegment( + children: ['فروش', 'خریداران'], + selectedIndex: controller.selectedSegmentIndex.value, + borderColor: const Color(0xFFB4B4B4), + selectedBorderColor: AppColor.blueNormal, + selectedBackgroundColor: AppColor.blueLight, + onSegmentSelected: (index) => controller.selectedSegmentIndex.value = index, + backgroundColor: AppColor.whiteGreyNormal, + ), + ), + ], + ), + ); + }*/ + + Widget filterBottomSheet() => filterBottomSheetWidget( + fromDate: controller.fromDateFilter, + onChangedFromDate: (jalali) => controller.fromDateFilter.value = jalali, + toDate: controller.toDateFilter, + onChangedToDate: (jalali) => controller.toDateFilter.value = jalali, + onSubmit: () => controller.submitFilter(), + ); + + itemListWidget(StewardFreeSaleBar item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 12), + Expanded( + flex: 3, + child: Text( + item.date?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ), + SizedBox(width: 4), + Expanded( + flex: 5, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + item.buyer?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + SizedBox(height: 2), + Text( + item.buyer?.mobile ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + SizedBox(width: 4), + Expanded( + flex: 4, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Text( + item.buyer?.unitName ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + Text( + '${item.weightOfCarcasses?.separatedByComma ?? 0}KG', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 2, + child: Text( + '${item.buyer?.province}\n${item.buyer?.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ), + ], + ); + } + + itemListExpandedWidget(StewardFreeSaleBar item, int index) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + '${item.province} - ${item.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + item.date?.toJalali.formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${item.date?.toJalali.formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + buildRow(title: 'مشخصات خریدار', value: item.buyer?.fullname ?? 'N/A'), + buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'), + buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'), + buildRow(title: 'وزن لاشه', value: '${item.weightOfCarcasses?.separatedByComma}'), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + onPressed: () { + controller.setEditDataSales(item); + Get.bottomSheet( + addOrEditSaleBottomSheet(true), + isScrollControlled: true, + ).whenComplete(() { + controller.resetSubmitForm(); + }); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + controller.isExpandedList.remove(index); + controller.deleteStewardPurchaseOutOfProvince(item.key!); + }, + onRefresh: () => controller.getOutProvinceSales(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ], + ), + ); + } + + Widget addOrEditSaleBottomSheet([bool isOnEdit = false]) { + return BaseBottomSheet( + height: 500.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 16, + children: [ + Text( + isOnEdit ? 'ویرایش فروش' : 'افزودن فروش', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + _productDropDown(), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + Row( + spacing: 8, + children: [ + Expanded( + child: timeFilterWidget( + date: controller.saleDate, + onChanged: (jalali) => controller.saleDate.value = jalali, + ), + ), + ], + ), + _buyerWidget(), + RTextField( + controller: controller.saleWeightController, + label: 'وزن لاشه', + keyboardType: TextInputType.number, + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + + validator: (value) { + if (value == null) { + return 'لطفاً وزن لاشه را وارد کنید'; + } + return null; + }, + ), + RTextField( + controller: controller.quarantineCodeController, + label: 'کد قرنطینه', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null) { + return 'لطفاً کد قرنطینه را وارد کنید'; + } + return null; + }, + ), + submitButtonWidget(isOnEdit), + ], + ), + ), + SizedBox(), + ], + ), + ), + ), + ); + } + + Widget submitButtonWidget(bool isOnEdit) { + return ObxValue((data) { + return RElevated( + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + text: isOnEdit ? 'ویرایش' : 'ثبت', + onPressed: data.value + ? () async { + var res = isOnEdit ? await controller.editSale() : await controller.createSale(); + if (res) { + controller.getOutProvinceSales(); + controller.clearSaleForm(); + Get.back(); + } + } + : null, + height: 40, + ); + }, controller.isSaleSubmitButtonEnabled); + } + + Widget _buyerWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.buyerLogic.buyerList.value.data?.results ?? [], + onChanged: (value) { + controller.selectedBuyer.value = value; + }, + selectedItem: controller.selectedBuyer.value, + itemBuilder: (item) => Text(item.buyer?.fullname ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.buyer?.fullname ?? 'انتخاب خریدار'), + ); + }); + } + + Widget _productDropDown() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.rolesProductsModel, + height: 56, + hasDropIcon: false, + background: Colors.white, + onChanged: (value) { + controller.selectedProduct.value = value; + }, + selectedItem: controller.selectedProduct.value, + initialValue: controller.selectedProduct.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Row( + spacing: 8, + children: [ + (item?.name?.contains('مرغ گرم') ?? false) + ? Assets.images.chicken.image(width: 40, height: 40) + : Assets.vec.placeHolderSvg.svg(width: 40, height: 40), + + Text(item?.name ?? 'انتخاب محصول'), + Spacer(), + Text( + 'موجودی:${controller.rootLogic.inventoryModel.value?.totalRemainWeight.separatedByComma ?? 0}', + ), + ], + ), + ); + }); + } + + GestureDetector timeFilterWidget({ + isFrom = true, + required Rx date, + required Function(Jalali jalali) onChanged, + }) { + return GestureDetector( + onTap: () { + Get.bottomSheet(modalDatePicker((value) => onChanged(value))); + }, + child: Container( + height: 40, + decoration: BoxDecoration( + color: AppColor.bgLight, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.darkGreyLight), + ), + padding: EdgeInsets.symmetric(horizontal: 11, vertical: 4), + child: Row( + spacing: 8, + children: [ + Assets.vec.calendarSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(AppColor.bgDark, BlendMode.srcIn), + ), + Text('تاریخ', style: AppFonts.yekan16.copyWith(color: AppColor.bgDark)), + Expanded( + child: ObxValue((data) { + return Text( + date.value.formatCompactDate(), + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark), + ); + }, date), + ), + ], + ), + ), + ); + } + + Container modalDatePicker(ValueChanged onDateSelected) { + Jalali? tempPickedDate; + return Container( + height: 250, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: Row( + children: [ + SizedBox(width: 20), + RElevated( + height: 35, + width: 70, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'تایید', + ), + Spacer(), + RElevated( + height: 35, + width: 70, + backgroundColor: AppColor.error, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'لغو', + ), + SizedBox(width: 20), + ], + ), + ), + Divider(height: 0, thickness: 1), + Expanded( + child: Container( + child: PersianCupertinoDatePicker( + initialDateTime: controller.saleDate.value, + mode: PersianCupertinoDatePickerMode.date, + onDateTimeChanged: (dateTime) { + tempPickedDate = dateTime; + }, + ), + ), + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/logic.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/logic.dart new file mode 100644 index 0000000..9893557 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/logic.dart @@ -0,0 +1,211 @@ +import 'package:flutter/material.dart'; + +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class SalesOutOfProvinceBuyersLogic extends GetxController { + RootLogic get rootLogic => Get.find(); + + SaleLogic get saleLogic => Get.find(); + + SalesOutOfProvinceLogic get saleOutOfProvince => Get.find(); + + RxInt currentPage = 1.obs; + RxList isExpandedList = [].obs; + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + + RxBool isLoadingMoreAllocationsMade = false.obs; + RxBool isBuyerSubmitButtonEnabled = false.obs; + + RxList cites = [].obs; + Rxn selectedProvince = Rxn(); + Rxn selectedCity = Rxn(); + + GlobalKey formKey = GlobalKey(); + TextEditingController buyerNameController = TextEditingController(); + TextEditingController buyerLastNameController = TextEditingController(); + TextEditingController buyerPhoneController = TextEditingController(); + TextEditingController buyerUnitNameController = TextEditingController(); + String? key; + + Rx>> buyerList = + Resource>.loading().obs; + + RxList routesName = RxList(); + + @override + void onInit() { + super.onInit(); + routesName.value = [...saleLogic.routesName, 'خریداران'].toList(); + getOutProvinceCarcassesBuyer(); + } + + @override + void onReady() { + super.onReady(); + + selectedProvince.listen((p0) => getCites()); + + debounce( + searchedValue, + (callback) => getOutProvinceCarcassesBuyer(), + time: Duration(milliseconds: timeDebounce), + ); + + setupListeners(); + } + + @override + void onClose() { + buyerNameController.dispose(); + buyerLastNameController.dispose(); + buyerPhoneController.dispose(); + buyerUnitNameController.dispose(); + selectedCity.value = null; + selectedProvince.value = null; + isExpandedList.clear(); + super.onClose(); + } + + Future getOutProvinceCarcassesBuyer([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + buyerList.value = Resource>.loading(); + } + + if (searchedValue.value != null && + searchedValue.value!.trim().isNotEmpty && + currentPage.value > 1) { + currentPage.value = 1; // Reset to first page if search value is set + } + + await safeCall( + call: () => rootLogic.chickenRepository.getOutProvinceCarcassesBuyer( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + pageSize: 20, + page: currentPage.value, + state: 'buyer-list', + search: 'filter', + role: 'Steward', + value: searchedValue.value ?? '', + ), + ), + onError: (error, stackTrace) => isLoadingMoreAllocationsMade.value = false, + onSuccess: (res) { + if ((res?.count ?? 0) == 0) { + buyerList.value = Resource>.empty(); + } else { + buyerList.value = Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: [...(buyerList.value.data?.results ?? []), ...(res?.results ?? [])], + ), + ); + + isLoadingMoreAllocationsMade.value = false; + } + }, + ); + } + + void resetSubmitForm() { + buyerNameController.clear(); + buyerLastNameController.clear(); + buyerPhoneController.clear(); + buyerUnitNameController.clear(); + selectedProvince.value = null; + selectedCity.value = null; + } + + Future getCites() async { + await safeCall( + call: () => + rootLogic.chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''), + onSuccess: (result) { + if (result != null && result.isNotEmpty) { + cites.value = result; + } + }, + ); + } + + void setupListeners() { + buyerNameController.addListener(checkBuyerFormValid); + buyerLastNameController.addListener(checkBuyerFormValid); + buyerPhoneController.addListener(checkBuyerFormValid); + buyerUnitNameController.addListener(checkBuyerFormValid); + ever(selectedProvince, (_) => checkBuyerFormValid()); + ever(selectedCity, (_) => checkBuyerFormValid()); + } + + void checkBuyerFormValid() { + isBuyerSubmitButtonEnabled.value = + buyerNameController.text.isNotEmpty && + buyerLastNameController.text.isNotEmpty && + buyerPhoneController.text.isNotEmpty && + buyerUnitNameController.text.isNotEmpty && + selectedProvince.value != null && + selectedCity.value != null; + } + + Future createBuyer() async { + bool res = false; + if (!(formKey.currentState?.validate() ?? false)) { + return res; + } + await safeCall( + call: () async { + OutProvinceCarcassesBuyer buyer = OutProvinceCarcassesBuyer( + province: selectedProvince.value!.name, + city: selectedCity.value!.name, + firstName: buyerNameController.text, + lastName: buyerLastNameController.text, + unitName: buyerUnitNameController.text, + mobile: buyerPhoneController.text, + role: 'Steward', + ); + final res = await rootLogic.chickenRepository.createOutProvinceCarcassesBuyer( + token: rootLogic.tokenService.accessToken.value!, + body: buyer, + ); + }, + onSuccess: (result) { + getOutProvinceCarcassesBuyer(); + resetSubmitForm(); + res = true; + }, + ); + return res; + } + + void setEditDataBuyer(OutProvinceCarcassesBuyer item) { + buyerNameController.text = item.firstName ?? ''; + buyerLastNameController.text = item.lastName ?? ''; + buyerUnitNameController.text = item.unitName ?? ''; + buyerPhoneController.text = item.mobile ?? ''; + selectedProvince.value = IranProvinceCityModel(name: item.province); + selectedCity.value = IranProvinceCityModel(name: item.city); + isBuyerSubmitButtonEnabled.value = true; + } + + void setSearchValue(String? value) { + searchedValue.value = value?.trim(); + } + + void submitFilter() { + fromDateFilter.value = fromDateFilter.value; + toDateFilter.value = toDateFilter.value; + getOutProvinceCarcassesBuyer(); + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart new file mode 100644 index 0000000..311aee8 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province_buyers/view.dart @@ -0,0 +1,320 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; + + +import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SalesOutOfProvinceBuyersPage extends GetView { + const SalesOutOfProvinceBuyersPage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName), + onBackPressed: () => Get.back(id: 1), + onSearchChanged: (data) => controller.setSearchValue(data), + filteringWidget: filterBottomSheet(), + widgets: [ + Expanded( + child: ObxValue((data) { + return RPaginatedListView( + onLoadMore: () async => controller.getOutProvinceCarcassesBuyer(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getOutProvinceCarcassesBuyer(); + }, + hasMore: data.value.data?.next != null, + listType: ListType.separated, + resource: data.value, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.userRaduisSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.buyerList), + ), + ], + floatingActionButton: RFab.add( + onPressed: () { + Get.bottomSheet( + addOrEditBuyerBottomSheet(), + isScrollControlled: true, + ignoreSafeArea: false, + ).whenComplete(() => controller.resetSubmitForm()); + }, + ), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + Widget addOrEditBuyerBottomSheet([bool isOnEdit = false]) { + return BaseBottomSheet( + height: 600, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text( + isOnEdit ? 'ویرایش خریدار' : 'افزودن خریدار', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]), + ), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + RTextField( + controller: controller.buyerNameController, + label: 'نام خریدار', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.buyerLastNameController, + label: 'نام خانوادگی خریدار', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.buyerPhoneController, + label: 'تلفن خریدار', + keyboardType: TextInputType.phone, + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + maxLength: 11, + validator: (value) { + if (value == null || value.isEmpty) { + return 'لطفاً شماره موبایل را وارد کنید'; + } + // حذف کاماها برای اعتبارسنجی + String cleaned = value.replaceAll(',', ''); + if (cleaned.length != 11) { + return 'شماره موبایل باید ۱۱ رقم باشد'; + } + if (!cleaned.startsWith('09')) { + return 'شماره موبایل باید با 09 شروع شود'; + } + return null; + }, + ), + RTextField( + controller: controller.buyerUnitNameController, + label: 'نام واحد', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + + submitButtonWidget(isOnEdit), + ], + ), + ), + SizedBox(), + ], + ), + ), + ), + ); + } + + Widget submitButtonWidget(bool isOnEdit) { + return ObxValue((data) { + return RElevated( + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + text: isOnEdit ? 'ویرایش' : 'ثبت', + onPressed: data.value + ? () async { + var res = await controller.createBuyer(); + if (res) { + Get.back(); + } + } + : null, + height: 40, + ); + }, controller.isBuyerSubmitButtonEnabled); + } + + Widget _provinceWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.provinces, + onChanged: (value) { + controller.selectedProvince.value = value; + print('Selected Product: ${value.name}'); + }, + selectedItem: controller.selectedProvince.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'), + ); + }); + } + + Widget _cityWidget() { + return ObxValue((data) { + return OverlayDropdownWidget( + items: data, + onChanged: (value) { + controller.selectedCity.value = value; + print('Selected Product: ${value.name}'); + }, + selectedItem: controller.selectedCity.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'), + ); + }, controller.cites); + } + + itemListWidget(OutProvinceCarcassesBuyer item) { + return Padding( + padding: const EdgeInsets.only(right: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 8), + + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + item.buyer?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + SizedBox(height: 2), + Text( + item.buyer?.mobile ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + + Expanded( + flex: 2, + child: Text( + '${item.unitName}', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ), + Expanded( + flex: 2, + child: Text( + '${item.buyer?.province}\n${item.buyer?.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDark), + ), + ), + ], + ), + ); + } + + itemListExpandedWidget(OutProvinceCarcassesBuyer item) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + '${item.province}-${item.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + + SizedBox(), + ], + ), + + buildRow(title: 'مشخصات خریدار', value: item.fullname ?? 'N/A'), + buildRow(title: 'نام واحد', value: item.unitName ?? 'N/A'), + buildRow( + title: 'تعداد درخواست ها', + value: '${item.requestsInfo?.numberOfRequests.separatedByComma}', + ), + buildRow(title: 'وزن', value: '${item.requestsInfo?.totalWeight.separatedByComma}'), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + onPressed: () { + controller.setEditDataBuyer(item); + Get.bottomSheet( + addOrEditBuyerBottomSheet(true), + isScrollControlled: true, + ).whenComplete(() => controller.resetSubmitForm()); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ], + ), + ], + ), + ); + } + + Widget filterBottomSheet() => filterBottomSheetWidget( + fromDate: controller.fromDateFilter, + onChangedFromDate: (jalali) => controller.fromDateFilter.value = jalali, + toDate: controller.toDateFilter, + onChangedToDate: (jalali) => controller.toDateFilter.value = jalali, + onSubmit: () => controller.submitFilter(), + ); +} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/logic.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/logic.dart new file mode 100644 index 0000000..8713c36 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/logic.dart @@ -0,0 +1,214 @@ +import 'package:flutter/material.dart'; + +import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart'; +import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class SalesOutOfProvinceSalesListLogic extends GetxController { + RootLogic get rootLogic => Get.find(); + + SaleLogic get saleLogic => Get.find(); + + SalesOutOfProvinceBuyersLogic get buyerLogic => + Get.find(); + + RxInt selectedSegmentIndex = 0.obs; + RxBool isExpanded = false.obs; + RxInt currentPage = 1.obs; + RxBool isSaleSubmitButtonEnabled = false.obs; + RxList isExpandedList = [].obs; + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + RxList routesName = RxList(); + RxBool isLoadingMoreAllocationsMade = false.obs; + Rxn selectedCity = Rxn(); + + //TODO add this to Di + ImagePicker imagePicker = ImagePicker(); + + GlobalKey formKey = GlobalKey(); + TextEditingController quarantineCodeController = TextEditingController(); + TextEditingController saleWeightController = TextEditingController(); + Rx saleDate = Jalali.now().obs; + String? key; + + Rx>> salesList = + Resource>.loading().obs; + + Rxn selectedProduct = Rxn(); + Rxn selectedBuyer = Rxn(); + + @override + void onInit() { + super.onInit(); + getOutProvinceSales(); + } + + @override + void onReady() { + super.onReady(); + + selectedProduct.value = rootLogic.rolesProductsModel.first; + debounce( + searchedValue, + (callback) => getOutProvinceSales(), + time: Duration(milliseconds: timeDebounce), + ); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + Future getOutProvinceSales([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + salesList.value = Resource>.loading(); + } + await safeCall( + call: () => rootLogic.chickenRepository.getStewardFreeSaleBar( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + pageSize: 20, + page: currentPage.value, + state: 'buyer-list', + search: 'filter', + role: 'Steward', + value: searchedValue.value ?? '', + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), + ), + ), + onSuccess: (res) { + if ((res?.count ?? 0) == 0) { + salesList.value = + Resource>.empty(); + } else { + salesList.value = + Resource>.success( + PaginationModel( + count: res?.count ?? 0, + next: res?.next, + previous: res?.previous, + results: [ + ...(salesList.value.data?.results ?? []), + ...(res?.results ?? []), + ], + ), + ); + + isLoadingMoreAllocationsMade.value = false; + } + }, + ); + } + + void setupListeners() { + saleWeightController.addListener(checkSalesFormValid); + quarantineCodeController.addListener(checkSalesFormValid); + ever(selectedBuyer, (_) => checkSalesFormValid); + ever(selectedProduct, (_) => checkSalesFormValid); + ever(saleDate, (_) => checkSalesFormValid()); + } + + void checkSalesFormValid() { + isSaleSubmitButtonEnabled.value = + saleDate.value.toString().isNotEmpty && + selectedProduct.value != null && + selectedBuyer.value != null && + saleWeightController.text.isNotEmpty && + quarantineCodeController.text.isNotEmpty; + } + + void setEditDataSales(StewardFreeSaleBar item) { + quarantineCodeController.text = item.clearanceCode ?? ''; + saleWeightController.text = + item.weightOfCarcasses?.toInt().toString() ?? ''; + saleDate.value = Jalali.fromDateTime(DateTime.parse(item.date!)); + selectedCity.value = IranProvinceCityModel(name: item.city); + selectedBuyer.value = buyerLogic.buyerList.value.data?.results?.firstWhere( + (element) => element.key == item.buyer?.key, + ); + selectedProduct.value = rootLogic.rolesProductsModel.first; + key = item.key; + isSaleSubmitButtonEnabled.value = true; + } + + Future deleteStewardPurchaseOutOfProvince(String key) async { + await safeCall( + call: () => rootLogic.chickenRepository + .deleteStewardPurchasesOutSideOfTheProvince( + token: rootLogic.tokenService.accessToken.value!, + stewardFreeBarKey: key, + ), + ); + } + + Future createSale() async { + bool res = false; + StewardFreeSaleBarRequest requestBody = StewardFreeSaleBarRequest( + buyerKey: selectedBuyer.value?.key, + numberOfCarcasses: 0, + weightOfCarcasses: int.tryParse(saleWeightController.text.clearComma), + date: saleDate.value.toDateTime().formattedDashedGregorian, + clearanceCode: quarantineCodeController.text, + productKey: selectedProduct.value?.key, + ); + await safeCall( + call: () => rootLogic.chickenRepository.createOutProvinceStewardFreeBar( + token: rootLogic.tokenService.accessToken.value!, + body: requestBody, + ), + onSuccess: (_) { + res = true; + }, + ); + return res; + } + + void clearSaleForm() { + quarantineCodeController.clear(); + saleWeightController.clear(); + saleDate.value = Jalali.now(); + selectedBuyer.value = null; + selectedProduct.value = null; + } + + Future editSale() async { + bool res = false; + StewardFreeSaleBarRequest requestBody = StewardFreeSaleBarRequest( + numberOfCarcasses: 0, + weightOfCarcasses: int.tryParse(saleWeightController.text.clearComma), + date: saleDate.value.toDateTime().formattedDashedGregorian, + clearanceCode: quarantineCodeController.text, + key: key, + ); + await safeCall( + call: () => rootLogic.chickenRepository.updateOutProvinceStewardFreeBar( + token: rootLogic.tokenService.accessToken.value!, + body: requestBody, + ), + onSuccess: (_) { + res = true; + }, + ); + return res; + } + + void resetSubmitForm() { + selectedCity.value = null; + selectedProduct.value = null; + key = null; + } +} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart new file mode 100644 index 0000000..6430e77 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province_sales_list/view.dart @@ -0,0 +1,490 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2; + +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SalesOutOfProvinceSalesListPage extends GetView { + const SalesOutOfProvinceSalesListPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: ObxValue((data) { + return RPaginatedListView( + onLoadMore: () async => controller.getOutProvinceSales(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getOutProvinceSales(); + }, + hasMore: data.value.data?.next != null, + listType: ListType.separated, + resource: data.value, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item, index), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.timerSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.salesList), + floatingActionButton: Row( + children: [ + RFab.add( + onPressed: () { + Get.bottomSheet( + addOrEditSaleBottomSheet(), + ignoreSafeArea: false, + isScrollControlled: true, + ).whenComplete(() { + controller.clearSaleForm(); + }); + }, + ), + Spacer(), + RFab( + icon: Icon(CupertinoIcons.person_add_solid, color: Colors.white, size: 35.w), + backgroundColor: AppColor.blueNormal, + onPressed: () { + Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyer, id: 1); + }, + ), + SizedBox(width: 25), + ], + ), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + itemListWidget(StewardFreeSaleBar item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 12), + Expanded( + flex: 3, + child: Text( + item.date?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ), + SizedBox(width: 4), + Expanded( + flex: 5, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + item.buyer?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + SizedBox(height: 2), + Text( + item.buyer?.mobile ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + SizedBox(width: 4), + Expanded( + flex: 4, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Text( + item.buyer?.unitName ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + Text( + '${item.weightOfCarcasses?.separatedByComma ?? 0}KG', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + Expanded( + flex: 2, + child: Text( + '${item.buyer?.province}\n${item.buyer?.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ), + ], + ); + } + + itemListExpandedWidget(StewardFreeSaleBar item, int index) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + '${item.province}-${item.city}', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + item.date?.toJalali.formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${item.date?.toJalali.formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${item.date?.toJalali.formatter.tHH}:${item.date?.toJalali.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + buildRow(title: 'مشخصات خریدار', value: item.buyer?.fullname ?? 'N/A'), + buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'), + buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'), + buildRow(title: 'وزن لاشه', value: '${item.weightOfCarcasses?.separatedByComma}'), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + onPressed: () { + controller.setEditDataSales(item); + Get.bottomSheet( + addOrEditSaleBottomSheet(true), + isScrollControlled: true, + ).whenComplete(() { + controller.resetSubmitForm(); + }); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + controller.isExpandedList.remove(index); + controller.deleteStewardPurchaseOutOfProvince(item.key!); + }, + onRefresh: () => controller.getOutProvinceSales(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ], + ), + ); + } + + Widget addOrEditSaleBottomSheet([bool isOnEdit = false]) { + return BaseBottomSheet( + height: 500.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 16, + children: [ + Text( + isOnEdit ? 'ویرایش فروش' : 'افزودن فروش', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + _productDropDown(), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + Row( + spacing: 8, + children: [ + Expanded( + child: timeFilterWidget( + date: controller.saleDate, + onChanged: (jalali) => controller.saleDate.value = jalali, + ), + ), + ], + ), + _buyerWidget(), + RTextField( + controller: controller.saleWeightController, + label: 'وزن لاشه', + keyboardType: TextInputType.number, + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + + validator: (value) { + if (value == null) { + return 'لطفاً وزن لاشه را وارد کنید'; + } + return null; + }, + ), + RTextField( + controller: controller.quarantineCodeController, + label: 'کد قرنطینه', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null) { + return 'لطفاً کد قرنطینه را وارد کنید'; + } + return null; + }, + ), + submitButtonWidget(isOnEdit), + ], + ), + ), + SizedBox(), + ], + ), + ), + ), + ); + } + + Widget submitButtonWidget(bool isOnEdit) { + return ObxValue((data) { + return RElevated( + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + text: isOnEdit ? 'ویرایش' : 'ثبت', + onPressed: data.value + ? () async { + var res = isOnEdit ? await controller.editSale() : await controller.createSale(); + if (res) { + controller.getOutProvinceSales(); + controller.clearSaleForm(); + Get.back(); + } + } + : null, + height: 40, + ); + }, controller.isSaleSubmitButtonEnabled); + } + + Widget _buyerWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.buyerLogic.buyerList.value.data?.results ?? [], + onChanged: (value) { + controller.selectedBuyer.value = value; + }, + selectedItem: controller.selectedBuyer.value, + itemBuilder: (item) => Text(item.buyer?.fullname ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.buyer?.fullname ?? 'انتخاب خریدار'), + ); + }); + } + + Widget _productDropDown() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.rolesProductsModel, + height: 56, + hasDropIcon: false, + background: Colors.white, + onChanged: (value) { + controller.selectedProduct.value = value; + }, + selectedItem: controller.selectedProduct.value, + initialValue: controller.selectedProduct.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Row( + spacing: 8, + children: [ + (item?.name?.contains('مرغ گرم') ?? false) + ? Assets.images.chicken.image(width: 40, height: 40) + : Assets.vec.placeHolderSvg.svg(width: 40, height: 40), + + Text(item?.name ?? 'انتخاب محصول'), + Spacer(), + Text( + 'موجودی:${controller.rootLogic.inventoryModel.value?.totalRemainWeight.separatedByComma ?? 0}', + ), + ], + ), + ); + }); + } + + GestureDetector timeFilterWidget({ + isFrom = true, + required Rx date, + required Function(Jalali jalali) onChanged, + }) { + return GestureDetector( + onTap: () { + Get.bottomSheet(modalDatePicker((value) => onChanged(value))); + }, + child: Container( + height: 40, + decoration: BoxDecoration( + color: AppColor.bgLight, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.darkGreyLight), + ), + padding: EdgeInsets.symmetric(horizontal: 11, vertical: 4), + child: Row( + spacing: 8, + children: [ + Assets.vec.calendarSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(AppColor.bgDark, BlendMode.srcIn), + ), + Text('تاریخ', style: AppFonts.yekan16.copyWith(color: AppColor.bgDark)), + Expanded( + child: ObxValue((data) { + return Text( + date.value.formatCompactDate(), + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark), + ); + }, date), + ), + ], + ), + ), + ); + } + + Container modalDatePicker(ValueChanged onDateSelected) { + Jalali? tempPickedDate; + return Container( + height: 250, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: Row( + children: [ + SizedBox(width: 20), + RElevated( + height: 35, + width: 70, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'تایید', + ), + Spacer(), + RElevated( + height: 35, + width: 70, + backgroundColor: AppColor.error, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'لغو', + ), + SizedBox(width: 20), + ], + ), + ), + Divider(height: 0, thickness: 1), + Expanded( + child: Container( + child: PersianCupertinoDatePicker( + initialDateTime: controller.saleDate.value, + mode: PersianCupertinoDatePickerMode.date, + onDateTimeChanged: (dateTime) { + tempPickedDate = dateTime; + }, + ), + ), + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/segmentation/logic.dart b/packages/chicken/lib/presentation/pages/segmentation/logic.dart new file mode 100644 index 0000000..3e673d0 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/segmentation/logic.dart @@ -0,0 +1,215 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; +import 'package:rasadyar_core/core.dart'; + +class SegmentationLogic extends GetxController { + RootLogic rootLogic = Get.find(); + + RxBool isLoadingMoreAllocationsMade = false.obs; + RxInt currentPage = 1.obs; + + late List routesName; + RxInt selectedSegmentIndex = 0.obs; + RxBool isExpanded = false.obs; + + RxList isExpandedList = [].obs; + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + RxInt saleType = 1.obs; + GlobalKey formKey = GlobalKey(); + TextEditingController weightController = TextEditingController(text: '0'); + RxBool isSubmitButtonEnabled = false.obs; + Rxn selectedGuildModel = Rxn(); + Rxn selectedProduct = Rxn(); + Rxn selectedSegment = Rxn(); + + Rx>> segmentationList = + Resource>.loading().obs; + + RxList guildsModel = [].obs; + + @override + void onInit() { + super.onInit(); + routesName = ['قطعه‌بندی'].toList(); + once(rootLogic.rolesProductsModel, (callback) => selectedProduct.value = callback.first); + getAllSegmentation(); + getGuilds(); + } + + @override + void onReady() { + super.onReady(); + setUpListener(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + void setSearchValue(String? value) { + searchedValue.value = value?.trim(); + } + + void setUpListener() { + debounce( + searchedValue, + (callback) => getAllSegmentation(), + time: Duration(milliseconds: timeDebounce), + ); + ever(selectedSegment, (_) { + validateForm(); + }); + + weightController.addListener(() => validateForm()); + } + + void setEditData(SegmentationModel item) { + selectedSegment.value = item; + weightController.text = item.weight.toString(); + } + + void clearForm() { + weightController.text = '0'; + selectedSegment.value = null; + selectedGuildModel.value = null; + } + + void validateForm() { + var weight = int.tryParse(weightController.text.clearComma.trim()); + isSubmitButtonEnabled.value = + selectedProduct.value != null && + weightController.text.isNotEmpty && + weight! > 0 && + (saleType.value == 1 || (saleType.value == 2 && selectedGuildModel.value != null)); + } + + Future getAllSegmentation([bool isLoadingMore = false]) async { + if (isLoadingMore) { + isLoadingMoreAllocationsMade.value = true; + } else { + segmentationList.value = Resource>.loading(); + } + + if (searchedValue.value != null && + searchedValue.value!.trim().isNotEmpty && + currentPage.value > 1) { + currentPage.value = 1; // Reset to first page if search value is set + } + + await safeCall( + call: () async => await rootLogic.chickenRepository.getSegmentation( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + pageSize: 20, + page: currentPage.value, + search: 'filter', + role: 'Steward', + value: searchedValue.value, + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), + ), + ), + + onSuccess: (result) { + if ((result?.count ?? 0) == 0) { + segmentationList.value = Resource>.empty(); + } else { + segmentationList.value = Resource>.success( + PaginationModel( + count: result?.count ?? 0, + next: result?.next, + previous: result?.previous, + results: [ + ...(segmentationList.value.data?.results ?? []), + ...(result?.results ?? []), + ], + ), + ); + + isLoadingMoreAllocationsMade.value = false; + } + }, + ); + } + + Future deleteSegmentation(String key) async { + await safeCall( + showError: false, + call: () => rootLogic.chickenRepository.deleteSegmentation( + token: rootLogic.tokenService.accessToken.value!, + key: key, + ), + ); + } + + Future editSegment() async { + var res = true; + safeCall( + showError: true, + call: () async => await rootLogic.chickenRepository.editSegmentation( + token: rootLogic.tokenService.accessToken.value!, + model: SegmentationModel( + key: selectedSegment.value?.key, + weight: int.tryParse(weightController.text.clearComma) ?? 0, + ), + ), + onSuccess: (result) { + res = true; + }, + onError: (error, stacktrace) { + res = false; + }, + ); + return res; + } + + Future createSegment() async { + var res = true; + SegmentationModel segmentationModel = SegmentationModel( + productKey: selectedProduct.value?.key, + weight: int.tryParse(weightController.text.clearComma) ?? 0, + ); + if (saleType.value == 2) { + segmentationModel = segmentationModel.copyWith(guildKey: selectedGuildModel.value?.key); + } + await safeCall( + call: () async => await rootLogic.chickenRepository.createSegmentation( + token: rootLogic.tokenService.accessToken.value!, + model: segmentationModel, + ), + onSuccess: (result) { + res = true; + }, + onError: (error, stacktrace) { + res = false; + }, + ); + return res; + } + + Future getGuilds() async { + safeCall( + call: () async => await rootLogic.chickenRepository.getGuilds( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams(queryParams: {'all': true}, role: 'Steward'), + ), + onSuccess: (result) { + if (result != null) { + guildsModel.clear(); + guildsModel.addAll(result); + } + }, + onError: (error, stacktrace) {}, + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/segmentation/view.dart b/packages/chicken/lib/presentation/pages/segmentation/view.dart new file mode 100644 index 0000000..a028920 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/segmentation/view.dart @@ -0,0 +1,430 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; +import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; +import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; + + +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SegmentationPage extends GetView { + @override + Widget build(BuildContext context) { + return BasePage( + routes: controller.routesName, + onSearchChanged: (data) => controller.setSearchValue(data), + filteringWidget: filterBottomSheet(), + hasBack: false, + widgets: [ + Expanded( + child: ObxValue((data) { + return RPaginatedListView( + onLoadMore: () async => controller.getAllSegmentation(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getAllSegmentation(); + }, + hasMore: data.value.data?.next != null, + listType: ListType.separated, + resource: data.value, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item, index), + labelColor: AppColor.blueLight, + labelIconColor: AppColor.customGrey, + labelIcon: Assets.vec.convertCubeSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.segmentationList), + ), + ], + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + floatingActionButton: RFab.add( + onPressed: () { + Get.bottomSheet( + addOrEditBottomSheet(), + isScrollControlled: true, + ignoreSafeArea: false, + ).whenComplete(() { + controller.clearForm(); + }); + }, + ), + ); + } + + Widget filterBottomSheet() => filterBottomSheetWidget( + fromDate: controller.fromDateFilter, + onChangedFromDate: (jalali) => controller.fromDateFilter.value = jalali, + toDate: controller.toDateFilter, + onChangedToDate: (jalali) => controller.toDateFilter.value = jalali, + onSubmit: () => controller.getAllSegmentation(), + ); + + itemListWidget(SegmentationModel item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(width: 12), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + item.toGuild != null ? 'مباشر' : 'قطعه‌بند', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + Text( + item.date?.formattedJalaliDate ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + SizedBox(width: 4), + Expanded( + flex: 5, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + item.toGuild != null + ? item.toGuild?.user?.fullname ?? 'N/A' + : item.buyer?.fullname ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + SizedBox(height: 2), + Text( + item.toGuild != null + ? item.toGuild?.guildsName ?? 'N/A' + : item.buyer?.shop ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + SizedBox(width: 4), + Expanded( + flex: 2, + child: Text( + '${item.weight.separatedByComma} KG', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + ), + ), + ], + ); + } + + itemListExpandedWidget(SegmentationModel item, int index) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Column( + spacing: 8, + children: [ + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + DateTimeExtensions(item.date)?.toJalali().formatter.wN ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '${DateTimeExtensions(item.date)?.toJalali().formatter.d} ${DateTimeExtensions(item.date)?.toJalali().formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + + Text( + '${DateTimeExtensions(item.date)?.toJalali().formatter.y}', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${DateTimeExtensions(item.date)?.toJalali().formatter.tHH}:${DateTimeExtensions(item.date)?.toJalali().formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + buildRow( + title: 'مشخصات خریدار', + value: item.toGuild != null + ? item.toGuild?.user?.fullname ?? 'N/A' + : item.buyer?.fullname ?? 'N/A', + ), + buildRow( + title: 'تلفن خریدار', + value: item.toGuild != null + ? item.toGuild?.user?.mobile ?? 'N/A' + : item.buyer?.mobile ?? 'N/A', + ), + buildRow( + title: 'نام واحد', + value: item.toGuild != null + ? item.toGuild?.guildsName ?? 'N/A' + : item.buyer?.shop ?? 'N/A', + ), + buildRow(title: 'ماهیت', value: item.toGuild != null ? 'مباشر' : 'قطعه‌بند'), + buildRow(title: 'وزن قطعه‌بندی', value: '${item.weight?.separatedByComma}'), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + onPressed: () { + controller.setEditData(item); + Get.bottomSheet( + addOrEditBottomSheet(true), + isScrollControlled: true, + ignoreSafeArea: false, + ).whenComplete(() { + controller.clearForm(); + }); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + controller.isExpandedList.remove(index); + controller.deleteSegmentation(item.key!); + }, + onRefresh: () => controller.getAllSegmentation(), + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ], + ), + ); + } + + Widget addOrEditBottomSheet([bool isOnEdit = false]) { + return BaseBottomSheet( + height: 430.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 16, + children: [ + Text( + isOnEdit ? 'ویرایش قطعه‌بندی' : 'افزودن قطعه‌بندی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + _productDropDown(), + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + + child: Column( + children: [ + const SizedBox(height: 8), + SizedBox( + height: 40, + child: ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Radio( + value: 1, + groupValue: controller.saleType.value, + onChanged: (value) { + controller.saleType.value = value!; + + controller.selectedGuildModel.value = null; + controller.selectedGuildModel.refresh(); + }, + ), + Text('قطعه‌بندی(مباشر)', style: AppFonts.yekan14), + SizedBox(width: 12), + Radio( + value: 2, + groupValue: controller.saleType.value, + onChanged: (value) { + controller.saleType.value = value!; + }, + ), + Text('تخصیص به قطعه‌بند', style: AppFonts.yekan14), + ], + ); + }, controller.saleType), + ), + const SizedBox(height: 12), + + guildsDropDown(), + ], + ), + ), + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + UnitTextField( + hint: 'وزن', + unit: 'کیلوگرم', + controller: controller.weightController, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + validator: (value) { + if (value == null) { + return 'لطفاً وزن لاشه را وارد کنید'; + } + return null; + }, + ), + submitButtonWidget(isOnEdit), + ], + ), + ), + SizedBox(), + ], + ), + ), + ), + ); + } + + Widget submitButtonWidget(bool isOnEdit) { + return ObxValue((data) { + return RElevated( + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + text: isOnEdit ? 'ویرایش' : 'ثبت', + onPressed: data.value + ? () async { + var res = isOnEdit + ? await controller.editSegment() + : await controller.createSegment(); + if (res) { + await controller.getAllSegmentation(); + controller.clearForm(); + Get.back(); + } + } + : null, + height: 40, + ); + }, controller.isSubmitButtonEnabled); + } + + Widget _productDropDown() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.rolesProductsModel, + height: 56, + hasDropIcon: false, + background: Colors.white, + onChanged: (value) { + controller.selectedProduct.value = value; + }, + selectedItem: controller.selectedProduct.value, + initialValue: controller.selectedProduct.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Row( + spacing: 8, + children: [ + (item?.name?.contains('مرغ گرم') ?? false) + ? Assets.images.chicken.image(width: 40, height: 40) + : Assets.vec.placeHolderSvg.svg(width: 40, height: 40), + + Text(item?.name ?? 'انتخاب محصول'), + Spacer(), + Text( + 'موجودی: ${controller.rootLogic.inventoryModel.value?.totalRemainWeight.separatedByComma ?? 0} کیلوگرم', + ), + ], + ), + ); + }); + } + + Widget guildsDropDown() { + return Obx(() { + final item = controller.selectedGuildModel.value; + return OverlayDropdownWidget( + key: ValueKey(item?.user?.fullname ?? ''), + items: controller.guildsModel, + isDisabled: controller.saleType.value == 1, + onChanged: (value) { + controller.selectedGuildModel.value = value; + }, + selectedItem: item, + + itemBuilder: (item) => Text( + item.user != null + ? '${item.steward == true ? 'مباشر' : 'صنف'} ${item.user!.fullname} (${item.user!.mobile})' + : 'بدون نام', + ), + labelBuilder: (item) => Text( + item?.user != null + ? '${item?.steward == true ? 'مباشر' : 'صنف'} ${item?.user!.fullname} (${item?.user!.mobile})' + : 'انتخاب مباشر/صنف', + ), + ); + }); + } +} diff --git a/packages/chicken/lib/presentation/routes/pages.dart b/packages/chicken/lib/presentation/routes/pages.dart new file mode 100644 index 0000000..c86c424 --- /dev/null +++ b/packages/chicken/lib/presentation/routes/pages.dart @@ -0,0 +1,149 @@ +import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/auth/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_all/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_waiting/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_out_of_province/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_out_of_province/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/home/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/home/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/profile/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sale/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_in_province/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_in_province/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_sales_list/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/segmentation/logic.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/search/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +sealed class ChickenPages { + ChickenPages._(); + + static final pages = [ + GetPage( + name: ChickenRoutes.auth, + page: () => AuthPage(), + binding: BindingsBuilder(() { + Get.lazyPut(() => AuthLogic()); + Get.lazyPut(() => CaptchaWidgetLogic()); + }), + ), + + GetPage( + name: ChickenRoutes.init, + page: () => RootPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => RootLogic()); + Get.lazyPut(() => HomeLogic()); + Get.lazyPut(() => BuyLogic()); + Get.lazyPut(() => SaleLogic()); + Get.lazyPut(() => ProfileLogic()); + Get.lazyPut(() => SegmentationLogic()); + Get.lazyPut(() => SearchLogic()); + }), + ), + + GetPage( + name: ChickenRoutes.home, + page: () => HomePage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.put(HomeLogic()); + Get.lazyPut(() => BaseLogic()); + }), + ), + + //sales + GetPage( + name: ChickenRoutes.sale, + page: () => SalePage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => SaleLogic()); + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => SalesOutOfProvinceLogic()); + Get.lazyPut(() => RootLogic()); + }), + ), + GetPage( + name: ChickenRoutes.salesOutOfProvince, + page: () => SalesOutOfProvincePage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => SearchLogic()); + Get.lazyPut(() => SalesOutOfProvinceLogic()); + Get.lazyPut(() => SalesOutOfProvinceBuyersLogic()); + Get.lazyPut(() => SalesOutOfProvinceSalesListLogic()); + }), + ), + GetPage( + name: ChickenRoutes.salesOutOfProvinceBuyer, + page: () => SalesOutOfProvinceBuyersPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => SearchLogic()); + Get.lazyPut(() => SalesOutOfProvinceLogic()); + Get.lazyPut(() => SalesOutOfProvinceBuyersLogic()); + Get.lazyPut(() => SalesOutOfProvinceSalesListLogic()); + }), + ), + GetPage( + name: ChickenRoutes.salesInProvince, + page: () => SalesInProvincePage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => SalesInProvinceLogic()); + Get.lazyPut(() => SearchLogic()); + }), + ), + + //buy + GetPage( + name: ChickenRoutes.buy, + page: () => BuyPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => BuyLogic()); + }), + ), + GetPage( + name: ChickenRoutes.buysOutOfProvince, + page: () => BuyOutOfProvincePage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => SearchLogic()); + Get.lazyPut(() => BuyOutOfProvinceLogic()); + }), + ), + GetPage( + name: ChickenRoutes.buysInProvince, + page: () => BuyInProvincePage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => SearchLogic()); + Get.lazyPut(() => BuyInProvinceLogic()); + Get.lazyPut(() => BuyInProvinceWaitingLogic()); + Get.lazyPut(() => BuyInProvinceAllLogic()); + }), + ), + ]; +} diff --git a/packages/chicken/lib/presentation/routes/routes.dart b/packages/chicken/lib/presentation/routes/routes.dart new file mode 100644 index 0000000..ae174ee --- /dev/null +++ b/packages/chicken/lib/presentation/routes/routes.dart @@ -0,0 +1,22 @@ +sealed class ChickenRoutes { + ChickenRoutes._(); + + static const auth = '/AuthChicken'; + static const _base = '/chicken'; + static const init = '$_base/'; + static const home = '$_base/home'; + static const buy = '$_base/buy'; + static const sale = '$_base/sale'; + static const segmentation = '$_base/segmentation'; + + //buys + static const buysOutOfProvince = '$buy/buyOutOfProvince'; + static const buysInProvince = '$buy/buyInProvince'; + + //sales + static const salesInProvince = '$sale/SalesInProvince'; + static const salesOutOfProvince = '$sale/saleOutOfProvince'; + static const salesOutOfProvinceBuyer = '$sale/saleOutOfProvinceBuyer '; + + +} diff --git a/packages/chicken/lib/presentation/utils/string_utils.dart b/packages/chicken/lib/presentation/utils/string_utils.dart new file mode 100644 index 0000000..9145793 --- /dev/null +++ b/packages/chicken/lib/presentation/utils/string_utils.dart @@ -0,0 +1,33 @@ +extension XStringUtils on String { + get faAllocationType { + final tmp = split('_'); + tmp.insert(1, '_'); + if (tmp.length > 1) { + return tmp.map((e) => utilsMap[e] ?? e).join(' '); + } else { + return utilsMap[this] ?? this; + } + } + + get faItem => utilsMap[this] ?? this; + + get buyerIsGuild { + final tmp = split('_'); + if (tmp.length > 1) { + return tmp.last == 'guild'; + } else { + return false; + } + } +} + +Map utilsMap = { + 'killhouse': 'کشتارگاه', + '_': 'به', + 'steward': 'مباشر', + 'exclusive': 'اختصاصی', + 'free': 'آزاد', + 'pending': 'در انتظار', + 'accepted': 'تایید شده', + 'guild': 'صنف', +}; diff --git a/packages/chicken/lib/presentation/utils/utils.dart b/packages/chicken/lib/presentation/utils/utils.dart new file mode 100644 index 0000000..f6f89f3 --- /dev/null +++ b/packages/chicken/lib/presentation/utils/utils.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_core/core.dart'; + +const int timeDebounce = 1200; + +void handleGeneric(DioException error, [void Function()? onError]) { + Get.showSnackbar(_errorSnackBar('اعتبار توکن شما منقضی شده است لطفا دوباره وارد شوید')); + + Get.offAllNamed(ChickenRoutes.auth, arguments: Module.chicken); +} + +GetSnackBar _errorSnackBar(String message) { + return GetSnackBar( + titleText: Text('خطا', style: AppFonts.yekan14.copyWith(color: Colors.white)), + messageText: Text(message, style: AppFonts.yekan12.copyWith(color: Colors.white)), + backgroundColor: AppColor.error, + margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8), + borderRadius: 12, + duration: Duration(milliseconds: 3500), + snackPosition: SnackPosition.TOP, + ); +} diff --git a/packages/chicken/lib/presentation/widget/app_bar.dart b/packages/chicken/lib/presentation/widget/app_bar.dart new file mode 100644 index 0000000..c7795ea --- /dev/null +++ b/packages/chicken/lib/presentation/widget/app_bar.dart @@ -0,0 +1,97 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/search/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +RAppBar chickenAppBar({ + bool hasBack = true, + bool hasFilter = true, + bool hasSearch = true, + bool isBase = false, + VoidCallback? onBackPressed, + GestureTapCallback? onFilterTap, + GestureTapCallback? onSearchTap, +}) { + return RAppBar( + hasBack: isBase == true ? false : hasBack, + onBackPressed: onBackPressed, + leadingWidth: 155, + leading: Row( + mainAxisSize: MainAxisSize.min, + spacing: 6, + children: [ + Text('رصدطیور', style: AppFonts.yekan16Bold.copyWith(color: Colors.white)), + Assets.vec.chickenSvg.svg( + width: 24, + height: 24, + ), + ], + ), + additionalActions: [ + if (!isBase && hasSearch) searchWidget(onSearchTap), + SizedBox(width: 8), + if (!isBase && hasFilter) filterWidget(onFilterTap), + SizedBox(width: 8), + ], + ); +} + + +GestureDetector filterWidget(GestureTapCallback? onFilterTap) { + return GestureDetector( + onTap: onFilterTap, + child: Stack( + alignment: Alignment.topRight, + children: [ + Assets.vec.filterOutlineSvg.svg( + width: 20, + height: 20, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Obx(() { + final controller = Get.find(); + return Visibility( + visible: controller.isFilterSelected.value, + child: Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + color: Colors.red, + shape: BoxShape.circle, + ), + ), + ); + }), + ], + ), + ); +} +GestureDetector searchWidget(GestureTapCallback? onSearchTap) { + return GestureDetector( + onTap: onSearchTap, + child: Stack( + alignment: Alignment.topRight, + children: [ + Assets.vec.searchSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Obx(() { + final controller = Get.find(); + return Visibility( + visible: controller.searchValue.value!=null, + child: Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + color: Colors.red, + shape: BoxShape.circle, + ), + ), + ); + }), + ], + ), + ); +} \ No newline at end of file diff --git a/packages/chicken/lib/presentation/widget/base_page/logic.dart b/packages/chicken/lib/presentation/widget/base_page/logic.dart new file mode 100644 index 0000000..f33fa71 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/base_page/logic.dart @@ -0,0 +1,9 @@ +import 'package:rasadyar_core/core.dart'; + +class BaseLogic extends GetxController { + final RxBool isFilterSelected = false.obs; + + void toggleFilter() { + isFilterSelected.value = !isFilterSelected.value; + } +} diff --git a/packages/chicken/lib/presentation/widget/base_page/view.dart b/packages/chicken/lib/presentation/widget/base_page/view.dart new file mode 100644 index 0000000..4159fc2 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/base_page/view.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/widget/app_bar.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/page_route.dart'; +import 'package:rasadyar_chicken/presentation/widget/search/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/search/view.dart'; +import 'package:rasadyar_core/core.dart'; + +class BasePage extends StatefulWidget { + const BasePage({ + super.key, + this.routes, + required this.widgets, + this.routesWidget, + this.floatingActionButtonLocation, + this.floatingActionButton, + this.onSearchChanged, + this.hasBack = true, + this.hasFilter = true, + this.hasSearch = true, + this.isBase = false, + this.onBackPressed, + this.onFilterTap, + this.onSearchTap, + this.filteringWidget, + }) : assert( + (routes != null) || routesWidget != null, + 'Either routes or routesWidget must be provided.', + ); + + final List? routes; + final Widget? routesWidget; + final List widgets; + final FloatingActionButtonLocation? floatingActionButtonLocation; + final Widget? floatingActionButton; + final Widget? filteringWidget; + final void Function(String?)? onSearchChanged; + final bool hasBack; + final bool hasFilter; + final bool hasSearch; + final bool isBase; + final VoidCallback? onBackPressed; + final GestureTapCallback? onFilterTap; + final GestureTapCallback? onSearchTap; + + @override + State createState() => _BasePageState(); +} + +class _BasePageState extends State { + BaseLogic get controller => Get.find(); + Worker? filterWorker; + bool _isBottomSheetOpen = false; + @override + void initState() { + super.initState(); + /* filterWorker = ever(controller.isFilterSelected, (bool isSelected) { + if (!mounted) return; + + if (isSelected && widget.filteringWidget != null) { + // بررسی اینکه آیا bottomSheet از قبل باز است یا نه + if (_isBottomSheetOpen) { + controller.isFilterSelected.value = false; + return; + } + + // بررسی اینکه آیا route فعلی current است یا نه + if (ModalRoute.of(context)?.isCurrent != true) { + controller.isFilterSelected.value = false; + return; + } + + _isBottomSheetOpen = true; + Get.bottomSheet( + widget.filteringWidget!, + isScrollControlled: true, + isDismissible: true, + enableDrag: true, + ).then((_) { + // تنظیم مقدار به false بعد از بسته شدن bottomSheet + if (mounted) { + _isBottomSheetOpen = false; + controller.isFilterSelected.value = false; + } + }); + } + });*/ + } + + @override + void dispose() { + filterWorker?.dispose(); + super.dispose(); + } + void _onFilterTap() { + if (widget.hasFilter && widget.filteringWidget != null) { + // بررسی اینکه آیا این route در top است یا نه + final currentRoute = ModalRoute.of(context); + if (currentRoute?.isCurrent != true) { + return; + } + + // مستقیماً bottomSheet را باز کنید + Get.bottomSheet( + widget.filteringWidget!, + isScrollControlled: true, + isDismissible: true, + enableDrag: true, + ); + } + } + + + @override + Widget build(BuildContext context) { + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) => widget.onBackPressed, + child: Scaffold( + backgroundColor: AppColor.bgLight, + appBar: chickenAppBar( + hasBack: widget.isBase ? false : widget.hasBack, + onBackPressed: widget.onBackPressed, + hasFilter: widget.hasFilter, + hasSearch: widget.hasSearch, + isBase: widget.isBase, + onFilterTap: widget.hasFilter ? _onFilterTap : null, + onSearchTap: widget.hasSearch ? () => Get.find().toggleSearch() : null, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + widget.routesWidget != null ? widget.routesWidget! : buildPageRoute(widget.routes!), + if (!widget.isBase && widget.hasSearch) ...{ + SearchWidget(onSearchChanged: widget.onSearchChanged), + }, + ...widget.widgets, + ], + ), + floatingActionButtonLocation: widget.floatingActionButtonLocation, + floatingActionButton: widget.floatingActionButton, + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/widget/captcha/logic.dart b/packages/chicken/lib/presentation/widget/captcha/logic.dart new file mode 100644 index 0000000..806df2a --- /dev/null +++ b/packages/chicken/lib/presentation/widget/captcha/logic.dart @@ -0,0 +1,34 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class CaptchaWidgetLogic extends GetxController with StateMixin { + TextEditingController textController = TextEditingController(); + RxnString captchaKey = RxnString(); + GlobalKey formKey = GlobalKey(); + + final Random random = Random(); + + @override + void onInit() { + super.onInit(); + + getCaptcha(); + } + + @override + void onClose() { + textController.clear(); + textController.dispose(); + super.onClose(); + } + + Future getCaptcha() async { + change(null, status: RxStatus.loading()); + textController.clear(); + await Future.delayed(Duration(milliseconds: 500)); + captchaKey.value = (random.nextInt(900_000) + 100_000).toString(); + change(captchaKey.value, status: RxStatus.success()); + } +} diff --git a/packages/chicken/lib/presentation/widget/captcha/view.dart b/packages/chicken/lib/presentation/widget/captcha/view.dart new file mode 100644 index 0000000..b3418a9 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/captcha/view.dart @@ -0,0 +1,109 @@ +import 'dart:math'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class CaptchaWidget extends GetView { + const CaptchaWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: controller.getCaptcha, + child: Container( + width: 135, + height: 50, + alignment: Alignment.center, + clipBehavior: Clip.antiAliasWithSaveLayer, + decoration: BoxDecoration( + color: AppColor.whiteNormalHover, + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(8), + ), + child: controller.obx( + (state) => Text( + state ?? '', + style: AppFonts.yekan20Bold.copyWith(color: Colors.black, letterSpacing: 2.5), + textAlign: TextAlign.center, + ), + onLoading: const Center( + child: CupertinoActivityIndicator(color: AppColor.blueNormal), + ), + onError: (error) { + return Center( + child: Text('خطا ', style: AppFonts.yekan13.copyWith(color: Colors.red)), + ); + }, + ), + ), + ), + + const SizedBox(width: 8), + Expanded( + child: Form( + key: controller.formKey, + autovalidateMode: AutovalidateMode.disabled, + child: RTextField( + label: 'کد امنیتی', + controller: controller.textController, + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: AppColor.textColor, width: 1), + ), + keyboardType: TextInputType.numberWithOptions(decimal: false, signed: false), + maxLines: 1, + maxLength: 6, + suffixIcon: (controller.textController.text.trim().isNotEmpty ?? false) + ? clearButton(() => controller.textController.clear()) + : null, + + validator: (value) { + if (value == null || value.isEmpty) { + return 'کد امنیتی را وارد کنید'; + } + return null; + }, + onChanged: (pass) { + if (pass.length == 6) { + if (controller.formKey.currentState?.validate() ?? false) { + Get.find().isDisabled.value = false; + } + } + }, + style: AppFonts.yekan13, + ), + ), + ), + ], + ); + } +} + +class _CaptchaLinePainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + final random = Random(); + final paint1 = Paint() + ..color = Colors.deepOrange + ..strokeWidth = 2; + final paint2 = Paint() + ..color = Colors.blue + ..strokeWidth = 2; + + // First line: top-left to bottom-right + canvas.drawLine(Offset(0, 0), Offset(size.width, size.height), paint1); + + // Second line: bottom-left to top-right + canvas.drawLine(Offset(0, size.height), Offset(size.width, 0), paint2); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} diff --git a/packages/chicken/lib/presentation/widget/cluster_marker.dart b/packages/chicken/lib/presentation/widget/cluster_marker.dart new file mode 100644 index 0000000..4c8d82a --- /dev/null +++ b/packages/chicken/lib/presentation/widget/cluster_marker.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; + +class AnimatedClusterMarker extends StatefulWidget { + final int count; + + const AnimatedClusterMarker({super.key, required this.count}); + + @override + State createState() => _AnimatedClusterMarkerState(); +} + +class _AnimatedClusterMarkerState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; + + @override + void initState() { + super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 300), + )..forward(); // start animation + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ScaleTransition( + scale: CurvedAnimation(parent: _controller, curve: Curves.easeOutBack), + child: Opacity( + opacity: _controller.value, + child: Container( + width: 40, + height: 40, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.blueAccent, + shape: BoxShape.circle, + border: Border.all(color: Colors.white, width: 2), + ), + child: Text( + widget.count.toString(), + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/widget/filter_bottom_sheet.dart b/packages/chicken/lib/presentation/widget/filter_bottom_sheet.dart new file mode 100644 index 0000000..a2a2173 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/filter_bottom_sheet.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +Widget filterBottomSheetWidget({ + required Rx fromDate, + required Function(Jalali jalali) onChangedFromDate, + required Rx toDate, + required Function(Jalali jalali) onChangedToDate, + required VoidCallback onSubmit, +}) { + return BaseBottomSheet( + height: 200, + child: Column( + spacing: 16, + children: [ + Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + Row( + spacing: 8, + children: [ + Expanded( + child: dateFilterWidget(date: fromDate, onChanged: onChangedFromDate), + ), + Expanded( + child: dateFilterWidget(isFrom: false, date: toDate, onChanged: onChangedToDate), + ), + ], + ), + + RElevated( + height: 40, + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + text: 'اعمال فیلتر', + onPressed: () { + onSubmit(); + Get.back(); + }, + ), + + ], + ), + ); +} diff --git a/packages/chicken/lib/presentation/widget/inventory_widget.dart b/packages/chicken/lib/presentation/widget/inventory_widget.dart new file mode 100644 index 0000000..1d43026 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/inventory_widget.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +Widget inventoryWidget(RootLogic rootLogic) { + return Container( + width: Get.width, + height: 39, + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: AppColor.greenLight, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.textColor, width: 0.5), + ), + alignment: Alignment.center, + child: ObxValue((data) { + return Text( + ' موجودی انبار: ${data.value?.totalRemainWeight?.toInt().separatedByComma ?? '0'} کیلوگرم', + style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkHover), + ); + }, rootLogic.inventoryModel), + ); +} diff --git a/packages/chicken/lib/presentation/widget/list_item/list_item.dart b/packages/chicken/lib/presentation/widget/list_item/list_item.dart new file mode 100644 index 0000000..fd65df6 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/list_item/list_item.dart @@ -0,0 +1,242 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ListItem extends StatelessWidget { + const ListItem({ + super.key, + required this.index, + required this.child, + required this.secondChild, + required this.labelColor, + required this.labelIcon, + required this.onTap, + required this.selected, + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final int index; + final Widget child; + final Widget secondChild; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback onTap; + final bool selected; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: AnimatedSize( + duration: Duration(milliseconds: 400), + alignment: Alignment.center, + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.centerRight, + children: [ + AnimatedSize( + duration: Duration(milliseconds: 300), + child: Container( + width: Get.width - 30, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + child: AnimatedCrossFade( + alignment: Alignment.center, + firstChild: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + secondChild: Container( + padding: EdgeInsets.fromLTRB(8, 12, 14, 12), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: secondChild, + ), + crossFadeState: selected + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, + duration: Duration(milliseconds: 300), + ), + ), + Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn), + ), + ), + ), + ], + ), + ), + ), + + Positioned( + right: -12, + child: Container( + width: index < 999 ? 24 : null, + height: index < 999 ? 24 : null, + padding: EdgeInsets.all(2), + decoration: BoxDecoration( + color: AppColor.greenLightHover, + borderRadius: BorderRadius.circular(4), + border: Border.all(width: 0.50, color: AppColor.greenDarkActive), + ), + alignment: Alignment.center, + child: Text( + (index + 1).toString(), + style: AppFonts.yekan12.copyWith(color: Colors.black), + ), + ), + ), + ], + ), + ), + ), + ); + } +} + +class ListItem2 extends StatelessWidget { + const ListItem2({ + super.key, + required this.index, + required this.child, + required this.secondChild, + required this.labelColor, + required this.labelIcon, + required this.onTap, + required this.selected, + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final int index; + final Widget child; + final Widget secondChild; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback onTap; + final bool selected; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: AnimatedSize( + duration: Duration(milliseconds: 400), + alignment: Alignment.center, + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.centerRight, + children: [ + AnimatedCrossFade( + firstChild: Row( + children: [ + Expanded( + child: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + ), + Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + //TODO + colorFilter: ColorFilter.mode( + labelIconColor ?? AppColor.mediumGreyDarkActive, + BlendMode.srcIn, + ), + ), + ), + ), + ], + ), + secondChild: Container( + padding: EdgeInsets.fromLTRB(8, 8, 12, 12), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: secondChild, + ), + crossFadeState: selected ? CrossFadeState.showSecond : CrossFadeState.showFirst, + duration: Duration(milliseconds: 300), + ), + + Positioned( + right: -12, + child: Container( + width: index < 999 ? 24 : null, + height: index < 999 ? 24 : null, + padding: EdgeInsets.all(2), + decoration: BoxDecoration( + color: AppColor.greenLightHover, + borderRadius: BorderRadius.circular(4), + border: Border.all(width: 0.50, color: AppColor.greenDarkActive), + ), + alignment: Alignment.center, + child: Text( + (index + 1).toString(), + style: AppFonts.yekan12.copyWith(color: Colors.black), + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/widget/page_route.dart b/packages/chicken/lib/presentation/widget/page_route.dart new file mode 100644 index 0000000..956d564 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/page_route.dart @@ -0,0 +1,12 @@ +import 'package:flutter/cupertino.dart'; +import 'package:rasadyar_core/core.dart'; + +Widget buildPageRoute(List route) { + return Padding( + padding: const EdgeInsets.fromLTRB(0, 4, 7, 4), + child: Text( + route.isEmpty ? 'خانه' : route.join(" > "), + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ); +} diff --git a/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart b/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart new file mode 100644 index 0000000..9c8459c --- /dev/null +++ b/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +Widget saleOrBuyItemCard({ + String? title, + String? iconPath, + required VoidCallback onTap, + Color? color, +}) { + return InkWell( + borderRadius: BorderRadius.circular(8.r), + onTap: onTap, + child: Card( + color: Colors.white, + shape: RoundedRectangleBorder( + side: BorderSide(color: color ?? AppColor.blueNormal, width: 1.0.w), + borderRadius: BorderRadius.circular(8.r), + ), + child: Container( + width: 160.w, + height: 160.h, + padding: const EdgeInsets.all(8.0), + + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (iconPath != null) + SvgGenImage.vec(iconPath).svg( + width: 64.w, + height: 64.h, + colorFilter: ColorFilter.mode(color ?? AppColor.blueNormal, BlendMode.srcIn), + ), + SizedBox(height: 12.h), + if (title != null) + Text( + title, + style: AppFonts.yekan16Bold.copyWith(color: color ?? AppColor.blueNormal), + ), + ], + ), + ), + ), + ); +} diff --git a/packages/chicken/lib/presentation/widget/search/logic.dart b/packages/chicken/lib/presentation/widget/search/logic.dart new file mode 100644 index 0000000..4379a4a --- /dev/null +++ b/packages/chicken/lib/presentation/widget/search/logic.dart @@ -0,0 +1,21 @@ +import 'package:rasadyar_core/core.dart'; + +class SearchLogic extends GetxController { + final RxBool isSearchSelected = false.obs; + + final RxnString searchValue = RxnString(); + + void setSearchCallback(void Function(String)? onSearchChanged) { + debounce(searchValue, (val) { + if (val != null && val.trim().isNotEmpty) { + onSearchChanged?.call(val); + } + }, time: const Duration(milliseconds: 600)); + } + + void toggleSearch() { + isSearchSelected.value = !isSearchSelected.value; + } + + +} diff --git a/packages/chicken/lib/presentation/widget/search/view.dart b/packages/chicken/lib/presentation/widget/search/view.dart new file mode 100644 index 0000000..1e09056 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/search/view.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class SearchWidget extends StatefulWidget { + const SearchWidget({super.key, this.onSearchChanged}); + + final void Function(String?)? onSearchChanged; + + @override + State createState() => _SearchWidgetState(); +} + +class _SearchWidgetState extends State { + late final SearchLogic controller; + final TextEditingController textEditingController = TextEditingController(); + + @override + void initState() { + super.initState(); + controller = Get.find(); + controller.setSearchCallback(widget.onSearchChanged); + } + + @override + Widget build(BuildContext context) { + return ObxValue((data) { + return AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + height: data.value ? 40 : 0, + child: Visibility( + visible: data.value, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: RTextField( + height: 40, + borderColor: AppColor.blackLight, + suffixIcon: ObxValue( + (data) => Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: (data.value == null) + ? Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ) + : IconButton( + onPressed: () { + textEditingController.clear(); + controller.searchValue.value = null; + controller.isSearchSelected.value = false; + widget.onSearchChanged?.call(null); + }, + enableFeedback: true, + padding: EdgeInsets.zero, + iconSize: 24, + splashRadius: 50, + icon: Assets.vec.closeCircleSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ), + controller.searchValue, + ), + hintText: 'جستجو کنید ...', + hintStyle: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + filledColor: Colors.white, + filled: true, + controller: textEditingController, + onChanged: (val) => controller.searchValue.value = val, + ), + ), + ), + ); + }, controller.isSearchSelected); + } +} diff --git a/packages/chicken/lib/presentation/widget/widely_used/logic.dart b/packages/chicken/lib/presentation/widget/widely_used/logic.dart new file mode 100644 index 0000000..9da8caf --- /dev/null +++ b/packages/chicken/lib/presentation/widget/widely_used/logic.dart @@ -0,0 +1,32 @@ +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_core/core.dart'; + +enum WidelyUsedType { edit, normal } + +class WidelyUsedLogic extends GetxController { + Rx type = WidelyUsedType.normal.obs; + RootLogic rootLogic = Get.find(); + + + @override + void onReady() { + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + bool isOnEdit() => type.value == WidelyUsedType.edit; + + void toggleType() { + fLog(rootLogic.widelyUsedList); + if (type.value == WidelyUsedType.edit) { + type.value = WidelyUsedType.normal; + } else { + type.value = WidelyUsedType.edit; + } + } +} diff --git a/packages/chicken/lib/presentation/widget/widely_used/view.dart b/packages/chicken/lib/presentation/widget/widely_used/view.dart new file mode 100644 index 0000000..26db171 --- /dev/null +++ b/packages/chicken/lib/presentation/widget/widely_used/view.dart @@ -0,0 +1,224 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class WidelyUsedWidget extends StatelessWidget { + const WidelyUsedWidget({super.key}); + + @override + Widget build(BuildContext context) { + final WidelyUsedLogic controller = Get.put(WidelyUsedLogic()); + + return Column( + children: [ + Padding( + padding: EdgeInsetsGeometry.all(6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('پر کاربرد ها', textAlign: TextAlign.right, style: AppFonts.yekan16), + /* ObxValue((data) { + return GestureDetector( + onTap: () { + controller.toggleType(); + }, + child: controller.isOnEdit() + ? Assets.vec.checkSvg.svg( + width: 12.w, + height: 12.h, + colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn), + ) + : Assets.vec.editSvg.svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ); + }, controller.type)*/ + ], + ), + ), + + Padding( + padding: const EdgeInsets.symmetric(horizontal: 2.0, vertical: 2), + child: Wrap( + spacing: 15, + runSpacing: 8, + children: [ + widelyUsed( + title: 'خرید خارج استان', + iconPath: Assets.vec.truckFastSvg.path, + isOnEdit: false, + + cardColor: AppColor.greenLightActive, + labelColor: AppColor.greenNormal, + textColor: AppColor.greenDarkHover, + onTap: () async { + controller.rootLogic.currentPage.value = 0; + controller.rootLogic.currentPage.refresh(); + await Future.delayed(Duration(milliseconds: 100)); + Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0); + }, + ), + + widelyUsed( + title: 'خرید داخل استان', + iconPath: Assets.vec.cubeSvg.path, + cardColor: AppColor.greenLightActive, + labelColor: AppColor.greenNormal, + textColor: AppColor.greenDarkHover, + onTap: () async { + controller.rootLogic.currentPage.value = 0; + controller.rootLogic.currentPage.refresh(); + await Future.delayed(Duration(milliseconds: 100)); + Get.toNamed(ChickenRoutes.buysInProvince, id: 0); + }, + isOnEdit: false, + ), + + widelyUsed( + title: 'فروش خارج استان', + iconPath: Assets.vec.truckFastSvg.path, + isOnEdit: false, + onTap: () async { + controller.rootLogic.currentPage.value = 1; + controller.rootLogic.currentPage.refresh(); + await Future.delayed(Duration(milliseconds: 100)); + Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1); + }, + ), + + widelyUsed( + title: 'فروش داخل استان', + iconPath: Assets.vec.cubeSvg.path, + isOnEdit: false, + onTap: () async { + controller.rootLogic.currentPage.value = 1; + controller.rootLogic.currentPage.refresh(); + await Future.delayed(Duration(milliseconds: 100)); + Get.toNamed(ChickenRoutes.salesInProvince, id: 1); + }, + ), + ], + ), + ), + ], + ); + } + + Widget widelyUsed({ + required String title, + required String iconPath, + required VoidCallback onTap, + required bool isOnEdit, + Color? cardColor, + Color? labelColor, + Color? textColor, + }) { + return GestureDetector( + onTap: !isOnEdit ? onTap : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + spacing: 4, + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: 48, + height: 48, + padding: EdgeInsets.all(4), + decoration: ShapeDecoration( + color: cardColor ?? Color(0xFFBECDFF), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Container( + width: 40, + height: 40, + decoration: ShapeDecoration( + color: labelColor ?? AppColor.blueNormal, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + fit: BoxFit.cover, + ), + ), + ), + Visibility( + visible: isOnEdit, + child: Container( + width: 48, + height: 48, + padding: EdgeInsets.all(4), + decoration: ShapeDecoration( + color: Colors.white60, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + ), + ), + + Visibility( + visible: isOnEdit, + child: Positioned( + top: -15, + left: -12, + child: SizedBox( + width: 32.w, + height: 32.h, + child: GestureDetector( + onTap: () {}, + behavior: HitTestBehavior.translucent, + child: Center( + child: Container( + width: 16, + height: 16, + decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.white), + alignment: Alignment.center, + child: Icon(CupertinoIcons.minus, color: AppColor.error, size: 15), + ), + ), + ), + ), + ), + ), + ], + ), + Text(title, style: AppFonts.yekan10.copyWith(color: textColor ?? AppColor.blueNormal)), + ], + ), + ); + } + + Widget addWidelyUsed({required VoidCallback onTap}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + spacing: 4, + children: [ + Container( + width: 48, + height: 48, + padding: EdgeInsets.all(4), + decoration: ShapeDecoration( + color: const Color(0xFFD9F7F0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Assets.vec.messageAddSvg.svg( + width: 40, + height: 40, + colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn), + fit: BoxFit.cover, + ), + ), + Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)), + ], + ); + } +} diff --git a/packages/chicken/pubspec.yaml b/packages/chicken/pubspec.yaml new file mode 100644 index 0000000..55b6790 --- /dev/null +++ b/packages/chicken/pubspec.yaml @@ -0,0 +1,32 @@ +name: rasadyar_chicken +description: A starting point for Dart libraries or applications. +version: 1.2.1+2 + +environment: + sdk: ^3.8.1 + + +dependencies: + flutter: + sdk: flutter + rasadyar_core: + path: ../core + + ##code generation + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + lints: ^6.0.0 + test: ^1.25.15 + ##code generation + build_runner: ^2.6.0 + hive_ce_generator: ^1.9.3 + freezed: ^3.2.0 + json_serializable: ^6.10.0 + + ##test + mocktail: ^1.0.4 + get_test: ^4.0.1 diff --git a/packages/core/build.yaml b/packages/core/build.yaml new file mode 100644 index 0000000..840029b --- /dev/null +++ b/packages/core/build.yaml @@ -0,0 +1,6 @@ +targets: + $default: + builders: + json_serializable: + options: + field_rename: snake \ No newline at end of file diff --git a/packages/core/build/unit_test_assets/AssetManifest.json b/packages/core/build/unit_test_assets/AssetManifest.json new file mode 100644 index 0000000..52a2006 --- /dev/null +++ b/packages/core/build/unit_test_assets/AssetManifest.json @@ -0,0 +1 @@ +{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"packages/flutter_map/lib/assets/flutter_map_logo.png":["packages/flutter_map/lib/assets/flutter_map_logo.png"],"packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf":["packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf"],"packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf":["packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf"],"packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf":["packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf"]} \ No newline at end of file diff --git a/packages/core/build/unit_test_assets/packages/flutter_map/lib/assets/flutter_map_logo.png b/packages/core/build/unit_test_assets/packages/flutter_map/lib/assets/flutter_map_logo.png new file mode 100644 index 0000000..8603d0a Binary files /dev/null and b/packages/core/build/unit_test_assets/packages/flutter_map/lib/assets/flutter_map_logo.png differ diff --git a/packages/core/lib/core.dart b/packages/core/lib/core.dart new file mode 100644 index 0000000..c881e08 --- /dev/null +++ b/packages/core/lib/core.dart @@ -0,0 +1,61 @@ +library; + +export 'package:android_intent_plus/android_intent.dart'; +export 'package:android_intent_plus/flag.dart'; +export 'package:device_info_plus/device_info_plus.dart'; +export 'package:dio/dio.dart'; +//other packages +export 'package:flutter_localizations/flutter_localizations.dart'; +export 'package:flutter_map/flutter_map.dart'; +export 'package:flutter_map_animations/flutter_map_animations.dart'; +export 'package:flutter_rating_bar/flutter_rating_bar.dart'; +export 'package:flutter_screenutil/flutter_screenutil.dart'; +export 'package:flutter_secure_storage/flutter_secure_storage.dart'; +export 'package:flutter_slidable/flutter_slidable.dart'; +export 'package:font_awesome_flutter/font_awesome_flutter.dart'; +//freezed +export 'package:freezed_annotation/freezed_annotation.dart'; +export 'package:geolocator/geolocator.dart'; +export 'package:get/get.dart' hide FormData, MultipartFile, Response; +//di +export 'package:get_it/get_it.dart'; +//local storage +export 'package:hive_ce_flutter/hive_flutter.dart'; +///image picker +export 'package:image_picker/image_picker.dart'; +//encryption +//export 'package:encrypt/encrypt.dart' show Encrypted; + +//Map and location +export 'package:latlong2/latlong.dart'; +export 'package:package_info_plus/package_info_plus.dart'; +export 'package:path_provider/path_provider.dart'; +export 'package:permission_handler/permission_handler.dart' hide ServiceStatus; +export 'package:persian_datetime_picker/persian_datetime_picker.dart'; +export 'package:pretty_dio_logger/pretty_dio_logger.dart'; +export 'package:rasadyar_core/presentation/common/common.dart'; +export 'package:rasadyar_core/presentation/utils/utils.dart'; +export 'package:rasadyar_core/presentation/widget/widget.dart'; +export 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart'; + +//models +export 'data/model/model.dart'; +//data +export 'data/services/services.dart'; +//infrastructure +export 'infrastructure/infrastructure.dart'; +export 'infrastructure/local/hive_local_storage.dart'; +export 'injection/di.dart'; +//routing +export 'routing/auth_route_resolver.dart'; +export 'utils/extension/date_time_utils.dart'; +export 'utils/extension/num_utils.dart'; +export 'utils/extension/string_utils.dart'; +//utils +export 'utils/logger_utils.dart'; +export 'utils/map_utils.dart'; +export 'utils/network/network.dart'; +export 'utils/route_utils.dart'; +export 'utils/separator_input_formatter.dart'; + +export 'utils/utils.dart'; diff --git a/packages/core/lib/data/model/local/module/module_model.dart b/packages/core/lib/data/model/local/module/module_model.dart new file mode 100644 index 0000000..3ca5760 --- /dev/null +++ b/packages/core/lib/data/model/local/module/module_model.dart @@ -0,0 +1,16 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/data/model/local/user_local/user_local_model.dart'; + +part 'module_model.freezed.dart'; + + +@freezed +abstract class ModuleModel with _$ModuleModel{ + const factory ModuleModel({ + required String title, + required String icon, + required Module module, + }) = _ModuleModel; + +} \ No newline at end of file diff --git a/packages/core/lib/data/model/local/module/module_model.freezed.dart b/packages/core/lib/data/model/local/module/module_model.freezed.dart new file mode 100644 index 0000000..aedd18f --- /dev/null +++ b/packages/core/lib/data/model/local/module/module_model.freezed.dart @@ -0,0 +1,277 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'module_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$ModuleModel { + + String get title; String get icon; Module get module; +/// Create a copy of ModuleModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ModuleModelCopyWith get copyWith => _$ModuleModelCopyWithImpl(this as ModuleModel, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ModuleModel&&(identical(other.title, title) || other.title == title)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.module, module) || other.module == module)); +} + + +@override +int get hashCode => Object.hash(runtimeType,title,icon,module); + +@override +String toString() { + return 'ModuleModel(title: $title, icon: $icon, module: $module)'; +} + + +} + +/// @nodoc +abstract mixin class $ModuleModelCopyWith<$Res> { + factory $ModuleModelCopyWith(ModuleModel value, $Res Function(ModuleModel) _then) = _$ModuleModelCopyWithImpl; +@useResult +$Res call({ + String title, String icon, Module module +}); + + + + +} +/// @nodoc +class _$ModuleModelCopyWithImpl<$Res> + implements $ModuleModelCopyWith<$Res> { + _$ModuleModelCopyWithImpl(this._self, this._then); + + final ModuleModel _self; + final $Res Function(ModuleModel) _then; + +/// Create a copy of ModuleModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? title = null,Object? icon = null,Object? module = null,}) { + return _then(_self.copyWith( +title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable +as String,module: null == module ? _self.module : module // ignore: cast_nullable_to_non_nullable +as Module, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ModuleModel]. +extension ModuleModelPatterns on ModuleModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ModuleModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ModuleModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ModuleModel value) $default,){ +final _that = this; +switch (_that) { +case _ModuleModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ModuleModel value)? $default,){ +final _that = this; +switch (_that) { +case _ModuleModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String title, String icon, Module module)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ModuleModel() when $default != null: +return $default(_that.title,_that.icon,_that.module);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String title, String icon, Module module) $default,) {final _that = this; +switch (_that) { +case _ModuleModel(): +return $default(_that.title,_that.icon,_that.module);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String title, String icon, Module module)? $default,) {final _that = this; +switch (_that) { +case _ModuleModel() when $default != null: +return $default(_that.title,_that.icon,_that.module);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _ModuleModel implements ModuleModel { + const _ModuleModel({required this.title, required this.icon, required this.module}); + + +@override final String title; +@override final String icon; +@override final Module module; + +/// Create a copy of ModuleModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ModuleModelCopyWith<_ModuleModel> get copyWith => __$ModuleModelCopyWithImpl<_ModuleModel>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ModuleModel&&(identical(other.title, title) || other.title == title)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.module, module) || other.module == module)); +} + + +@override +int get hashCode => Object.hash(runtimeType,title,icon,module); + +@override +String toString() { + return 'ModuleModel(title: $title, icon: $icon, module: $module)'; +} + + +} + +/// @nodoc +abstract mixin class _$ModuleModelCopyWith<$Res> implements $ModuleModelCopyWith<$Res> { + factory _$ModuleModelCopyWith(_ModuleModel value, $Res Function(_ModuleModel) _then) = __$ModuleModelCopyWithImpl; +@override @useResult +$Res call({ + String title, String icon, Module module +}); + + + + +} +/// @nodoc +class __$ModuleModelCopyWithImpl<$Res> + implements _$ModuleModelCopyWith<$Res> { + __$ModuleModelCopyWithImpl(this._self, this._then); + + final _ModuleModel _self; + final $Res Function(_ModuleModel) _then; + +/// Create a copy of ModuleModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? title = null,Object? icon = null,Object? module = null,}) { + return _then(_ModuleModel( +title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable +as String,module: null == module ? _self.module : module // ignore: cast_nullable_to_non_nullable +as Module, + )); +} + + +} + +// dart format on diff --git a/packages/core/lib/data/model/local/user_local/user_local_model.dart b/packages/core/lib/data/model/local/user_local/user_local_model.dart new file mode 100644 index 0000000..beb08f2 --- /dev/null +++ b/packages/core/lib/data/model/local/user_local/user_local_model.dart @@ -0,0 +1,70 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/utils/local/local_utils.dart'; + +part 'user_local_model.g.dart'; + +@HiveType(typeId: authUserLocalModelTypeId) +class UserLocalModel extends HiveObject { + @HiveField(0) + String? username; + @HiveField(1) + String? password; + @HiveField(2) + String? token; + @HiveField(3) + String? refreshToken; + @HiveField(4) + String? name; + + @HiveField(5) + Module? module; + + @HiveField(6) + String? backend; + + @HiveField(7) + String? apiKey; + + UserLocalModel({ + this.username, + this.password, + this.token, + this.refreshToken, + this.name, + this.module, + this.backend, + this.apiKey, + }); + + UserLocalModel copyWith({ + String? username, + String? password, + String? token, + String? refreshToken, + String? name, + Module? module, + String? backend, + String? apiKey, + }) { + return UserLocalModel( + username: username ?? this.username, + password: password ?? this.password, + token: token ?? this.token, + refreshToken: refreshToken ?? this.refreshToken, + name: name ?? this.name, + module: module ?? this.module, + backend: backend ?? this.backend, + apiKey: apiKey ?? this.apiKey, + ); + } +} + +@HiveType(typeId: authModuleTypeId) +enum Module { + @HiveField(0) + liveStocks, + @HiveField(1) + inspection, + @HiveField(2) + chicken, +} diff --git a/packages/core/lib/data/model/local/user_local/user_local_model.g.dart b/packages/core/lib/data/model/local/user_local/user_local_model.g.dart new file mode 100644 index 0000000..93e49af --- /dev/null +++ b/packages/core/lib/data/model/local/user_local/user_local_model.g.dart @@ -0,0 +1,103 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_local_model.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class UserLocalModelAdapter extends TypeAdapter { + @override + final typeId = 0; + + @override + UserLocalModel read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return UserLocalModel( + username: fields[0] as String?, + password: fields[1] as String?, + token: fields[2] as String?, + refreshToken: fields[3] as String?, + name: fields[4] as String?, + module: fields[5] as Module?, + backend: fields[6] as String?, + apiKey: fields[7] as String?, + ); + } + + @override + void write(BinaryWriter writer, UserLocalModel obj) { + writer + ..writeByte(8) + ..writeByte(0) + ..write(obj.username) + ..writeByte(1) + ..write(obj.password) + ..writeByte(2) + ..write(obj.token) + ..writeByte(3) + ..write(obj.refreshToken) + ..writeByte(4) + ..write(obj.name) + ..writeByte(5) + ..write(obj.module) + ..writeByte(6) + ..write(obj.backend) + ..writeByte(7) + ..write(obj.apiKey); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UserLocalModelAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} + +class ModuleAdapter extends TypeAdapter { + @override + final typeId = 1; + + @override + Module read(BinaryReader reader) { + switch (reader.readByte()) { + case 0: + return Module.liveStocks; + case 1: + return Module.inspection; + case 2: + return Module.chicken; + default: + return Module.liveStocks; + } + } + + @override + void write(BinaryWriter writer, Module obj) { + switch (obj) { + case Module.liveStocks: + writer.writeByte(0); + case Module.inspection: + writer.writeByte(1); + case Module.chicken: + writer.writeByte(2); + } + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModuleAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/packages/core/lib/data/model/model.dart b/packages/core/lib/data/model/model.dart new file mode 100644 index 0000000..6d07ea5 --- /dev/null +++ b/packages/core/lib/data/model/model.dart @@ -0,0 +1,4 @@ + +export 'pagination_model/pagination_model.dart'; +export 'local/module/module_model.dart'; +export 'local/user_local/user_local_model.dart'; diff --git a/packages/core/lib/data/model/pagination_model/pagination_model.dart b/packages/core/lib/data/model/pagination_model/pagination_model.dart new file mode 100644 index 0000000..67a30bd --- /dev/null +++ b/packages/core/lib/data/model/pagination_model/pagination_model.dart @@ -0,0 +1,20 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'pagination_model.freezed.dart'; +part 'pagination_model.g.dart'; + +@Freezed(genericArgumentFactories: true) +abstract class PaginationModel with _$PaginationModel { + const factory PaginationModel({ + int? count, + String? next, + String? previous, + List? results, + }) = _PaginationModel; + + factory PaginationModel.fromJson( + Map json, + T Function(Object?) fromJsonT, + ) => _$PaginationModelFromJson(json, fromJsonT); + +} \ No newline at end of file diff --git a/packages/core/lib/data/model/pagination_model/pagination_model.freezed.dart b/packages/core/lib/data/model/pagination_model/pagination_model.freezed.dart new file mode 100644 index 0000000..2d77be8 --- /dev/null +++ b/packages/core/lib/data/model/pagination_model/pagination_model.freezed.dart @@ -0,0 +1,294 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'pagination_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$PaginationModel { + + int? get count; String? get next; String? get previous; List? get results; +/// Create a copy of PaginationModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaginationModelCopyWith> get copyWith => _$PaginationModelCopyWithImpl>(this as PaginationModel, _$identity); + + /// Serializes this PaginationModel to a JSON map. + Map toJson(Object? Function(T) toJsonT); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaginationModel&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other.results, results)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(results)); + +@override +String toString() { + return 'PaginationModel<$T>(count: $count, next: $next, previous: $previous, results: $results)'; +} + + +} + +/// @nodoc +abstract mixin class $PaginationModelCopyWith { + factory $PaginationModelCopyWith(PaginationModel value, $Res Function(PaginationModel) _then) = _$PaginationModelCopyWithImpl; +@useResult +$Res call({ + int? count, String? next, String? previous, List? results +}); + + + + +} +/// @nodoc +class _$PaginationModelCopyWithImpl + implements $PaginationModelCopyWith { + _$PaginationModelCopyWithImpl(this._self, this._then); + + final PaginationModel _self; + final $Res Function(PaginationModel) _then; + +/// Create a copy of PaginationModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) { + return _then(_self.copyWith( +count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable +as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable +as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable +as String?,results: freezed == results ? _self.results : results // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaginationModel]. +extension PaginationModelPatterns on PaginationModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaginationModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaginationModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaginationModel value) $default,){ +final _that = this; +switch (_that) { +case _PaginationModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaginationModel value)? $default,){ +final _that = this; +switch (_that) { +case _PaginationModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? count, String? next, String? previous, List? results)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaginationModel() when $default != null: +return $default(_that.count,_that.next,_that.previous,_that.results);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? count, String? next, String? previous, List? results) $default,) {final _that = this; +switch (_that) { +case _PaginationModel(): +return $default(_that.count,_that.next,_that.previous,_that.results);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? count, String? next, String? previous, List? results)? $default,) {final _that = this; +switch (_that) { +case _PaginationModel() when $default != null: +return $default(_that.count,_that.next,_that.previous,_that.results);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable(genericArgumentFactories: true) + +class _PaginationModel implements PaginationModel { + const _PaginationModel({this.count, this.next, this.previous, final List? results}): _results = results; + factory _PaginationModel.fromJson(Map json,T Function(Object?) fromJsonT) => _$PaginationModelFromJson(json,fromJsonT); + +@override final int? count; +@override final String? next; +@override final String? previous; + final List? _results; +@override List? get results { + final value = _results; + if (value == null) return null; + if (_results is EqualUnmodifiableListView) return _results; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of PaginationModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaginationModelCopyWith> get copyWith => __$PaginationModelCopyWithImpl>(this, _$identity); + +@override +Map toJson(Object? Function(T) toJsonT) { + return _$PaginationModelToJson(this, toJsonT); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaginationModel&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other._results, _results)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(_results)); + +@override +String toString() { + return 'PaginationModel<$T>(count: $count, next: $next, previous: $previous, results: $results)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaginationModelCopyWith implements $PaginationModelCopyWith { + factory _$PaginationModelCopyWith(_PaginationModel value, $Res Function(_PaginationModel) _then) = __$PaginationModelCopyWithImpl; +@override @useResult +$Res call({ + int? count, String? next, String? previous, List? results +}); + + + + +} +/// @nodoc +class __$PaginationModelCopyWithImpl + implements _$PaginationModelCopyWith { + __$PaginationModelCopyWithImpl(this._self, this._then); + + final _PaginationModel _self; + final $Res Function(_PaginationModel) _then; + +/// Create a copy of PaginationModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) { + return _then(_PaginationModel( +count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable +as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable +as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable +as String?,results: freezed == results ? _self._results : results // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + + +} + +// dart format on diff --git a/packages/core/lib/data/model/pagination_model/pagination_model.g.dart b/packages/core/lib/data/model/pagination_model/pagination_model.g.dart new file mode 100644 index 0000000..bc0f5a6 --- /dev/null +++ b/packages/core/lib/data/model/pagination_model/pagination_model.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pagination_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_PaginationModel _$PaginationModelFromJson( + Map json, + T Function(Object? json) fromJsonT, +) => _PaginationModel( + count: (json['count'] as num?)?.toInt(), + next: json['next'] as String?, + previous: json['previous'] as String?, + results: (json['results'] as List?)?.map(fromJsonT).toList(), +); + +Map _$PaginationModelToJson( + _PaginationModel instance, + Object? Function(T value) toJsonT, +) => { + 'count': instance.count, + 'next': instance.next, + 'previous': instance.previous, + 'results': instance.results?.map(toJsonT).toList(), +}; diff --git a/packages/core/lib/data/services/auth_middelware.dart b/packages/core/lib/data/services/auth_middelware.dart new file mode 100644 index 0000000..d0ec70c --- /dev/null +++ b/packages/core/lib/data/services/auth_middelware.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class AuthMiddleware extends GetMiddleware { + final tokenService = Get.find(); + final authRouteResolver = Get.find(); + + @override + RouteSettings? redirect(String? route) { + final refreshToken = tokenService.refreshToken.value; + final accessToken = tokenService.accessToken.value; + final module = tokenService.appModule.value; + + if (refreshToken == null || accessToken == null) { + if (module != null) { + final authRoute = authRouteResolver.getAuthRouteForModule(module); + return RouteSettings(name: authRoute, arguments: module); + } + return RouteSettings(name: authRouteResolver.getFallbackRoute()); + } + return super.redirect(route); + } +} diff --git a/packages/core/lib/data/services/services.dart b/packages/core/lib/data/services/services.dart new file mode 100644 index 0000000..893fe8b --- /dev/null +++ b/packages/core/lib/data/services/services.dart @@ -0,0 +1,2 @@ +export 'auth_middelware.dart'; +export 'token_storage_service.dart'; diff --git a/packages/core/lib/data/services/token_storage_service.dart b/packages/core/lib/data/services/token_storage_service.dart new file mode 100644 index 0000000..ab551c9 --- /dev/null +++ b/packages/core/lib/data/services/token_storage_service.dart @@ -0,0 +1,89 @@ +import 'dart:convert'; + +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/hive_registrar.g.dart'; + +class TokenStorageService extends GetxService { + static const String _tokenBoxName = 'TokenBox'; + static const String _appBoxName = 'AppBox'; + static const String _accessTokenKey = 'accessToken'; + static const String _refreshTokenKey = 'refreshToken'; + static const String _baseUrlKey = 'baseUrl'; + static const String _apiKey = 'apiKey'; + static const String _moduleKey = 'moduleSelected'; + + final FlutterSecureStorage _secureStorage = FlutterSecureStorage(); + final HiveLocalStorage _localStorage = diCore.get(); + + RxnString accessToken = RxnString(); + RxnString refreshToken = RxnString(); + RxnString baseurl = RxnString(); + Rxn appModule = Rxn(null); + + Future init() async { + await Hive.initFlutter(); + Hive.registerAdapters(); + + final String? encryptedKey = await _secureStorage.read(key: 'hive_enc_key'); + final encryptionKey = encryptedKey != null + ? base64Url.decode(encryptedKey) + : Hive.generateSecureKey(); + + if (encryptedKey == null) { + await _secureStorage.write(key: 'hive_enc_key', value: base64UrlEncode(encryptionKey)); + } + + await _localStorage.init(); + await _localStorage.openBox(_tokenBoxName, encryptionCipher: HiveAesCipher(encryptionKey)); + await _localStorage.openBox(_appBoxName); + + accessToken.value = _localStorage.read(boxName: _tokenBoxName, key: _accessTokenKey); + refreshToken.value = _localStorage.read(boxName: _tokenBoxName, key: _refreshTokenKey); + appModule.value = getModule(); + baseurl.value = _localStorage.read(boxName: _appBoxName, key: _baseUrlKey); + } + + Future saveAccessToken(String token) async { + await _localStorage.save(boxName: _tokenBoxName, key: _accessTokenKey, value: token); + accessToken.value = token; + accessToken.refresh(); + } + + Future saveRefreshToken(String token) async { + await _localStorage.save(boxName: _tokenBoxName, key: _refreshTokenKey, value: token); + refreshToken.value = token; + refreshToken.refresh(); + } + + Future saveModule(Module input) async { + await _localStorage.save(boxName: _tokenBoxName, key: _moduleKey, value: input); + appModule.value = input; + appModule.refresh(); + } + + Module? getModule() { + return _localStorage.read(boxName: _tokenBoxName, key: _moduleKey); + } + + Future deleteTokens() async { + await _localStorage.clear(_tokenBoxName); + accessToken.value = null; + refreshToken.value = null; + } + + Future saveBaseUrl(String url) async { + await _localStorage.save(boxName: _appBoxName, key: _baseUrlKey, value: url); + baseurl.value = url; + baseurl.refresh(); + } + + void getBaseUrl() { + var url = _localStorage.read(boxName: _appBoxName, key: _baseUrlKey); + baseurl.value = url; + baseurl.refresh(); + } + + Future saveApiKey(String key) async { + await _localStorage.save(boxName: _tokenBoxName, key: _apiKey, value: key); + } +} diff --git a/packages/core/lib/hive_registrar.g.dart b/packages/core/lib/hive_registrar.g.dart new file mode 100644 index 0000000..b5b6dfa --- /dev/null +++ b/packages/core/lib/hive_registrar.g.dart @@ -0,0 +1,20 @@ +// Generated by Hive CE +// Do not modify +// Check in to version control + +import 'package:hive_ce/hive.dart'; +import 'package:rasadyar_core/data/model/local/user_local/user_local_model.dart'; + +extension HiveRegistrar on HiveInterface { + void registerAdapters() { + registerAdapter(ModuleAdapter()); + registerAdapter(UserLocalModelAdapter()); + } +} + +extension IsolatedHiveRegistrar on IsolatedHiveInterface { + void registerAdapters() { + registerAdapter(ModuleAdapter()); + registerAdapter(UserLocalModelAdapter()); + } +} diff --git a/packages/core/lib/infrastructure/infrastructure.dart b/packages/core/lib/infrastructure/infrastructure.dart new file mode 100644 index 0000000..86f93f0 --- /dev/null +++ b/packages/core/lib/infrastructure/infrastructure.dart @@ -0,0 +1,14 @@ +// local +export 'local/hive_local_storage.dart'; +export 'local/i_local_storage.dart'; + +//remote +export 'remote/interfaces/i_form_data.dart'; +export 'remote/interfaces/i_http_client.dart'; +export 'remote/interfaces/i_http_response.dart'; +export 'remote/interfaces/i_remote.dart'; + +export 'remote/app_interceptor.dart'; +export 'remote/dio_form_data.dart'; +export 'remote/dio_remote.dart'; +export 'remote/dio_response.dart'; \ No newline at end of file diff --git a/packages/core/lib/infrastructure/local/hive_local_storage.dart b/packages/core/lib/infrastructure/local/hive_local_storage.dart new file mode 100644 index 0000000..fb3142e --- /dev/null +++ b/packages/core/lib/infrastructure/local/hive_local_storage.dart @@ -0,0 +1,103 @@ +import 'package:flutter/foundation.dart'; +import 'package:rasadyar_core/core.dart'; + +class HiveLocalStorage implements ILocalStorage { + @override + Future init() async { + if (kIsWeb) { + Hive.init('hive_storage_rasadyar'); + } else { + await Hive.initFlutter(); + } + } + + @override + Future openBox( + String boxName, { + HiveCipher? encryptionCipher, + bool crashRecovery = true, + String? path, + Uint8List? bytes, + String? collection, + }) async { + var exist = await Hive.boxExists(boxName); + if (!exist || !Hive.isBoxOpen(boxName)) { + await Hive.openBox( + boxName, + encryptionCipher: encryptionCipher, + crashRecovery: crashRecovery, + ); + } + } + + @override + T? read({required String boxName, required String key}) { + try { + Box? box = getBox(boxName); + return box?.get(key) as T?; + } on Exception catch (e) { + eLog(e); + return null; + } + } + + @override + List? readBox({required String boxName}) { + try { + Box? box = getBox(boxName); + return box?.values.cast().toList(); + } on Exception catch (e) { + eLog(e); + return null; + } + } + + @override + Future add({required String boxName, required dynamic value}) async { + Box? box = getBox(boxName); + await box?.add(value); + } + + @override + Future addAll({required String boxName, required Iterable values}) async { + Box? box = getBox(boxName); + await box?.addAll(values); + } + + Box? getBox(String boxName) { + final box = Hive.box(boxName); + return box; + } + + @override + Future clear(String boxName) async { + await Hive.box(boxName).clear(); + } + + @override + Future close(String boxName) async => await Hive.box(boxName).close(); + + @override + Future deleteValue({required String boxName, required String key}) async { + Box? box = getBox(boxName); + await box?.delete(key); + } + + @override + Future save({required String boxName, required String key, required value}) async { + Box? box = getBox(boxName); + await box?.put(key, value); + } + + @override + Future saveAll({required String boxName, required Map entries}) async { + Box? box = getBox(boxName); + await box?.putAll(entries); + } + + @override + Future saveAt({required String boxName, required int index, required value}) async { + Box? box = getBox(boxName); + await box?.putAt(index, value); + } +} diff --git a/packages/core/lib/infrastructure/local/i_local_storage.dart b/packages/core/lib/infrastructure/local/i_local_storage.dart new file mode 100644 index 0000000..55026de --- /dev/null +++ b/packages/core/lib/infrastructure/local/i_local_storage.dart @@ -0,0 +1,35 @@ +import 'package:flutter/foundation.dart'; +import 'package:hive_ce/hive.dart'; + +abstract class ILocalStorage { + Future init(); + + Future openBox( + String boxName, { + HiveCipher? encryptionCipher, + bool crashRecovery = true, + String? path, + Uint8List? bytes, + String? collection, + }); + + T? read({required String boxName, required String key}); + + List? readBox({required String boxName}); + + Future deleteValue({required String boxName, required String key}); + + Future add({required String boxName, required E value}); + + Future addAll({required String boxName, required Iterable values}); + + Future clear(String boxName); + + Future close(String boxName); + + Future save({required String boxName, required String key, required dynamic value}); + + Future saveAt({required String boxName, required int index, required dynamic value}); + + Future saveAll({required String boxName, required Map entries}); +} diff --git a/packages/core/lib/infrastructure/remote/app_interceptor.dart b/packages/core/lib/infrastructure/remote/app_interceptor.dart new file mode 100644 index 0000000..8af53d5 --- /dev/null +++ b/packages/core/lib/infrastructure/remote/app_interceptor.dart @@ -0,0 +1,114 @@ +import 'dart:async'; + +import '../../core.dart'; + +typedef RefreshTokenCallback = Future Function(); +typedef SaveTokenCallback = Future Function(String token); +typedef ClearTokenCallback = Future Function(); + +class AppInterceptor extends Interceptor { + final RefreshTokenCallback? refreshTokenCallback; + final SaveTokenCallback saveTokenCallback; + final ClearTokenCallback clearTokenCallback; + late final Dio dio; + dynamic authArguments; + static Completer? _refreshCompleter; + static bool _isRefreshing = false; + + AppInterceptor({ + required this.saveTokenCallback, + required this.clearTokenCallback, + this.refreshTokenCallback, + this.authArguments, + }); + + @override + Future onRequest(RequestOptions options, RequestInterceptorHandler handler) async { + if (_isRefreshing && _refreshCompleter != null) { + try { + final newToken = await _refreshCompleter!.future; + if (newToken != null && newToken.isNotEmpty) { + options.headers['Authorization'] = 'Bearer $newToken'; + } else { + // اگر توکن جدید وجود نداشت، درخواست را رد کن + handler.reject(DioException(requestOptions: options, type: DioExceptionType.cancel)); + return; + } + } catch (_) { + handler.reject(DioException(requestOptions: options, type: DioExceptionType.cancel)); + return; + } + } + handler.next(options); + } + + @override + Future onError(DioException err, ErrorInterceptorHandler handler) async { + if (err.response?.statusCode == 401) { + final retryResult = await _handleUnauthorizedError(err); + if (retryResult != null) { + handler.resolve(retryResult); + return; + } + // اگر رفرش توکن ناموفق بود، درخواست را رد کن + handler.reject(err); + return; + } + handler.next(err); + } + + Future _handleUnauthorizedError(DioException err) async { + // اگر رفرش در جریان است، منتظر نتیجه‌ی آن بمان + if (_isRefreshing && _refreshCompleter != null) { + try { + final newToken = await _refreshCompleter!.future; + return newToken != null ? await _retryRequest(err.requestOptions, newToken) : null; + } catch (_) { + return null; + } + } + + // فقط یک بار فرآیند رفرش را شروع کن + _isRefreshing = true; + _refreshCompleter = Completer(); + + try { + final newToken = await refreshTokenCallback?.call(); + + if (newToken != null && newToken.isNotEmpty) { + await saveTokenCallback(newToken); // ذخیره توکن جدید + _refreshCompleter!.complete(newToken); + return await _retryRequest(err.requestOptions, newToken); + } else { + await clearTokenCallback(); // پاک کردن توکن‌های قبلی + _refreshCompleter!.complete(null); + _handleRefreshFailure(); + return null; + } + } catch (e) { + if (!_refreshCompleter!.isCompleted) { + _refreshCompleter!.completeError(e); + } + await clearTokenCallback(); // پاک کردن توکن در صورت خطا + _handleRefreshFailure(); + return null; + } finally { + _isRefreshing = false; + _refreshCompleter = null; + } + } + + Future _retryRequest(RequestOptions options, String token) async { + final newOptions = options.copyWith(); + newOptions.headers['Authorization'] = 'Bearer $token'; + return dio.fetch(newOptions); + } + + void _handleRefreshFailure() { + ApiHandler.cancelAllRequests("Token refresh failed"); + + if (Get.currentRoute != '/Auth') { + Get.offAllNamed('/Auth', arguments: authArguments ?? 'Module.chicken'); + } + } +} diff --git a/packages/core/lib/infrastructure/remote/dio_form_data.dart b/packages/core/lib/infrastructure/remote/dio_form_data.dart new file mode 100644 index 0000000..8e74832 --- /dev/null +++ b/packages/core/lib/infrastructure/remote/dio_form_data.dart @@ -0,0 +1,23 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; + +import 'interfaces/i_form_data.dart'; + +class DioFormData implements IFormData { + final FormData _formData = FormData(); + + @override + void addFile(String field, Uint8List bytes, String filename) { + _formData.files.add(MapEntry( + field, + MultipartFile.fromBytes(bytes, filename: filename), + )); + } + + @override + void addField(String key, String value) { + _formData.fields.add(MapEntry(key, value)); + } + + FormData get raw => _formData; +} diff --git a/packages/core/lib/infrastructure/remote/dio_remote.dart b/packages/core/lib/infrastructure/remote/dio_remote.dart new file mode 100644 index 0000000..473ca3e --- /dev/null +++ b/packages/core/lib/infrastructure/remote/dio_remote.dart @@ -0,0 +1,175 @@ +import 'package:flutter/foundation.dart'; +import 'package:rasadyar_core/core.dart'; + +class DioRemote implements IHttpClient { + String? baseUrl; + late Dio dio; + AppInterceptor? interceptors; + + DioRemote({this.baseUrl, this.interceptors}); + + @override + Future init() async { + dio = Dio(BaseOptions(baseUrl: baseUrl ?? '')); + if (interceptors != null) { + dio.interceptors.add(interceptors!); + } + + if (kDebugMode) { + dio.interceptors.add( + PrettyDioLogger( + request: true, + enabled: true, + requestHeader: true, + responseHeader: true, + requestBody: true, + responseBody: true, + ), + ); + } + } + + @override + Future> get( + String path, { + Map? queryParameters, + Map? headers, + ProgressCallback? onReceiveProgress, + T Function(Map json)? fromJson, + T Function(List json)? fromJsonList, + Future Function(List json)? fromJsonListAsync, + }) async { + final response = await dio.get( + path, + queryParameters: queryParameters, + options: Options(headers: headers), + onReceiveProgress: onReceiveProgress, + cancelToken: ApiHandler.globalCancelToken, + ); + if (fromJsonListAsync != null && response.data is List) { + response.data = await fromJsonListAsync(response.data); + return DioResponse(response); + } + if (fromJsonList != null && response.data is List) { + response.data = fromJsonList(response.data); + return DioResponse(response); + } + if (fromJson != null && response.data is Map) { + response.data = fromJson(response.data); + return DioResponse(response); + } + return DioResponse(response); + } + + @override + Future> post( + String path, { + dynamic data, + Map? queryParameters, + T Function(Map json)? fromJson, + Map? headers, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final response = await dio.post( + path, + data: data, + queryParameters: queryParameters, + options: Options(headers: headers), + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + cancelToken: ApiHandler.globalCancelToken, + ); + + if (fromJson != null) { + final rawData = response.data; + final parsedData = rawData is Map ? fromJson(rawData) : null; + response.data = parsedData; + return DioResponse(response); + } + + return DioResponse(response); + } + + @override + Future> put( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + T Function(Map json)? fromJson, + }) async { + final response = await dio.put( + path, + data: data, + queryParameters: queryParameters, + options: Options(headers: headers), + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + cancelToken: ApiHandler.globalCancelToken, + ); + + if (fromJson != null && response.data is Map) { + response.data = fromJson(response.data); + return DioResponse(response); + } + return DioResponse(response); + } + + @override + Future> delete( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + T Function(Map json)? fromJson, + }) async { + final response = await dio.delete( + path, + data: data, + queryParameters: queryParameters, + options: Options(headers: headers), + cancelToken: ApiHandler.globalCancelToken, + ); + if (fromJson != null) { + final rawData = response.data; + final parsedData = rawData is Map ? fromJson(rawData) : null; + response.data = parsedData; + return DioResponse(response); + } + return DioResponse(response); + } + + @override + Future> download( + String url, { + ProgressCallback? onReceiveProgress, + }) async { + final response = await dio.get( + url, + options: Options(responseType: ResponseType.bytes), + onReceiveProgress: onReceiveProgress, + cancelToken: ApiHandler.globalCancelToken, + ); + return DioResponse(response); + } + + @override + Future> upload( + String path, { + required IFormData formData, + Map? headers, + ProgressCallback? onSendProgress, + }) async { + final response = await dio.post( + path, + data: (formData as DioFormData).raw, + options: Options(headers: headers, contentType: 'multipart/form-data'), + onSendProgress: onSendProgress, + cancelToken: ApiHandler.globalCancelToken, + ); + return DioResponse(response); + } +} diff --git a/packages/core/lib/infrastructure/remote/dio_response.dart b/packages/core/lib/infrastructure/remote/dio_response.dart new file mode 100644 index 0000000..30f54eb --- /dev/null +++ b/packages/core/lib/infrastructure/remote/dio_response.dart @@ -0,0 +1,20 @@ +import 'interfaces/i_http_response.dart'; +import 'package:dio/dio.dart'; + +class DioResponse implements IHttpResponse { + final Response _response; + + DioResponse(this._response); + + @override + T? get data => _response.data; + + @override + int get statusCode => _response.statusCode ?? 0; + + @override + Map? get headers => _response.headers.map; + + @override + bool get isSuccessful => statusCode >= 200 && statusCode < 300; +} diff --git a/packages/core/lib/infrastructure/remote/interfaces/i_form_data.dart b/packages/core/lib/infrastructure/remote/interfaces/i_form_data.dart new file mode 100644 index 0000000..ddbda85 --- /dev/null +++ b/packages/core/lib/infrastructure/remote/interfaces/i_form_data.dart @@ -0,0 +1,6 @@ +import 'package:flutter/foundation.dart'; + +abstract class IFormData{ + void addFile(String field, Uint8List bytes, String filename); + void addField(String key, String value); +} \ No newline at end of file diff --git a/packages/core/lib/infrastructure/remote/interfaces/i_http_client.dart b/packages/core/lib/infrastructure/remote/interfaces/i_http_client.dart new file mode 100644 index 0000000..119222b --- /dev/null +++ b/packages/core/lib/infrastructure/remote/interfaces/i_http_client.dart @@ -0,0 +1,52 @@ +import 'package:dio/dio.dart'; + +import 'i_form_data.dart'; +import 'i_http_response.dart'; + +abstract class IHttpClient { + Future init(); + + Future> get( + String path, { + Map? queryParameters, + Map? headers, + ProgressCallback? onReceiveProgress, + T Function(Map json)? fromJson, + T Function(List json)? fromJsonList, + Future Function(List json)? fromJsonListAsync, + }); + + Future> post( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }); + + Future> put( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }); + + Future> delete( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + }); + + Future> download(String url, {ProgressCallback? onReceiveProgress}); + + Future> upload( + String path, { + required IFormData formData, + Map? headers, + ProgressCallback? onSendProgress, + }); +} diff --git a/packages/core/lib/infrastructure/remote/interfaces/i_http_response.dart b/packages/core/lib/infrastructure/remote/interfaces/i_http_response.dart new file mode 100644 index 0000000..461146a --- /dev/null +++ b/packages/core/lib/infrastructure/remote/interfaces/i_http_response.dart @@ -0,0 +1,6 @@ +abstract class IHttpResponse { + T? get data; + int get statusCode; + Map? get headers; + bool get isSuccessful; +} diff --git a/packages/core/lib/infrastructure/remote/interfaces/i_remote.dart b/packages/core/lib/infrastructure/remote/interfaces/i_remote.dart new file mode 100644 index 0000000..648883b --- /dev/null +++ b/packages/core/lib/infrastructure/remote/interfaces/i_remote.dart @@ -0,0 +1,4 @@ +abstract class IRemote{ + Future init(); +} + diff --git a/packages/core/lib/injection/di.dart b/packages/core/lib/injection/di.dart new file mode 100644 index 0000000..d5bc011 --- /dev/null +++ b/packages/core/lib/injection/di.dart @@ -0,0 +1,26 @@ +import 'package:get_it/get_it.dart'; +import 'package:logger/logger.dart'; +import 'package:rasadyar_core/data/services/auth_middelware.dart'; +import 'package:rasadyar_core/infrastructure/local/hive_local_storage.dart'; + +final diCore = GetIt.instance; + +Future setupAllCoreProvider() async { + + await _setUpLogger(); + await _setupLocalStorage(); + await _setupRemote(); + await diCore.allReady(); +} + +Future _setUpLogger() async { + diCore.registerSingleton(Logger()); +} + +Future _setupLocalStorage() async { + diCore.registerSingleton(HiveLocalStorage()); +} + +Future _setupRemote() async { + // diCore.registerSingleton(HiveLocalStorage()); +} \ No newline at end of file diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart new file mode 100644 index 0000000..40069d1 --- /dev/null +++ b/packages/core/lib/presentation/common/app_color.dart @@ -0,0 +1,183 @@ +import 'package:flutter/material.dart'; + +class AppColor { + AppColor._(); + + //region --- Blue Colors --- + static const Color blueLight = Color(0xFFeaefff); // #eaefff rgb(234, 239, 255) + static const Color blueLightHover = Color(0xFFe0e7ff); // #e0e7ff rgb(224, 231, 255) + static const Color blueLightActive = Color(0xFFbecdff); // #becdff rgb(190, 205, 255) + static const Color blueNormal = Color(0xFF2d5fff); // #2d5fff rgb(45, 95, 255) + static const Color blueNormalHover = Color(0xFF2956e6); // #2956e6 rgb(41, 86, 230) + static const Color blueNormalActive = Color(0xFF244ccc); // #244ccc rgb(36, 76, 204) + static const Color blueDark = Color(0xFF2247bf); // #2247bf rgb(34, 71, 191) + static const Color blueDarkHover = Color(0xFF1b3999); // #1b3999 rgb(27, 57, 153) + static const Color blueDarkActive = Color(0xFF142b73); // #142b73 rgb(20, 43, 115) + static const Color blueDarker = Color(0xFF102159); // #102159 rgb(16, 33, 89) + static const Color blueFlashing = Color(0xFF6F91FF); // #6F91FF rgb(111, 145, 255) + //endregion + + //region --- Green Colors --- + static const Color greenLight = Color(0xFFe6faf5); // #e6faf5 rgb(230, 250, 245) + static const Color greenLightHover = Color(0xFFd9f7f0); // #d9f7f0 rgb(217, 247, 240) + static const Color greenLightActive = Color(0xFFb0efdf); // #b0efdf rgb(176, 239, 223) + static const Color greenNormal = Color(0xFF00cc99); // #00cc99 rgb(0, 204, 153) + static const Color greenNormalHover = Color(0xFF00b88a); // #00b88a rgb(0, 184, 138) + static const Color greenNormalActive = Color(0xFF00a37a); // #00a37a rgb(0, 163, 122) + static const Color greenDark = Color(0xFF009973); // #009973 rgb(0, 153, 115) + static const Color greenDarkHover = Color(0xFF007a5c); // #007a5c rgb(0, 122, 92) + static const Color greenDarkActive = Color(0xFF005c45); // #005c45 rgb(0, 92, 69) + static const Color greenDarker = Color(0xFF004736); // #004736 rgb(0, 71, 54) + //endregion + + //region --- Black Colors --- + static const Color blackLight = Color(0xFFe6e6e6); // #e6e6e6 rgb(230, 230, 230) + static const Color blackLightHover = Color(0xFFd9d9d9); // #d9d9d9 rgb(217, 217, 217) + static const Color blackLightActive = Color(0xFFb0b0b0); // #b0b0b0 rgb(176, 176, 176) + static const Color blackNormal = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackNormalHover = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackNormalActive = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackDark = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackDarkHover = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackDarkActive = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0) + //endregion + + //region --- Grey Colors --- + static const Color darkGreyLight = Color(0xFFeaeaea); // #eaeaea rgb(234, 234, 234) + static const Color darkGreyLightHover = Color(0xFFdfdfdf); // #dfdfdf rgb(223, 223, 223) + static const Color darkGreyLightActive = Color(0xFFbdbdbd); // #bdbdbd rgb(189, 189, 189) + static const Color darkGreyNormal = Color(0xFF2a2a2a); // #2a2a2a rgb(42, 42, 42) + static const Color darkGreyNormalHover = Color(0xFF262626); // #262626 rgb(38, 38, 38) + static const Color darkGreyNormalActive = Color(0xFF222222); // #222222 rgb(34, 34, 34) + static const Color darkGreyDark = Color(0xFF202020); // #202020 rgb(32, 32, 32) + static const Color darkGreyDarkHover = Color(0xFF191919); // #191919 rgb(25, 25, 25) + static const Color darkGreyDarkActive = Color(0xFF131313); // #131313 rgb(19, 19, 19) + static const Color darkGreyDarker = Color(0xFF0f0f0f); // #0f0f0f rgb(15, 15, 15) + //endregion + + //region ---Medium Grey Colors --- + static const Color mediumGreyLight = Color(0xFFf4f4f4); // #f4f4f4 rgb(244, 244, 244) + static const Color mediumGreyLightHover = Color(0xFFeeeeee); // #eeeeee rgb(238, 238, 238) + static const Color mediumGreyLightActive = Color(0xFFdcdcdc); // #dcdcdc rgb(220, 220, 220) + static const Color mediumGreyNormal = Color(0xFF8f8f8f); // #8f8f8f rgb(143, 143, 143) + static const Color mediumGreyNormalHover = Color(0xFF818181); // #818181 rgb(129, 129, 129) + static const Color mediumGreyNormalActive = Color(0xFF727272); // #727272 rgb(114, 114, 114) + static const Color mediumGreyDark = Color(0xFF6b6b6b); // #6b6b6b rgb(107, 107, 107) + static const Color mediumGreyDarkHover = Color(0xFF565656); // #565656 rgb(86, 86, 86) + static const Color mediumGreyDarkActive = Color(0xFF404040); // #404040 rgb(64, 64, 64) + static const Color mediumGreyDarker = Color(0xFF323232); // #323232 rgb(50, 50, 50) + static const Color customGrey = Color(0xFF808081); // #808081 rgb(128, 128, 129) + //endregion + + //region ---Light Grey Colors --- + static const Color lightGreyLight = Color(0xFFfdfdfd); // #fdfdfd rgb(253, 253, 253) + static const Color lightGreyLightHover = Color(0xFFfcfcfc); // #fcfcfc rgb(252, 252, 252) + static const Color lightGreyLightActive = Color(0xFFfafafa); // #fafafa rgb(250, 250, 250) + static const Color lightGreyNormal = Color(0xFFeeeeee); // #eeeeee rgb(238, 238, 238) + static const Color lightGreyNormalHover = Color(0xFFd6d6d6); // #d6d6d6 rgb(214, 214, 214) + static const Color lightGreyNormalActive = Color(0xFFbebebe); // #bebebe rgb(190, 190, 190) + static const Color lightGreyDark = Color(0xFFb3b3b3); // #b3b3b3 rgb(179, 179, 179) + static const Color lightGreyDarkHover = Color(0xFF8f8f8f); // #8f8f8f rgb(143, 143, 143) + static const Color lightGreyDarkActive = Color(0xFF6b6b6b); // #6b6b6b rgb(107, 107, 107) + static const Color lightGreyDarker = Color(0xFF535353); // #535353 rgb(83, 83, 83) + //endregion + + //region ---WhiteGrey Colors --- + static const Color whiteGreyLight = Color(0xFFfefefe); // #fefefe rgb(254, 254, 254) + static const Color whiteGreyLightHover = Color(0xFFfefefe); // #fefefe rgb(254, 254, 254) + static const Color whiteGreyLightActive = Color(0xFFfdfdfd); // #fdfdfd rgb(253, 253, 253) + static const Color whiteGreyNormal = Color(0xFFf9f9f9); // #f9f9f9 rgb(249, 249, 249) + static const Color whiteGreyNormalHover = Color(0xFFe0e0e0); // #e0e0e0 rgb(224, 224, 224) + static const Color whiteGreyNormalActive = Color(0xFFc7c7c7); // #c7c7c7 rgb(199, 199, 199) + static const Color whiteGreyDark = Color(0xFFbbbbbb); // #bbbbbb rgb(187, 187, 187) + static const Color whiteGreyDarkHover = Color(0xFF959595); // #959595 rgb(149, 149, 149) + static const Color whiteGreyDarkActive = Color(0xFF707070); // #707070 rgb(112, 112, 112) + static const Color whiteGreyDarker = Color(0xFF575757); // #575757 rgb(87, 87, 87) + //endregion + + //region ---White Colors --- + static const Color whiteLight = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteLightHover = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteLightActive = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteNormal = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteNormalHover = Color(0xFFe6e6e6); // #e6e6e6 rgb(230, 230, 230) + static const Color whiteNormalActive = Color(0xFFcccccc); // #cccccc rgb(204, 204, 204) + static const Color whiteDark = Color(0xFFbfbfbf); // #bfbfbf rgb(191, 191, 191) + static const Color whiteDarkHover = Color(0xFF999999); // #999999 rgb(153, 153, 153) + static const Color whiteDarkActive = Color(0xFF737373); // #737373 rgb(115, 115, 115) + static const Color whiteDarker = Color(0xFF595959); // #595959 rgb(89, 89, 89) + //endregion + + //region --- green1 Colors --- + static const Color green1Light = Color(0xFFe6f6f4); // #e6f6f4 rgb(230, 246, 244) + static const Color green1LightHover = Color(0xFFd9f2ef); // #d9f2ef rgb(217, 242, 239) + static const Color green1LightActive = Color(0xFFb0e4dd); // #b0e4dd rgb(176, 228, 221) + static const Color green1Normal = Color(0xFF00a991); // #00a991 rgb(0, 169, 145) + static const Color green1NormalHover = Color(0xFF009883); // #009883 rgb(0, 152, 131) + static const Color green1NormalActive = Color(0xFF008774); // #008774 rgb(0, 135, 116) + static const Color green1Dark = Color(0xFF007f6d); // #007f6d rgb(0, 127, 109) + static const Color green1DarkHover = Color(0xFF006557); // #006557 rgb(0, 101, 87) + static const Color green1DarkActive = Color(0xFF004c41); // #004c41 rgb(0, 76, 65) + static const Color green1Darker = Color(0xFF003b33); // #003b33 rgb(0, 59, 51) + //endregion + + //region --- Yellow Colors --- + static const Color yellowLight = Color(0xFFfff9e6); // #fff9e6 rgb(255, 249, 230) + static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218) + static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178) + static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7) + static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6) + static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6) + static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5) + static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4) + static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3) + static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2) + //endregion + + //region --- red Colors --- + static const Color redLight = Color(0xFFfdeeee); // #fdeeee rgb(253, 238, 238) + static const Color redLightHover = Color(0xFFfce6e6); // #fce6e6 rgb(252, 230, 230) + static const Color redLightActive = Color(0xFFf9cbcb); // #f9cbcb rgb(249, 203, 203) + static const Color redNormal = Color(0xFFeb5757); // #eb5757 rgb(235, 87, 87) + static const Color redNormalHover = Color(0xFFd44e4e); // #d44e4e rgb(212, 78, 78) + static const Color redNormalActive = Color(0xFFbc4646); // #bc4646 rgb(188, 70, 70) + static const Color redDark = Color(0xFFb04141); // #b04141 rgb(176, 65, 65) + static const Color redDarkHover = Color(0xFF8d3434); // #8d3434 rgb(141, 52, 52) + static const Color redDarkActive = Color(0xFF6a2727); // #6a2727 rgb(106, 39, 39) + static const Color redDarker = Color(0xFF521e1e); // #521e1e rgb(82, 30, 30) + static const Color redDarkerText = Color(0xFFD24E4E); // #D34E4E rgba(211, 78, 78, 1) + + static const Color redLight2 = Color(0xFFEDDCE0); // #EDDCE0 rgb(237, 220, 224) + static const Color redLightActive2 = Color(0xFFE0BCC5); // #E0BCC5 rgb(224, 188, 197) + //endregion + + //region --- Teal Colors --- + static const Color tealLight = Color(0xFFe8f6f8); // #e8f6f8 rgb(232, 246, 248) + static const Color tealLightHover = Color(0xFFdcf1f4); // #dcf1f4 rgb(220, 241, 244) + static const Color tealLightActive = Color(0xFFb7e2e9); // #b7e2e9 rgb(183, 226, 233) + static const Color tealNormal = Color(0xFF17a2b8); // #17a2b8 rgb(23, 162, 184) + static const Color tealNormalHover = Color(0xFF1592a6); // #1592a6 rgb(21, 146, 166) + static const Color tealNormalActive = Color(0xFF128293); // #128293 rgb(18, 130, 147) + static const Color tealDark = Color(0xFF117a8a); // #117a8a rgb(17, 122, 138) + static const Color tealDarkHover = Color(0xFF0e616e); // #0e616e rgb(14, 97, 110) + static const Color tealDarkActive = Color(0xFF0a4953); // #0a4953 rgb(10, 73, 83) + static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64) + + static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64) + static const Color bgIcon = Color(0xFF797979); // #797979 + static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64) + static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64) + static const Color textColorLight = Color(0xFFB2B2B2); + static const Color iconColor = Color(0xFF444444); // #444444 rgb(68, 68, 68) + static const Color borderColor = Color(0xFFC7CFCD); // #C7CFCD rgb(199, 207, 205)` + + //endregion + + //region --- category Colors --- + static const Color confirm = greenNormalActive; + static const Color warning = yellowNormal; + static const Color error = redNormal; + static const Color info = tealNormal; + //endregion +} diff --git a/packages/core/lib/presentation/common/app_fonts.dart b/packages/core/lib/presentation/common/app_fonts.dart new file mode 100644 index 0000000..72c1d45 --- /dev/null +++ b/packages/core/lib/presentation/common/app_fonts.dart @@ -0,0 +1,207 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class AppFonts { + AppFonts._(); // Private constructor to prevent instantiation + + // --- Font Families --- + static const String yekan = 'yekan'; + + // --- Font Weights --- + static const FontWeight regular = FontWeight.w400; + static const FontWeight bold = FontWeight.w600; + static const double _height = 1.20; + + static TextStyle yekan61 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 61.sp, + height: _height, + ); + + static TextStyle yekan49 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 48.sp, + height: _height, + ); + + static TextStyle yekan39 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 39.sp, + height: _height, + ); + + static TextStyle yekan31 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 31.sp, + height: _height, + ); + + static TextStyle yekan25 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 25.sp, + height: _height, + ); + + static TextStyle yekan24 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 24.sp, + height: _height, + ); + + static TextStyle yekan20 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 20.sp, + height: _height, + ); + + static TextStyle yekan18 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 18.sp, + height: _height, + ); + + static TextStyle yekan16 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 16.sp, + height: _height, + ); + + static TextStyle yekan14 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 13.sp, + height: _height, + ); + + + + static TextStyle yekan13 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 13.sp, + height: _height, + ); + + + static TextStyle yekan12 = TextStyle( + fontFamily: yekan, + fontWeight: regular, + fontSize: 12.sp, + height: _height, + ); + + + static TextStyle yekan10 = TextStyle( + // Rounded from 10.24 + fontFamily: yekan, + fontWeight: regular, + fontSize: 10.sp, + height: _height, + ); + + + static TextStyle yekan8= TextStyle( + // Rounded from 10.24 + fontFamily: yekan, + fontWeight: regular, + fontSize: 8.sp, + height: _height, + ); + + static TextStyle yekan61Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 61.sp, + height: _height, + ); + + static TextStyle yekan49Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 48.sp, + height: _height, + ); + + static TextStyle yekan39Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 39.sp, + height: _height, + ); + + static TextStyle yekan31Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 31.sp, + height: _height, + ); + + static TextStyle yekan25Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 25.sp, + height: _height, + ); + + static TextStyle yekan24Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 24.sp, + height: _height, + ); + + static TextStyle yekan20Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 20.sp, + height: _height, + ); + + static TextStyle yekan16Bold = TextStyle( + // Base size bold + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 16.sp, + height: _height, + ); + + + static TextStyle yekan14Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 13.sp, + height: _height, + ); + + + static TextStyle yekan13Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 13.sp, + height: _height, + ); + + static TextStyle yekan12Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 12.sp, + height: _height, + ); + + + static TextStyle yekan10Bold = TextStyle( + fontFamily: yekan, + fontWeight: bold, // Use bold weight + fontSize: 10.sp, + height: _height, + ); +} diff --git a/packages/core/lib/presentation/common/assets.gen.dart b/packages/core/lib/presentation/common/assets.gen.dart new file mode 100644 index 0000000..b349f7c --- /dev/null +++ b/packages/core/lib/presentation/common/assets.gen.dart @@ -0,0 +1,951 @@ +// dart format width=120 + +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import + +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/flutter_svg.dart' as _svg; +import 'package:lottie/lottie.dart' as _lottie; +import 'package:vector_graphics/vector_graphics.dart' as _vg; + +class $AssetsAnimGen { + const $AssetsAnimGen(); + + /// File path: assets/anim/error.json + LottieGenImage get error => const LottieGenImage('assets/anim/error.json'); + + /// File path: assets/anim/loading.json + LottieGenImage get loading => const LottieGenImage('assets/anim/loading.json'); + + /// List of all assets + List get values => [error, loading]; +} + +class $AssetsIconsGen { + const $AssetsIconsGen(); + + /// File path: assets/icons/3d_cube_square.svg + SvgGenImage get a3dCubeSquare => const SvgGenImage('assets/icons/3d_cube_square.svg'); + + /// File path: assets/icons/add.svg + SvgGenImage get add => const SvgGenImage('assets/icons/add.svg'); + + /// File path: assets/icons/app_bar_inspection.svg + SvgGenImage get appBarInspection => const SvgGenImage('assets/icons/app_bar_inspection.svg'); + + /// File path: assets/icons/arrow_left.svg + SvgGenImage get arrowLeft => const SvgGenImage('assets/icons/arrow_left.svg'); + + /// File path: assets/icons/arrow_right.svg + SvgGenImage get arrowRight => const SvgGenImage('assets/icons/arrow_right.svg'); + + /// File path: assets/icons/bg_auth.svg + SvgGenImage get bgAuth => const SvgGenImage('assets/icons/bg_auth.svg'); + + /// File path: assets/icons/bg_header_user_profile.svg + SvgGenImage get bgHeaderUserProfile => const SvgGenImage('assets/icons/bg_header_user_profile.svg'); + + /// File path: assets/icons/buy.svg + SvgGenImage get buy => const SvgGenImage('assets/icons/buy.svg'); + + /// File path: assets/icons/calendar.svg + SvgGenImage get calendar => const SvgGenImage('assets/icons/calendar.svg'); + + /// File path: assets/icons/calendar_search.svg + SvgGenImage get calendarSearch => const SvgGenImage('assets/icons/calendar_search.svg'); + + /// File path: assets/icons/calendar_search_outline.svg + SvgGenImage get calendarSearchOutline => const SvgGenImage('assets/icons/calendar_search_outline.svg'); + + /// File path: assets/icons/call.svg + SvgGenImage get call => const SvgGenImage('assets/icons/call.svg'); + + /// File path: assets/icons/check.svg + SvgGenImage get check => const SvgGenImage('assets/icons/check.svg'); + + /// File path: assets/icons/check_square.svg + SvgGenImage get checkSquare => const SvgGenImage('assets/icons/check_square.svg'); + + /// File path: assets/icons/chicken.svg + SvgGenImage get chicken => const SvgGenImage('assets/icons/chicken.svg'); + + /// File path: assets/icons/chicken_map_marker.svg + SvgGenImage get chickenMapMarker => const SvgGenImage('assets/icons/chicken_map_marker.svg'); + + /// File path: assets/icons/clipboard_eye.svg + SvgGenImage get clipboardEye => const SvgGenImage('assets/icons/clipboard_eye.svg'); + + /// File path: assets/icons/clipboard_task.svg + SvgGenImage get clipboardTask => const SvgGenImage('assets/icons/clipboard_task.svg'); + + /// File path: assets/icons/clock.svg + SvgGenImage get clock => const SvgGenImage('assets/icons/clock.svg'); + + /// File path: assets/icons/close_circle.svg + SvgGenImage get closeCircle => const SvgGenImage('assets/icons/close_circle.svg'); + + /// File path: assets/icons/close_square.svg + SvgGenImage get closeSquare => const SvgGenImage('assets/icons/close_square.svg'); + + /// File path: assets/icons/convert_cube.svg + SvgGenImage get convertCube => const SvgGenImage('assets/icons/convert_cube.svg'); + + /// File path: assets/icons/cow.svg + SvgGenImage get cow => const SvgGenImage('assets/icons/cow.svg'); + + /// File path: assets/icons/cube.svg + SvgGenImage get cube => const SvgGenImage('assets/icons/cube.svg'); + + /// File path: assets/icons/cube_bottom_rotation.svg + SvgGenImage get cubeBottomRotation => const SvgGenImage('assets/icons/cube_bottom_rotation.svg'); + + /// File path: assets/icons/cube_card.svg + SvgGenImage get cubeCard => const SvgGenImage('assets/icons/cube_card.svg'); + + /// File path: assets/icons/cube_rotate.svg + SvgGenImage get cubeRotate => const SvgGenImage('assets/icons/cube_rotate.svg'); + + /// File path: assets/icons/cube_scan.svg + SvgGenImage get cubeScan => const SvgGenImage('assets/icons/cube_scan.svg'); + + /// File path: assets/icons/cube_search.svg + SvgGenImage get cubeSearch => const SvgGenImage('assets/icons/cube_search.svg'); + + /// File path: assets/icons/cube_top_rotation.svg + SvgGenImage get cubeTopRotation => const SvgGenImage('assets/icons/cube_top_rotation.svg'); + + /// File path: assets/icons/cube_watting.svg + SvgGenImage get cubeWatting => const SvgGenImage('assets/icons/cube_watting.svg'); + + /// File path: assets/icons/diagram.svg + SvgGenImage get diagram => const SvgGenImage('assets/icons/diagram.svg'); + + /// File path: assets/icons/download.svg + SvgGenImage get download => const SvgGenImage('assets/icons/download.svg'); + + /// File path: assets/icons/edit.svg + SvgGenImage get edit => const SvgGenImage('assets/icons/edit.svg'); + + /// File path: assets/icons/empty.svg + SvgGenImage get empty => const SvgGenImage('assets/icons/empty.svg'); + + /// File path: assets/icons/excel_download.svg + SvgGenImage get excelDownload => const SvgGenImage('assets/icons/excel_download.svg'); + + /// File path: assets/icons/filter.svg + SvgGenImage get filter => const SvgGenImage('assets/icons/filter.svg'); + + /// File path: assets/icons/filter_outline.svg + SvgGenImage get filterOutline => const SvgGenImage('assets/icons/filter_outline.svg'); + + /// File path: assets/icons/gps.svg + SvgGenImage get gps => const SvgGenImage('assets/icons/gps.svg'); + + /// File path: assets/icons/home.svg + SvgGenImage get home => const SvgGenImage('assets/icons/home.svg'); + + /// File path: assets/icons/hot_chicken.svg + SvgGenImage get hotChicken => const SvgGenImage('assets/icons/hot_chicken.svg'); + + /// File path: assets/icons/information.svg + SvgGenImage get information => const SvgGenImage('assets/icons/information.svg'); + + /// File path: assets/icons/inside.svg + SvgGenImage get inside => const SvgGenImage('assets/icons/inside.svg'); + + /// File path: assets/icons/inspection.svg + SvgGenImage get inspection => const SvgGenImage('assets/icons/inspection.svg'); + + /// File path: assets/icons/key.svg + SvgGenImage get key => const SvgGenImage('assets/icons/key.svg'); + + /// File path: assets/icons/liveStock.svg + SvgGenImage get liveStock => const SvgGenImage('assets/icons/liveStock.svg'); + + /// File path: assets/icons/lock.svg + SvgGenImage get lock => const SvgGenImage('assets/icons/lock.svg'); + + /// File path: assets/icons/logout.svg + SvgGenImage get logout => const SvgGenImage('assets/icons/logout.svg'); + + /// File path: assets/icons/map.svg + SvgGenImage get map => const SvgGenImage('assets/icons/map.svg'); + + /// File path: assets/icons/map_marker.svg + SvgGenImage get mapMarker => const SvgGenImage('assets/icons/map_marker.svg'); + + /// File path: assets/icons/message_add.svg + SvgGenImage get messageAdd => const SvgGenImage('assets/icons/message_add.svg'); + + /// File path: assets/icons/outside.svg + SvgGenImage get outside => const SvgGenImage('assets/icons/outside.svg'); + + /// File path: assets/icons/pdf_download.svg + SvgGenImage get pdfDownload => const SvgGenImage('assets/icons/pdf_download.svg'); + + /// File path: assets/icons/people.svg + SvgGenImage get people => const SvgGenImage('assets/icons/people.svg'); + + /// File path: assets/icons/picture_frame.svg + SvgGenImage get pictureFrame => const SvgGenImage('assets/icons/picture_frame.svg'); + + /// File path: assets/icons/place_holder.svg + SvgGenImage get placeHolder => const SvgGenImage('assets/icons/place_holder.svg'); + + /// File path: assets/icons/profile2.svg + SvgGenImage get profile2 => const SvgGenImage('assets/icons/profile2.svg'); + + /// File path: assets/icons/profile2_outline.svg + SvgGenImage get profile2Outline => const SvgGenImage('assets/icons/profile2_outline.svg'); + + /// File path: assets/icons/profile_circle.svg + SvgGenImage get profileCircle => const SvgGenImage('assets/icons/profile_circle.svg'); + + /// File path: assets/icons/profile_user.svg + SvgGenImage get profileUser => const SvgGenImage('assets/icons/profile_user.svg'); + + /// File path: assets/icons/receipt_discount.svg + SvgGenImage get receiptDiscount => const SvgGenImage('assets/icons/receipt_discount.svg'); + + /// File path: assets/icons/sale.svg + SvgGenImage get sale => const SvgGenImage('assets/icons/sale.svg'); + + /// File path: assets/icons/scan.svg + SvgGenImage get scan => const SvgGenImage('assets/icons/scan.svg'); + + /// File path: assets/icons/scan_barcode.svg + SvgGenImage get scanBarcode => const SvgGenImage('assets/icons/scan_barcode.svg'); + + /// File path: assets/icons/search.svg + SvgGenImage get search => const SvgGenImage('assets/icons/search.svg'); + + /// File path: assets/icons/security_time.svg + SvgGenImage get securityTime => const SvgGenImage('assets/icons/security_time.svg'); + + /// File path: assets/icons/setting.svg + SvgGenImage get setting => const SvgGenImage('assets/icons/setting.svg'); + + /// File path: assets/icons/shop.svg + SvgGenImage get shop => const SvgGenImage('assets/icons/shop.svg'); + + /// File path: assets/icons/shopping_basket.svg + SvgGenImage get shoppingBasket => const SvgGenImage('assets/icons/shopping_basket.svg'); + + /// File path: assets/icons/tag_label.svg + SvgGenImage get tagLabel => const SvgGenImage('assets/icons/tag_label.svg'); + + /// File path: assets/icons/tag_user.svg + SvgGenImage get tagUser => const SvgGenImage('assets/icons/tag_user.svg'); + + /// File path: assets/icons/task.svg + SvgGenImage get task => const SvgGenImage('assets/icons/task.svg'); + + /// File path: assets/icons/timer.svg + SvgGenImage get timer => const SvgGenImage('assets/icons/timer.svg'); + + /// File path: assets/icons/trash.svg + SvgGenImage get trash => const SvgGenImage('assets/icons/trash.svg'); + + /// File path: assets/icons/truck.svg + SvgGenImage get truck => const SvgGenImage('assets/icons/truck.svg'); + + /// File path: assets/icons/truck_fast.svg + SvgGenImage get truckFast => const SvgGenImage('assets/icons/truck_fast.svg'); + + /// File path: assets/icons/truck_fast_outlined.svg + SvgGenImage get truckFastOutlined => const SvgGenImage('assets/icons/truck_fast_outlined.svg'); + + /// File path: assets/icons/user.svg + SvgGenImage get user => const SvgGenImage('assets/icons/user.svg'); + + /// File path: assets/icons/user_raduis.svg + SvgGenImage get userRaduis => const SvgGenImage('assets/icons/user_raduis.svg'); + + /// File path: assets/icons/user_square.svg + SvgGenImage get userSquare => const SvgGenImage('assets/icons/user_square.svg'); + + /// File path: assets/icons/virtual.svg + SvgGenImage get virtual => const SvgGenImage('assets/icons/virtual.svg'); + + /// File path: assets/icons/whare_house.svg + SvgGenImage get whareHouse => const SvgGenImage('assets/icons/whare_house.svg'); + + /// List of all assets + List get values => [ + a3dCubeSquare, + add, + appBarInspection, + arrowLeft, + arrowRight, + bgAuth, + bgHeaderUserProfile, + buy, + calendar, + calendarSearch, + calendarSearchOutline, + call, + check, + checkSquare, + chicken, + chickenMapMarker, + clipboardEye, + clipboardTask, + clock, + closeCircle, + closeSquare, + convertCube, + cow, + cube, + cubeBottomRotation, + cubeCard, + cubeRotate, + cubeScan, + cubeSearch, + cubeTopRotation, + cubeWatting, + diagram, + download, + edit, + empty, + excelDownload, + filter, + filterOutline, + gps, + home, + hotChicken, + information, + inside, + inspection, + key, + liveStock, + lock, + logout, + map, + mapMarker, + messageAdd, + outside, + pdfDownload, + people, + pictureFrame, + placeHolder, + profile2, + profile2Outline, + profileCircle, + profileUser, + receiptDiscount, + sale, + scan, + scanBarcode, + search, + securityTime, + setting, + shop, + shoppingBasket, + tagLabel, + tagUser, + task, + timer, + trash, + truck, + truckFast, + truckFastOutlined, + user, + userRaduis, + userSquare, + virtual, + whareHouse, + ]; +} + +class $AssetsImagesGen { + const $AssetsImagesGen(); + + /// File path: assets/images/chicken.png + AssetGenImage get chicken => const AssetGenImage('assets/images/chicken.png'); + + /// File path: assets/images/inner_splash.webp + AssetGenImage get innerSplash => const AssetGenImage('assets/images/inner_splash.webp'); + + /// File path: assets/images/outter_splash.webp + AssetGenImage get outterSplash => const AssetGenImage('assets/images/outter_splash.webp'); + + /// File path: assets/images/place_holder.png + AssetGenImage get placeHolder => const AssetGenImage('assets/images/place_holder.png'); + + /// List of all assets + List get values => [chicken, innerSplash, outterSplash, placeHolder]; +} + +class $AssetsLogosGen { + const $AssetsLogosGen(); + + /// File path: assets/logos/final_logo.png + AssetGenImage get finalLogo => const AssetGenImage('assets/logos/final_logo.png'); + + /// List of all assets + List get values => [finalLogo]; +} + +class $AssetsVecGen { + const $AssetsVecGen(); + + /// File path: assets/vec/3d_cube_square.svg.vec + SvgGenImage get a3dCubeSquareSvg => const SvgGenImage.vec('assets/vec/3d_cube_square.svg.vec'); + + /// File path: assets/vec/add.svg.vec + SvgGenImage get addSvg => const SvgGenImage.vec('assets/vec/add.svg.vec'); + + /// File path: assets/vec/app_bar_inspection.svg.vec + SvgGenImage get appBarInspectionSvg => const SvgGenImage.vec('assets/vec/app_bar_inspection.svg.vec'); + + /// File path: assets/vec/arrow_left.svg.vec + SvgGenImage get arrowLeftSvg => const SvgGenImage.vec('assets/vec/arrow_left.svg.vec'); + + /// File path: assets/vec/arrow_right.svg.vec + SvgGenImage get arrowRightSvg => const SvgGenImage.vec('assets/vec/arrow_right.svg.vec'); + + /// File path: assets/vec/bg_auth.svg.vec + SvgGenImage get bgAuthSvg => const SvgGenImage.vec('assets/vec/bg_auth.svg.vec'); + + /// File path: assets/vec/bg_header_user_profile.svg.vec + SvgGenImage get bgHeaderUserProfileSvg => const SvgGenImage.vec('assets/vec/bg_header_user_profile.svg.vec'); + + /// File path: assets/vec/buy.svg.vec + SvgGenImage get buySvg => const SvgGenImage.vec('assets/vec/buy.svg.vec'); + + /// File path: assets/vec/calendar.svg.vec + SvgGenImage get calendarSvg => const SvgGenImage.vec('assets/vec/calendar.svg.vec'); + + /// File path: assets/vec/calendar_search.svg.vec + SvgGenImage get calendarSearchSvg => const SvgGenImage.vec('assets/vec/calendar_search.svg.vec'); + + /// File path: assets/vec/calendar_search_outline.svg.vec + SvgGenImage get calendarSearchOutlineSvg => const SvgGenImage.vec('assets/vec/calendar_search_outline.svg.vec'); + + /// File path: assets/vec/call.svg.vec + SvgGenImage get callSvg => const SvgGenImage.vec('assets/vec/call.svg.vec'); + + /// File path: assets/vec/check.svg.vec + SvgGenImage get checkSvg => const SvgGenImage.vec('assets/vec/check.svg.vec'); + + /// File path: assets/vec/check_square.svg.vec + SvgGenImage get checkSquareSvg => const SvgGenImage.vec('assets/vec/check_square.svg.vec'); + + /// File path: assets/vec/chicken.svg.vec + SvgGenImage get chickenSvg => const SvgGenImage.vec('assets/vec/chicken.svg.vec'); + + /// File path: assets/vec/chicken_map_marker.svg.vec + SvgGenImage get chickenMapMarkerSvg => const SvgGenImage.vec('assets/vec/chicken_map_marker.svg.vec'); + + /// File path: assets/vec/clipboard_eye.svg.vec + SvgGenImage get clipboardEyeSvg => const SvgGenImage.vec('assets/vec/clipboard_eye.svg.vec'); + + /// File path: assets/vec/clipboard_task.svg.vec + SvgGenImage get clipboardTaskSvg => const SvgGenImage.vec('assets/vec/clipboard_task.svg.vec'); + + /// File path: assets/vec/clock.svg.vec + SvgGenImage get clockSvg => const SvgGenImage.vec('assets/vec/clock.svg.vec'); + + /// File path: assets/vec/close_circle.svg.vec + SvgGenImage get closeCircleSvg => const SvgGenImage.vec('assets/vec/close_circle.svg.vec'); + + /// File path: assets/vec/close_square.svg.vec + SvgGenImage get closeSquareSvg => const SvgGenImage.vec('assets/vec/close_square.svg.vec'); + + /// File path: assets/vec/convert_cube.svg.vec + SvgGenImage get convertCubeSvg => const SvgGenImage.vec('assets/vec/convert_cube.svg.vec'); + + /// File path: assets/vec/cow.svg.vec + SvgGenImage get cowSvg => const SvgGenImage.vec('assets/vec/cow.svg.vec'); + + /// File path: assets/vec/cube.svg.vec + SvgGenImage get cubeSvg => const SvgGenImage.vec('assets/vec/cube.svg.vec'); + + /// File path: assets/vec/cube_bottom_rotation.svg.vec + SvgGenImage get cubeBottomRotationSvg => const SvgGenImage.vec('assets/vec/cube_bottom_rotation.svg.vec'); + + /// File path: assets/vec/cube_card.svg.vec + SvgGenImage get cubeCardSvg => const SvgGenImage.vec('assets/vec/cube_card.svg.vec'); + + /// File path: assets/vec/cube_rotate.svg.vec + SvgGenImage get cubeRotateSvg => const SvgGenImage.vec('assets/vec/cube_rotate.svg.vec'); + + /// File path: assets/vec/cube_scan.svg.vec + SvgGenImage get cubeScanSvg => const SvgGenImage.vec('assets/vec/cube_scan.svg.vec'); + + /// File path: assets/vec/cube_search.svg.vec + SvgGenImage get cubeSearchSvg => const SvgGenImage.vec('assets/vec/cube_search.svg.vec'); + + /// File path: assets/vec/cube_top_rotation.svg.vec + SvgGenImage get cubeTopRotationSvg => const SvgGenImage.vec('assets/vec/cube_top_rotation.svg.vec'); + + /// File path: assets/vec/cube_watting.svg.vec + SvgGenImage get cubeWattingSvg => const SvgGenImage.vec('assets/vec/cube_watting.svg.vec'); + + /// File path: assets/vec/diagram.svg.vec + SvgGenImage get diagramSvg => const SvgGenImage.vec('assets/vec/diagram.svg.vec'); + + /// File path: assets/vec/download.svg.vec + SvgGenImage get downloadSvg => const SvgGenImage.vec('assets/vec/download.svg.vec'); + + /// File path: assets/vec/edit.svg.vec + SvgGenImage get editSvg => const SvgGenImage.vec('assets/vec/edit.svg.vec'); + + /// File path: assets/vec/empty.svg.vec + SvgGenImage get emptySvg => const SvgGenImage.vec('assets/vec/empty.svg.vec'); + + /// File path: assets/vec/excel_download.svg.vec + SvgGenImage get excelDownloadSvg => const SvgGenImage.vec('assets/vec/excel_download.svg.vec'); + + /// File path: assets/vec/filter.svg.vec + SvgGenImage get filterSvg => const SvgGenImage.vec('assets/vec/filter.svg.vec'); + + /// File path: assets/vec/filter_outline.svg.vec + SvgGenImage get filterOutlineSvg => const SvgGenImage.vec('assets/vec/filter_outline.svg.vec'); + + /// File path: assets/vec/gps.svg.vec + SvgGenImage get gpsSvg => const SvgGenImage.vec('assets/vec/gps.svg.vec'); + + /// File path: assets/vec/home.svg.vec + SvgGenImage get homeSvg => const SvgGenImage.vec('assets/vec/home.svg.vec'); + + /// File path: assets/vec/hot_chicken.svg.vec + SvgGenImage get hotChickenSvg => const SvgGenImage.vec('assets/vec/hot_chicken.svg.vec'); + + /// File path: assets/vec/information.svg.vec + SvgGenImage get informationSvg => const SvgGenImage.vec('assets/vec/information.svg.vec'); + + /// File path: assets/vec/inside.svg.vec + SvgGenImage get insideSvg => const SvgGenImage.vec('assets/vec/inside.svg.vec'); + + /// File path: assets/vec/inspection.svg.vec + SvgGenImage get inspectionSvg => const SvgGenImage.vec('assets/vec/inspection.svg.vec'); + + /// File path: assets/vec/key.svg.vec + SvgGenImage get keySvg => const SvgGenImage.vec('assets/vec/key.svg.vec'); + + /// File path: assets/vec/liveStock.svg.vec + SvgGenImage get liveStockSvg => const SvgGenImage.vec('assets/vec/liveStock.svg.vec'); + + /// File path: assets/vec/lock.svg.vec + SvgGenImage get lockSvg => const SvgGenImage.vec('assets/vec/lock.svg.vec'); + + /// File path: assets/vec/logout.svg.vec + SvgGenImage get logoutSvg => const SvgGenImage.vec('assets/vec/logout.svg.vec'); + + /// File path: assets/vec/map.svg.vec + SvgGenImage get mapSvg => const SvgGenImage.vec('assets/vec/map.svg.vec'); + + /// File path: assets/vec/map_marker.svg.vec + SvgGenImage get mapMarkerSvg => const SvgGenImage.vec('assets/vec/map_marker.svg.vec'); + + /// File path: assets/vec/message_add.svg.vec + SvgGenImage get messageAddSvg => const SvgGenImage.vec('assets/vec/message_add.svg.vec'); + + /// File path: assets/vec/outside.svg.vec + SvgGenImage get outsideSvg => const SvgGenImage.vec('assets/vec/outside.svg.vec'); + + /// File path: assets/vec/pdf_download.svg.vec + SvgGenImage get pdfDownloadSvg => const SvgGenImage.vec('assets/vec/pdf_download.svg.vec'); + + /// File path: assets/vec/people.svg.vec + SvgGenImage get peopleSvg => const SvgGenImage.vec('assets/vec/people.svg.vec'); + + /// File path: assets/vec/picture_frame.svg.vec + SvgGenImage get pictureFrameSvg => const SvgGenImage.vec('assets/vec/picture_frame.svg.vec'); + + /// File path: assets/vec/place_holder.svg.vec + SvgGenImage get placeHolderSvg => const SvgGenImage.vec('assets/vec/place_holder.svg.vec'); + + /// File path: assets/vec/profile2.svg.vec + SvgGenImage get profile2Svg => const SvgGenImage.vec('assets/vec/profile2.svg.vec'); + + /// File path: assets/vec/profile2_outline.svg.vec + SvgGenImage get profile2OutlineSvg => const SvgGenImage.vec('assets/vec/profile2_outline.svg.vec'); + + /// File path: assets/vec/profile_circle.svg.vec + SvgGenImage get profileCircleSvg => const SvgGenImage.vec('assets/vec/profile_circle.svg.vec'); + + /// File path: assets/vec/profile_user.svg.vec + SvgGenImage get profileUserSvg => const SvgGenImage.vec('assets/vec/profile_user.svg.vec'); + + /// File path: assets/vec/receipt_discount.svg.vec + SvgGenImage get receiptDiscountSvg => const SvgGenImage.vec('assets/vec/receipt_discount.svg.vec'); + + /// File path: assets/vec/sale.svg.vec + SvgGenImage get saleSvg => const SvgGenImage.vec('assets/vec/sale.svg.vec'); + + /// File path: assets/vec/scan.svg.vec + SvgGenImage get scanSvg => const SvgGenImage.vec('assets/vec/scan.svg.vec'); + + /// File path: assets/vec/scan_barcode.svg.vec + SvgGenImage get scanBarcodeSvg => const SvgGenImage.vec('assets/vec/scan_barcode.svg.vec'); + + /// File path: assets/vec/search.svg.vec + SvgGenImage get searchSvg => const SvgGenImage.vec('assets/vec/search.svg.vec'); + + /// File path: assets/vec/security_time.svg.vec + SvgGenImage get securityTimeSvg => const SvgGenImage.vec('assets/vec/security_time.svg.vec'); + + /// File path: assets/vec/setting.svg.vec + SvgGenImage get settingSvg => const SvgGenImage.vec('assets/vec/setting.svg.vec'); + + /// File path: assets/vec/shop.svg.vec + SvgGenImage get shopSvg => const SvgGenImage.vec('assets/vec/shop.svg.vec'); + + /// File path: assets/vec/shopping_basket.svg.vec + SvgGenImage get shoppingBasketSvg => const SvgGenImage.vec('assets/vec/shopping_basket.svg.vec'); + + /// File path: assets/vec/tag_label.svg.vec + SvgGenImage get tagLabelSvg => const SvgGenImage.vec('assets/vec/tag_label.svg.vec'); + + /// File path: assets/vec/tag_user.svg.vec + SvgGenImage get tagUserSvg => const SvgGenImage.vec('assets/vec/tag_user.svg.vec'); + + /// File path: assets/vec/task.svg.vec + SvgGenImage get taskSvg => const SvgGenImage.vec('assets/vec/task.svg.vec'); + + /// File path: assets/vec/timer.svg.vec + SvgGenImage get timerSvg => const SvgGenImage.vec('assets/vec/timer.svg.vec'); + + /// File path: assets/vec/trash.svg.vec + SvgGenImage get trashSvg => const SvgGenImage.vec('assets/vec/trash.svg.vec'); + + /// File path: assets/vec/truck.svg.vec + SvgGenImage get truckSvg => const SvgGenImage.vec('assets/vec/truck.svg.vec'); + + /// File path: assets/vec/truck_fast.svg.vec + SvgGenImage get truckFastSvg => const SvgGenImage.vec('assets/vec/truck_fast.svg.vec'); + + /// File path: assets/vec/truck_fast_outlined.svg.vec + SvgGenImage get truckFastOutlinedSvg => const SvgGenImage.vec('assets/vec/truck_fast_outlined.svg.vec'); + + /// File path: assets/vec/user.svg.vec + SvgGenImage get userSvg => const SvgGenImage.vec('assets/vec/user.svg.vec'); + + /// File path: assets/vec/user_raduis.svg.vec + SvgGenImage get userRaduisSvg => const SvgGenImage.vec('assets/vec/user_raduis.svg.vec'); + + /// File path: assets/vec/user_square.svg.vec + SvgGenImage get userSquareSvg => const SvgGenImage.vec('assets/vec/user_square.svg.vec'); + + /// File path: assets/vec/virtual.svg.vec + SvgGenImage get virtualSvg => const SvgGenImage.vec('assets/vec/virtual.svg.vec'); + + /// File path: assets/vec/whare_house.svg.vec + SvgGenImage get whareHouseSvg => const SvgGenImage.vec('assets/vec/whare_house.svg.vec'); + + /// List of all assets + List get values => [ + a3dCubeSquareSvg, + addSvg, + appBarInspectionSvg, + arrowLeftSvg, + arrowRightSvg, + bgAuthSvg, + bgHeaderUserProfileSvg, + buySvg, + calendarSvg, + calendarSearchSvg, + calendarSearchOutlineSvg, + callSvg, + checkSvg, + checkSquareSvg, + chickenSvg, + chickenMapMarkerSvg, + clipboardEyeSvg, + clipboardTaskSvg, + clockSvg, + closeCircleSvg, + closeSquareSvg, + convertCubeSvg, + cowSvg, + cubeSvg, + cubeBottomRotationSvg, + cubeCardSvg, + cubeRotateSvg, + cubeScanSvg, + cubeSearchSvg, + cubeTopRotationSvg, + cubeWattingSvg, + diagramSvg, + downloadSvg, + editSvg, + emptySvg, + excelDownloadSvg, + filterSvg, + filterOutlineSvg, + gpsSvg, + homeSvg, + hotChickenSvg, + informationSvg, + insideSvg, + inspectionSvg, + keySvg, + liveStockSvg, + lockSvg, + logoutSvg, + mapSvg, + mapMarkerSvg, + messageAddSvg, + outsideSvg, + pdfDownloadSvg, + peopleSvg, + pictureFrameSvg, + placeHolderSvg, + profile2Svg, + profile2OutlineSvg, + profileCircleSvg, + profileUserSvg, + receiptDiscountSvg, + saleSvg, + scanSvg, + scanBarcodeSvg, + searchSvg, + securityTimeSvg, + settingSvg, + shopSvg, + shoppingBasketSvg, + tagLabelSvg, + tagUserSvg, + taskSvg, + timerSvg, + trashSvg, + truckSvg, + truckFastSvg, + truckFastOutlinedSvg, + userSvg, + userRaduisSvg, + userSquareSvg, + virtualSvg, + whareHouseSvg, + ]; +} + +class Assets { + const Assets._(); + + static const $AssetsAnimGen anim = $AssetsAnimGen(); + static const $AssetsIconsGen icons = $AssetsIconsGen(); + static const $AssetsImagesGen images = $AssetsImagesGen(); + static const $AssetsLogosGen logos = $AssetsLogosGen(); + static const $AssetsVecGen vec = $AssetsVecGen(); +} + +class AssetGenImage { + const AssetGenImage(this._assetName, {this.size, this.flavors = const {}, this.animation}); + + final String _assetName; + + final Size? size; + final Set flavors; + final AssetGenImageAnimation? animation; + + Image image({ + Key? key, + AssetBundle? bundle, + ImageFrameBuilder? frameBuilder, + ImageErrorWidgetBuilder? errorBuilder, + String? semanticLabel, + bool excludeFromSemantics = false, + double? scale, + double? width, + double? height, + Color? color, + Animation? opacity, + BlendMode? colorBlendMode, + BoxFit? fit, + AlignmentGeometry alignment = Alignment.center, + ImageRepeat repeat = ImageRepeat.noRepeat, + Rect? centerSlice, + bool matchTextDirection = false, + bool gaplessPlayback = true, + bool isAntiAlias = false, + String? package, + FilterQuality filterQuality = FilterQuality.medium, + int? cacheWidth, + int? cacheHeight, + }) { + return Image.asset( + _assetName, + key: key, + bundle: bundle, + frameBuilder: frameBuilder, + errorBuilder: errorBuilder, + semanticLabel: semanticLabel, + excludeFromSemantics: excludeFromSemantics, + scale: scale, + width: width, + height: height, + color: color, + opacity: opacity, + colorBlendMode: colorBlendMode, + fit: fit, + alignment: alignment, + repeat: repeat, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection, + gaplessPlayback: gaplessPlayback, + isAntiAlias: isAntiAlias, + package: package, + filterQuality: filterQuality, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, + ); + } + + ImageProvider provider({AssetBundle? bundle, String? package}) { + return AssetImage(_assetName, bundle: bundle, package: package); + } + + String get path => _assetName; + + String get keyName => _assetName; +} + +class AssetGenImageAnimation { + const AssetGenImageAnimation({required this.isAnimation, required this.duration, required this.frames}); + + final bool isAnimation; + final Duration duration; + final int frames; +} + +class SvgGenImage { + const SvgGenImage(this._assetName, {this.size, this.flavors = const {}}) : _isVecFormat = false; + + const SvgGenImage.vec(this._assetName, {this.size, this.flavors = const {}}) : _isVecFormat = true; + + final String _assetName; + final Size? size; + final Set flavors; + final bool _isVecFormat; + + _svg.SvgPicture svg({ + Key? key, + bool matchTextDirection = false, + AssetBundle? bundle, + String? package, + double? width, + double? height, + BoxFit fit = BoxFit.contain, + AlignmentGeometry alignment = Alignment.center, + bool allowDrawingOutsideViewBox = false, + WidgetBuilder? placeholderBuilder, + String? semanticsLabel, + bool excludeFromSemantics = false, + _svg.SvgTheme? theme, + _svg.ColorMapper? colorMapper, + ColorFilter? colorFilter, + Clip clipBehavior = Clip.hardEdge, + @deprecated Color? color, + @deprecated BlendMode colorBlendMode = BlendMode.srcIn, + @deprecated bool cacheColorFilter = false, + }) { + final _svg.BytesLoader loader; + if (_isVecFormat) { + loader = _vg.AssetBytesLoader(_assetName, assetBundle: bundle, packageName: package); + } else { + loader = _svg.SvgAssetLoader( + _assetName, + assetBundle: bundle, + packageName: package, + theme: theme, + colorMapper: colorMapper, + ); + } + return _svg.SvgPicture( + loader, + key: key, + matchTextDirection: matchTextDirection, + width: width, + height: height, + fit: fit, + alignment: alignment, + allowDrawingOutsideViewBox: allowDrawingOutsideViewBox, + placeholderBuilder: placeholderBuilder, + semanticsLabel: semanticsLabel, + excludeFromSemantics: excludeFromSemantics, + colorFilter: colorFilter ?? (color == null ? null : ColorFilter.mode(color, colorBlendMode)), + clipBehavior: clipBehavior, + cacheColorFilter: cacheColorFilter, + ); + } + + String get path => _assetName; + + String get keyName => _assetName; +} + +class LottieGenImage { + const LottieGenImage(this._assetName, {this.flavors = const {}}); + + final String _assetName; + final Set flavors; + + _lottie.LottieBuilder lottie({ + Animation? controller, + bool? animate, + _lottie.FrameRate? frameRate, + bool? repeat, + bool? reverse, + _lottie.LottieDelegates? delegates, + _lottie.LottieOptions? options, + void Function(_lottie.LottieComposition)? onLoaded, + _lottie.LottieImageProviderFactory? imageProviderFactory, + Key? key, + AssetBundle? bundle, + Widget Function(BuildContext, Widget, _lottie.LottieComposition?)? frameBuilder, + ImageErrorWidgetBuilder? errorBuilder, + double? width, + double? height, + BoxFit? fit, + AlignmentGeometry? alignment, + String? package, + bool? addRepaintBoundary, + FilterQuality? filterQuality, + void Function(String)? onWarning, + _lottie.LottieDecoder? decoder, + _lottie.RenderCache? renderCache, + bool? backgroundLoading, + }) { + return _lottie.Lottie.asset( + _assetName, + controller: controller, + animate: animate, + frameRate: frameRate, + repeat: repeat, + reverse: reverse, + delegates: delegates, + options: options, + onLoaded: onLoaded, + imageProviderFactory: imageProviderFactory, + key: key, + bundle: bundle, + frameBuilder: frameBuilder, + errorBuilder: errorBuilder, + width: width, + height: height, + fit: fit, + alignment: alignment, + package: package, + addRepaintBoundary: addRepaintBoundary, + filterQuality: filterQuality, + onWarning: onWarning, + decoder: decoder, + renderCache: renderCache, + backgroundLoading: backgroundLoading, + ); + } + + String get path => _assetName; + + String get keyName => _assetName; +} diff --git a/packages/core/lib/presentation/common/common.dart b/packages/core/lib/presentation/common/common.dart new file mode 100644 index 0000000..36e4588 --- /dev/null +++ b/packages/core/lib/presentation/common/common.dart @@ -0,0 +1,3 @@ +export 'app_color.dart'; +export 'app_fonts.dart'; +export 'assets.gen.dart'; diff --git a/packages/core/lib/presentation/common/fonts.gen.dart b/packages/core/lib/presentation/common/fonts.gen.dart new file mode 100644 index 0000000..5e86efd --- /dev/null +++ b/packages/core/lib/presentation/common/fonts.gen.dart @@ -0,0 +1,16 @@ +// dart format width=120 +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import + +class FontFamily { + FontFamily._(); + + /// Font family: yekan + static const String yekan = 'yekan'; +} diff --git a/packages/core/lib/presentation/utils/color_utils.dart b/packages/core/lib/presentation/utils/color_utils.dart new file mode 100644 index 0000000..19bea54 --- /dev/null +++ b/packages/core/lib/presentation/utils/color_utils.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; + +extension ColorUtils on Color { + Color _darken([double amount = 0.1]) { + assert(amount >= 0 && amount <= 1, 'Amount must be between 0 and 1'); + final hslColor = HSLColor.fromColor(this); + final newLightness = (hslColor.lightness - amount).clamp(0.0, 1.0); + final hslDarkerColor = hslColor.withLightness(newLightness); + return hslDarkerColor.toColor(); + } + + get disabledColor{ + return withAlpha(38); + } + + get hoverColor{ + return _darken(0.5); + } + + get pressedColor{ + return _darken(0.10); + } + +} diff --git a/packages/core/lib/presentation/utils/data_time_utils.dart b/packages/core/lib/presentation/utils/data_time_utils.dart new file mode 100644 index 0000000..f62a641 --- /dev/null +++ b/packages/core/lib/presentation/utils/data_time_utils.dart @@ -0,0 +1,13 @@ +extension XDataTime on DateTime { + String get formattedGregorianDate { + + return "$year/${month.toString().padLeft(2, '0')}/${day.toString().padLeft(2, '0')}"; + } + + String get formattedDashedGregorian { + + return "$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}"; + } + + +} \ No newline at end of file diff --git a/packages/core/lib/presentation/utils/image_utils.dart b/packages/core/lib/presentation/utils/image_utils.dart new file mode 100644 index 0000000..eb5c2b9 --- /dev/null +++ b/packages/core/lib/presentation/utils/image_utils.dart @@ -0,0 +1,8 @@ +import 'dart:convert'; +import 'dart:io'; + +Future convertImageToBase64(String imagePath) async { + final bytes = await File(imagePath).readAsBytes(); + String base64String = base64Encode(bytes); + return base64String; +} diff --git a/packages/core/lib/presentation/utils/list_extensions.dart b/packages/core/lib/presentation/utils/list_extensions.dart new file mode 100644 index 0000000..b97cced --- /dev/null +++ b/packages/core/lib/presentation/utils/list_extensions.dart @@ -0,0 +1,26 @@ +extension ListExtensions on List { + void toggle(T item) { + if (contains(item)) { + + remove(item); + + } else { + add(item); + } + } + + void ensureContainsAtStart(T item) { + if (!contains(item)) { + insert(0, item); + } + } + + void removeIfPresent(T item) { + remove(item); + } + + void resetWith(T item) { + clear(); + add(item); + } +} diff --git a/packages/core/lib/presentation/utils/utils.dart b/packages/core/lib/presentation/utils/utils.dart new file mode 100644 index 0000000..88258e2 --- /dev/null +++ b/packages/core/lib/presentation/utils/utils.dart @@ -0,0 +1,4 @@ +export 'color_utils.dart'; +export 'data_time_utils.dart'; +export 'image_utils.dart'; +export 'list_extensions.dart'; diff --git a/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart new file mode 100644 index 0000000..e04ebaf --- /dev/null +++ b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class RAppBar extends StatelessWidget implements PreferredSizeWidget { + final String? title; + final String? iconTitle; + final Color backgroundColor; + final Color iconColor; + final bool hasBack; + final bool centerTitle; + final TextStyle? titleTextStyle; + final VoidCallback? onBackPressed; + final List? additionalActions; + final int? leadingWidth; + final Widget? leading; + final PreferredSizeWidget? bottom; + + const RAppBar({ + super.key, + this.title, + this.iconTitle, + this.backgroundColor = AppColor.blueNormal, + this.iconColor = Colors.white, + this.titleTextStyle, + this.onBackPressed, + this.additionalActions, + this.leading, + this.hasBack = true, + this.centerTitle = false, + this.leadingWidth, + this.bottom, + }); + + @override + Widget build(BuildContext context) { + return AppBar( + automaticallyImplyLeading: false, + backgroundColor: backgroundColor, + elevation: 0, + excludeHeaderSemantics: true, + scrolledUnderElevation: 0, + centerTitle: centerTitle, + titleTextStyle: titleTextStyle ?? AppFonts.yekan16.copyWith(color: Colors.white), + title: title != null + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text(title!), + if (iconTitle != null) ...{const SizedBox(width: 8)}, + if (iconTitle != null) ...{SvgGenImage.vec(iconTitle!).svg(width: 24, height: 24)}, + ], + ) + : null, + leadingWidth: leadingWidth?.toDouble(), + leading: leading != null + ? Padding(padding: const EdgeInsets.only(right: 6), child: leading) + : null, + titleSpacing: 8, + actions: [ + if (additionalActions != null) ...additionalActions!, + if (hasBack) ...{ + GestureDetector( + onTap: onBackPressed ?? () => Get.back(), + child: Padding( + padding: const EdgeInsets.fromLTRB(10, 0, 2, 0), + child: Assets.vec.arrowLeftSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(iconColor ?? Colors.white, BlendMode.srcIn), + ), + ), + ), + }, + ], + bottom: bottom, + ); + } + + @override + Size get preferredSize => const Size.fromHeight(kToolbarHeight); +} diff --git a/packages/core/lib/presentation/widget/bottom_navigation/r_bottom_navigation.dart b/packages/core/lib/presentation/widget/bottom_navigation/r_bottom_navigation.dart new file mode 100644 index 0000000..d4299bc --- /dev/null +++ b/packages/core/lib/presentation/widget/bottom_navigation/r_bottom_navigation.dart @@ -0,0 +1,84 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class RBottomNavigation extends StatefulWidget { + RBottomNavigation({super.key, required this.items,this.mainAxisAlignment}); + + final List items; + MainAxisAlignment? mainAxisAlignment; + + @override + State createState() => _RBottomNavigationState(); +} + +class _RBottomNavigationState extends State { + @override + Widget build(BuildContext context) { + return Container( + height: 100.h, + padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 18.h), + decoration: BoxDecoration( + color: AppColor.blueNormal, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(32), + topRight: Radius.circular(32), + ), + ), + child: Row( + mainAxisAlignment: widget.mainAxisAlignment??MainAxisAlignment.spaceBetween, + children: widget.items, + ), + ); + } +} + +class RBottomNavigationItem extends StatelessWidget { + final String icon; + final String label; + final bool isSelected; + final Function() onTap; + + const RBottomNavigationItem({ + super.key, + required this.icon, + required this.label, + required this.isSelected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Container( + width: 70.w, + height: 70.h, + padding: const EdgeInsets.symmetric(horizontal: 10), + decoration: BoxDecoration( + color: isSelected ? Colors.white.withAlpha(208) : Colors.transparent, + borderRadius: BorderRadius.circular(10), + ), + child: InkWell( + onTap: onTap, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgGenImage.vec(icon).svg( + width: 40.w, + height: 40.h, + colorFilter: ColorFilter.mode( + isSelected ? AppColor.blueNormal : Colors.white, + BlendMode.srcIn, + ), + ), + SizedBox(height: 5.h), + Text( + label, + style: AppFonts.yekan10.copyWith( + color: isSelected ? AppColor.blueNormal : Colors.white, + ), + ), + ], + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart b/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart new file mode 100644 index 0000000..8c92900 --- /dev/null +++ b/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart @@ -0,0 +1,128 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class WaveBottomNavigationItem { + final String title; + final Widget icon; + + WaveBottomNavigationItem({required this.title, required this.icon}); +} + +class WaveBottomNavigation extends StatefulWidget { + const WaveBottomNavigation({super.key, this.initPage = 0, required this.items, required this.onPageChanged}); + + final List items; + final Function(int) onPageChanged; + final int initPage; + + @override + State createState() => _WaveBottomNavigationState(); +} + +class _WaveBottomNavigationState extends State { + late PageController _controller; + + @override + void initState() { + super.initState(); + _controller = PageController(viewportFraction: 0.3, initialPage: widget.initPage); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + double _calculateScale(double currentPage, int index) { + final double distance = (currentPage - index).abs(); + if (distance >= 1) { + return 0.9; + } else { + return 1.50; + } + } + + @override + Widget build(BuildContext context) { + return Container( + height: 68, + color: AppColor.blueNormal, + clipBehavior: Clip.none, + padding: const EdgeInsets.all(10), + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [backgroundWidget(), waveScrolledLists()], + ), + ); + } + + Widget backgroundWidget() { + return Positioned( + top: -43, + child: Container( + width: 90, + height: 90, + clipBehavior: Clip.none, + decoration: ShapeDecoration( + color: AppColor.greenNormal, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(200), + side: BorderSide(width: 5, color: Colors.white), + ), + ), + ), + ); + } + + Widget waveScrolledLists() { + return PageView.builder( + controller: _controller, + clipBehavior: Clip.none, + onPageChanged: widget.onPageChanged, + scrollDirection: Axis.horizontal, + itemCount: widget.items.length, + physics: const ClampingScrollPhysics(), + itemBuilder: (context, index) { + final WaveBottomNavigationItem item = widget.items[index]; + return GestureDetector( + onTap: () { + _controller.animateToPage(index, duration: Duration(milliseconds: 500), curve: Curves.easeInOut); + }, + child: Center( + child: AnimatedBuilder( + animation: _controller, + builder: (context, child) { + double value = 0.0; + final scale = _calculateScale(_controller.page ?? _controller.initialPage.toDouble() ?? 0.0, index); + value = index - (_controller.page ?? _controller.initialPage.toDouble() ?? 0.0); + value = (value).clamp(-1, 1); + double offset = value * 30; + if (value.abs() < 0.2 || value.abs() > 0.2) { + offset = -15 * (1 - value.abs() * 2); + } + + return Transform.scale( + scale: scale, + child: Transform.translate( + offset: Offset(0, offset), + child: Column( + children: [ + Tooltip(message: item.title, child: item.icon), + Visibility( + visible: (_controller.page ?? 0) == index, + child: Text(item.title, style: AppFonts.yekan8.copyWith(color: Colors.white)), + ), + ], + ), + ), + ); + }, + ), + ), + ); + }, + ); + } +} diff --git a/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart new file mode 100644 index 0000000..ac7db9c --- /dev/null +++ b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart @@ -0,0 +1,68 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; + +class BaseBottomSheet extends StatelessWidget { + const BaseBottomSheet({ + super.key, + this.child, + this.height, + this.bgColor, + this.rootChild, + }):assert(child==null || rootChild==null, 'You can only provide one of child or rootChild'); + + final Widget? child; + final Widget? rootChild; + final double? height; + final Color? bgColor; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Container( + height: height ?? MediaQuery.of(context).size.height * 0.80, + padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), + decoration: BoxDecoration( + color: bgColor ?? Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(25), + topRight: Radius.circular(25), + ), + ), + child: Column( + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 20, + child: Stack( + alignment: AlignmentDirectional.center, + children: [ + Container( + height: 3, + width: 50, + decoration: BoxDecoration( + color: AppColor.darkGreyDark, + borderRadius: BorderRadius.circular(8), + ), + ), + + Positioned( + left: -10, + child: IconButton( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: Icon(CupertinoIcons.clear_circled), + ), + ), + ], + ), + ), + SizedBox(height: 8), + Expanded(child: rootChild ?? SingleChildScrollView(child: child)), + ], + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/bottom_sheet/date_picker_bottom_sheet.dart b/packages/core/lib/presentation/widget/bottom_sheet/date_picker_bottom_sheet.dart new file mode 100644 index 0000000..7d3195a --- /dev/null +++ b/packages/core/lib/presentation/widget/bottom_sheet/date_picker_bottom_sheet.dart @@ -0,0 +1,94 @@ +import 'package:flutter/material.dart'; + +import '../../../core.dart'; + +GestureDetector dateFilterWidget({ + isFrom = true, + required Rx date, + required Function(Jalali jalali) onChanged, +}) { + return GestureDetector( + onTap: () { + Get.bottomSheet(modalDatePicker((value) => onChanged(value))); + }, + child: Container( + height: 35, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blueNormal), + ), + padding: EdgeInsets.symmetric(horizontal: 11, vertical: 4), + child: Row( + spacing: 8, + children: [ + Assets.vec.calendarSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + Text(isFrom ? 'از' : 'تا', style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal)), + Expanded( + child: ObxValue((data) { + return Text( + date.value.formatCompactDate(), + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive), + ); + }, date), + ), + ], + ), + ), + ); +} + +Container modalDatePicker(ValueChanged onDateSelected) { + Jalali? tempPickedDate; + return Container( + height: 250, + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + SizedBox(width: 20), + RElevated( + height: 35, + width: 70, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'تایید', + ), + Spacer(), + RElevated( + height: 35, + width: 70, + backgroundColor: AppColor.error, + textStyle: AppFonts.yekan14.copyWith(color: Colors.white), + onPressed: () { + onDateSelected(tempPickedDate ?? Jalali.now()); + Get.back(); + }, + text: 'لغو', + ), + SizedBox(width: 20), + ], + ), + Divider(height: 0, thickness: 1), + Expanded( + child: PersianCupertinoDatePicker( + initialDateTime: Jalali.now(), + mode: PersianCupertinoDatePickerMode.date, + onDateTimeChanged: (dateTime) { + tempPickedDate = dateTime; + }, + ), + ), + ], + ), + ); +} diff --git a/packages/core/lib/presentation/widget/buttons/animated_fab.dart b/packages/core/lib/presentation/widget/buttons/animated_fab.dart new file mode 100644 index 0000000..f9693cf --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/animated_fab.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; + +class AnimatedFab extends StatelessWidget { + final VoidCallback? onPressed; + final Color backgroundColor; + final Color foregroundColor; + final Widget icon; + final double radius; + final bool isLoading; + final String? message; + + const AnimatedFab({ + super.key, + required this.onPressed, + required this.icon, + required this.backgroundColor, + this.foregroundColor = Colors.white, + this.radius = 56.0, + this.isLoading = false, + this.message, + }); + + @override + Widget build(BuildContext context) { + return message != null + ? Tooltip( + message: message ?? '', + child: AnimatedContainer( + duration: const Duration(milliseconds: 1300), + width: radius, + height: radius, + decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle), + child: Material( + color: Colors.transparent, + child: InkWell( + borderRadius: BorderRadius.circular(radius), + onTap: isLoading ? null : onPressed, + child: Center( + child: isLoading + ? SizedBox( + height: radius / 2, + width: radius / 2, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(foregroundColor), + ), + ) + : icon, + ), + ), + ), + ), + ) + : AnimatedContainer( + duration: const Duration(milliseconds: 1300), + width: radius, + height: radius, + decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle), + child: Material( + color: Colors.transparent, + child: InkWell( + borderRadius: BorderRadius.circular(radius), + onTap: isLoading ? null : onPressed, + child: Center( + child: isLoading + ? SizedBox( + height: radius / 2, + width: radius / 2, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(foregroundColor), + ), + ) + : icon, + ), + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/buttons.dart b/packages/core/lib/presentation/widget/buttons/buttons.dart new file mode 100644 index 0000000..7dd4917 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/buttons.dart @@ -0,0 +1,8 @@ +export 'animated_fab.dart'; +export 'elevated.dart'; +export 'fab.dart'; +export 'fab_outlined.dart'; +export 'outline_elevated.dart'; +export 'outline_elevated_icon.dart'; +export 'text_button.dart'; +export 'clear_button.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/buttons/clear_button.dart b/packages/core/lib/presentation/widget/buttons/clear_button.dart new file mode 100644 index 0000000..523d6b5 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/clear_button.dart @@ -0,0 +1,8 @@ +import 'package:flutter/cupertino.dart'; + +Widget clearButton(VoidCallback onTap) { + return GestureDetector( + onTap: onTap, + child: Icon(CupertinoIcons.multiply_circle, size: 20), + ); +} diff --git a/packages/core/lib/presentation/widget/buttons/elevated.dart b/packages/core/lib/presentation/widget/buttons/elevated.dart new file mode 100644 index 0000000..592254b --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/elevated.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class RElevated extends StatelessWidget { + const RElevated({ + super.key, + this.text, + required this.onPressed, + this.foregroundColor = Colors.white, + this.backgroundColor = AppColor.blueNormal, + this.disabledBackgroundColor, + this.disabledForegroundColor = Colors.white, + this.radius = 8.0, + this.textStyle, + this.width = 150.0, + this.height = 56.0, + this.isFullWidth = false, + this.isLoading = false, + this.child, + }) : assert(text != null || child != null, 'Either text or child must be provided'); + + final String? text; + final Widget? child; + final VoidCallback? onPressed; + final double width; + final double height; + final bool isFullWidth; + final Color foregroundColor; + final Color backgroundColor; + final Color? disabledForegroundColor; + final Color? disabledBackgroundColor; + final double radius; + final TextStyle? textStyle; + final bool isLoading; + + @override + Widget build(BuildContext context) { + final bool isEnabled = onPressed != null && !isLoading; + + return ElevatedButton( + onPressed: isEnabled ? onPressed : null, + style: ElevatedButton.styleFrom( + backgroundColor: backgroundColor, + foregroundColor: foregroundColor, + disabledBackgroundColor: disabledBackgroundColor ?? backgroundColor.withAlpha(38), + disabledForegroundColor: disabledForegroundColor, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(radius)), + minimumSize: Size(isFullWidth ? double.infinity : width, height), + padding: EdgeInsets.zero, + textStyle: textStyle ?? AppFonts.yekan18, + ), + child: isLoading + ? SizedBox( + width: 24, + height: 24, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(foregroundColor), + ), + ) + : child ?? Text(text!), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/fab.dart b/packages/core/lib/presentation/widget/buttons/fab.dart new file mode 100644 index 0000000..a9dda88 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/fab.dart @@ -0,0 +1,238 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; + +import '../../common/assets.gen.dart'; + +class RFab extends StatefulWidget { + final VoidCallback? onPressed; + Color? foregroundColor; + Color? backgroundColor; + Color? disabledForegroundColor; + Color? disabledBackgroundColor; + double radius; + ShapeBorder? shapeBorder; + Widget? icon; + bool isLoading; + + @override + State createState() => _RFabState(); + + //region Add + RFab.smallAdd({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.addSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.greenNormal, + key: key, + ); + + RFab.add({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.addSvg.svg(width: 56.w, height: 56.h), + backgroundColor: AppColor.greenNormal, + key: key, + ); + + //endregion + + //region Edit + RFab.smallEdit({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.addSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.edit({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.addSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region delete + RFab.smallDelete({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.trashSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.redNormal, + key: key, + ); + + RFab.delete({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.trashSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.redNormal, + key: key, + ); + + //endregion + + //region action + RFab.smallAction({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.scanSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.action({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.scanSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region filter + RFab.smallFilter({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.scanSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.filter({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.scanSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region download + RFab.smallDownload({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.downloadSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.download({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.downloadSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region Excel + RFab.smallExcel({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.excelDownloadSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.greenDark, + key: key, + ); + + RFab.excel({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.excelDownloadSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.greenDark, + key: key, + ); + + //endregion + + //region Back + RFab.smallBack({required VoidCallback? onPressed, Key? key}) + : this.small( + onPressed: onPressed, + icon: Assets.vec.arrowLeftSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + RFab.back({required VoidCallback? onPressed, Key? key}) + : this( + onPressed: onPressed, + icon: Assets.vec.arrowLeftSvg.svg(width: 20, height: 20), + backgroundColor: AppColor.blueNormal, + key: key, + ); + + //endregion + + //region General + RFab.small({ + required this.onPressed, + required this.icon, + required this.backgroundColor, + super.key, + this.isLoading = false, + }) : radius = 40.0, + foregroundColor = Colors.white; + + RFab({ + required this.onPressed, + required this.icon, + required this.backgroundColor, + this.isLoading = false, + super.key, + }) : radius = 56.0, + foregroundColor = Colors.white; + + //endregion +} + +class _RFabState extends State { + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: widget.isLoading == false ? widget.onPressed : null, + style: ButtonStyle( + side: WidgetStateProperty.all(BorderSide.none), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.backgroundColor?.pressedColor ?? AppColor.blueNormalActive; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.hoverColor ?? AppColor.blueNormalHover; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor?.disabledColor ?? AppColor.blueNormal.disabledColor; + } + return widget.backgroundColor ?? AppColor.blueNormal; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { + return widget.foregroundColor?.disabledColor; + } + return widget.foregroundColor; + }), + + shape: WidgetStatePropertyAll( + CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.radius ?? 56, widget.radius ?? 56)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + ), + child: widget.isLoading + ? SizedBox( + height: widget.radius / 2, + width: widget.radius / 2, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(widget.foregroundColor ?? Colors.white), + ), + ) + : widget.icon, + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/fab_outlined.dart b/packages/core/lib/presentation/widget/buttons/fab_outlined.dart new file mode 100644 index 0000000..2b408bd --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/fab_outlined.dart @@ -0,0 +1,639 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/assets.gen.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; + +class RFabOutlined extends StatefulWidget { + final Widget icon; + VoidCallback? onPressed; + final Color backgroundColor; + final Color? borderColor; + final double? radius; + OutlinedBorder? shapeBorder; + + @override + State createState() => _RFabOutlinedState(); + + //region General + RFabOutlined({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + required this.borderColor, + this.radius = 56.0, + super.key, + }) : shapeBorder = CircleBorder( + side: BorderSide(color: borderColor ?? Colors.transparent), + ); + + RFabOutlined.noBorder({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + super.key, + }) : borderColor = Colors.transparent, + radius = 56.0, + shapeBorder = CircleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + ); + + RFabOutlined.small({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + required this.borderColor, + super.key, + }) : radius = 40.0, + shapeBorder = CircleBorder( + side: BorderSide(color: borderColor ?? Colors.transparent, width: 1), + ); + + RFabOutlined.smallNoBorder({ + required this.icon, + required this.onPressed, + required this.backgroundColor, + super.key, + }) : borderColor = Colors.transparent, + radius = 40.0, + shapeBorder = CircleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + ); + + //endregion + + //region Add + RFabOutlined.smallAdd({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + borderColor: AppColor.greenNormal, + icon: Assets.vec.addSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallAddNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + + icon: Assets.vec.addSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.add({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + borderColor: AppColor.greenNormal, + icon: Assets.vec.addSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.addNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenNormal, + icon: Assets.vec.addSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Edit + RFabOutlined.smallEdit({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.editSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallEditNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.editSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.edit({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.editSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.editNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.editSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Delete + RFabOutlined.smallDelete({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + borderColor: AppColor.redNormal, + icon: Assets.vec.trashSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallDeleteNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + icon: Assets.vec.trashSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.delete({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + borderColor: AppColor.redNormal, + icon: Assets.vec.trashSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.deleteNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.redNormal, + icon: Assets.vec.trashSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.redNormal + : AppColor.redNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Action + RFabOutlined.smallAction({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.scanSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallActionNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.scanSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.action({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.scanSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.actionNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.scanSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Filter + RFabOutlined.smallFilter({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.filterSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallFilterNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.filterSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.filter({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.filterSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.filterNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.filterSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Download + RFabOutlined.smallDownload({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.downloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallDownloadNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.downloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.download({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.downloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.downloadNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.downloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Excel + RFabOutlined.smallExcel({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + borderColor: AppColor.greenDark, + icon: Assets.vec.excelDownloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallExcelNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + icon: Assets.vec.excelDownloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.excel({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + borderColor: AppColor.greenDark, + icon: Assets.vec.excelDownloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.excelNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.greenDark, + icon: Assets.vec.excelDownloadSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.greenNormal + : AppColor.greenNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion + + //region Back + RFabOutlined.smallBack({VoidCallback? onPressed, Key? key}) + : this.small( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.arrowLeftSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.smallBackNoBorder({VoidCallback? onPressed, Key? key}) + : this.smallNoBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.arrowLeftSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.back({VoidCallback? onPressed, Key? key}) + : this( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + borderColor: AppColor.blueNormal, + icon: Assets.vec.arrowLeftSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + RFabOutlined.backNoBorder({VoidCallback? onPressed, Key? key}) + : this.noBorder( + key: key, + onPressed: onPressed, + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.arrowLeftSvg.svg( + colorFilter: ColorFilter.mode( + onPressed != null + ? AppColor.blueNormal + : AppColor.blueNormal.disabledColor, + BlendMode.srcIn, + ), + ), + ); + + //endregion +} + +class _RFabOutlinedState extends State { + bool isOnPressed = false; + + @override + Widget build(BuildContext context) { + return OutlinedButton( + onPressed: widget.onPressed, + style: ButtonStyle( + side: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { + return BorderSide( + color: + widget.borderColor?.disabledColor ?? + AppColor.blueNormal.disabledColor, + width: 2, + ); + } + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal, + width: 2, + ); + }), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.backgroundColor; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor.hoverColor ?? + AppColor.blueNormal.hoverColor; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor.disabledColor ?? + AppColor.blueNormal.disabledColor; + } + return Colors.transparent; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor.disabledColor ?? + AppColor.blueNormal.disabledColor; + } + return widget.backgroundColor; + }), + + shape: WidgetStatePropertyAll(widget.shapeBorder), + fixedSize: WidgetStatePropertyAll( + Size(widget.radius ?? 56, widget.radius ?? 56), + ), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + ), + child: widget.icon, + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart new file mode 100644 index 0000000..4d1e629 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart @@ -0,0 +1,127 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ROutlinedElevated extends StatefulWidget { + ROutlinedElevated({ + super.key, + this.text, + this.onPressed, + this.foregroundColor, + this.backgroundColor, + this.borderColor, + this.disabledBackgroundColor, + this.pressedBackgroundColor, + this.radius, + this.textStyle, + this.child, + this.width, + this.height, + }):assert(text!=null || child != null, 'Either text or child must be provided'); + + final String? text; + final VoidCallback? onPressed; + final double? width; + final double? height; + Color? foregroundColor; + Color? backgroundColor; + Color? borderColor; + Color? disabledBackgroundColor; + Color? pressedBackgroundColor; + double? radius; + TextStyle? textStyle; + Widget? child; + + @override + State createState() => _ROutlinedElevatedState(); +} + +class _ROutlinedElevatedState extends State { + final WidgetStatesController _statesController = WidgetStatesController(); + final GlobalKey _widgetKey = GlobalKey(); + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + _getWidgetHeight(); + }); + } + + void _getWidgetHeight() { + final RenderBox? renderBox = _widgetKey.currentContext?.findRenderObject() as RenderBox?; + if (renderBox != null) { + final height = renderBox.size.height; + debugPrint('ارتفاع ویجت بعد از رندر شدن: $height'); + } else { + debugPrint('ویجت هنوز رندر نشده است'); + } + } + + @override + void dispose() { + _statesController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ConstrainedBox( + constraints: BoxConstraints.tightFor( + width: widget.width ?? 150.w, + height: widget.height ?? 40.h, + ), + child: OutlinedButton( + key: _widgetKey, + statesController: _statesController, + onPressed: widget.onPressed, + style: ButtonStyle( + side: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2); + } else if (states.contains(WidgetState.disabled)) { + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal.withAlpha(38), + width: 2, + ); + } + return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2); + }), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + if (widget.pressedBackgroundColor != null) { + return widget.pressedBackgroundColor; + } + return widget.backgroundColor?.pressedColor ?? widget.borderColor?.pressedColor; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.hoverColor ?? AppColor.blueNormal.hoverColor; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor?.disabledColor ?? Colors.transparent; + } + return widget.backgroundColor; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return AppColor.blueNormal.withAlpha(38); + } + return widget.foregroundColor ?? widget.borderColor ?? AppColor.blueNormal; + }), + shape: WidgetStatePropertyAll( + RoundedRectangleBorder(borderRadius: BorderRadius.circular(widget.radius ?? 8)), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.width ?? 150.w, widget.height ?? 56.h)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + textStyle: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.textStyle?.copyWith(color: Colors.white) ?? + AppFonts.yekan20.copyWith(color: Colors.white); + } + return widget.textStyle ?? AppFonts.yekan20.copyWith(color: AppColor.blueNormal); + }), + ), + child: widget.child ?? Text(widget.text ?? ''), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart new file mode 100644 index 0000000..7260c6b --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart @@ -0,0 +1,130 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ROutlinedElevatedIcon extends StatefulWidget { + ROutlinedElevatedIcon({ + super.key, + required this.text, + required this.onPressed, + this.foregroundColor, + this.backgroundColor, + this.borderColor, + this.disabledBackgroundColor, + this.pressedBackgroundColor, + this.radius, + this.textStyle, + this.icon, + this.width = 150.0, + this.height = 56.0, + }); + + final String text; + final VoidCallback? onPressed; + final double width; + final double height; + Color? foregroundColor; + Color? backgroundColor; + Color? borderColor; + Color? disabledBackgroundColor; + Color? pressedBackgroundColor; + double? radius; + TextStyle? textStyle; + Widget? icon; + + @override + State createState() => _ROutlinedElevatedIconState(); +} + +class _ROutlinedElevatedIconState extends State { + @override + Widget build(BuildContext context) { + return OutlinedButton.icon( + icon: widget.icon, + + label: Text(widget.text), + onPressed: widget.onPressed, + style: ButtonStyle( + side: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal, + width: 2, + ); + } else if (states.contains(WidgetState.disabled)) { + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal.withAlpha(38), + width: 2, + ); + } + return BorderSide( + color: widget.borderColor ?? AppColor.blueNormal, + width: 2, + ); + }), + iconColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return widget.foregroundColor?.disabledColor ?? + AppColor.blueNormal.withAlpha(38); + } else if (states.contains(WidgetState.hovered)) { + return widget.foregroundColor?.hoverColor ?? + AppColor.blueNormal.withAlpha(50); + } + return widget.foregroundColor ?? AppColor.blueNormal; + }), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + if (widget.pressedBackgroundColor != null) { + return widget.pressedBackgroundColor; + } + return widget.backgroundColor?.pressedColor ?? AppColor.blueNormal; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.hoverColor ?? + AppColor.blueNormal.hoverColor; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor?.disabledColor ?? Colors.transparent; + } + return widget.backgroundColor; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return widget.foregroundColor?.disabledColor ?? + AppColor.blueNormal.withAlpha(38); + } else if (states.contains(WidgetState.hovered)) { + return widget.foregroundColor?.hoverColor ?? + AppColor.blueNormal.withAlpha(50); + } + return widget.foregroundColor ?? AppColor.blueNormal; + }), + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.radius ?? 8), + ), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.width, widget.height)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + textStyle: WidgetStatePropertyAll( + widget.textStyle ?? + AppFonts.yekan24.copyWith(color: AppColor.blueNormal), + ), + ), + ); + } +} + +Color? _getIconColor(BuildContext context) { + var ss =WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return Colors.grey.withAlpha(38); + } else if (states.contains(WidgetState.hovered)) { + return Colors.blue.withAlpha(50); + } + return Colors.blue; + }).resolve({}); + return ss; +} diff --git a/packages/core/lib/presentation/widget/buttons/text_button.dart b/packages/core/lib/presentation/widget/buttons/text_button.dart new file mode 100644 index 0000000..227e06a --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/text_button.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class RTextButton extends StatefulWidget { + RTextButton({ + super.key, + required this.text, + required this.onPressed, + this.foregroundColor, + this.backgroundColor, + this.borderColor, + this.disabledBackgroundColor, + this.radius, + this.textStyle, + this.width = 150.0, + this.height = 56.0, + }); + + final String text; + final VoidCallback? onPressed; + final double width; + final double height; + Color? foregroundColor; + Color? backgroundColor; + Color? borderColor; + + Color? disabledBackgroundColor; + double? radius; + TextStyle? textStyle; + + @override + State createState() => _RTextButtonState(); +} + +class _RTextButtonState extends State { + @override + Widget build(BuildContext context) { + return TextButton( + style: ButtonStyle( + side: WidgetStatePropertyAll(BorderSide.none), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.backgroundColor ?? AppColor.blueNormal; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.withAlpha(38) ?? AppColor.blueNormal.withAlpha(38); + } else if (states.contains(WidgetState.disabled)) { + return widget.disabledBackgroundColor ?? Colors.transparent; + } + return Colors.transparent; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return AppColor.blueNormal.withAlpha(38); + } + return AppColor.blueNormal; + }), + + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(widget.radius ?? 8), + ), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.width, widget.height)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + textStyle: WidgetStatePropertyAll( + widget.textStyle ?? + AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + ), + ), + onPressed:widget.onPressed, + child: Text(widget.text), + ); + } +} diff --git a/packages/core/lib/presentation/widget/card/card_with_icon_with_border.dart b/packages/core/lib/presentation/widget/card/card_with_icon_with_border.dart new file mode 100644 index 0000000..ca7d2b6 --- /dev/null +++ b/packages/core/lib/presentation/widget/card/card_with_icon_with_border.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class CardIcon extends StatelessWidget { + const CardIcon({ + super.key, + required this.title, + required this.icon, + this.onTap, + }); + + final String title; + final String icon; + final VoidCallback? onTap; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: const BorderSide(color: AppColor.blueNormal, width: 1), + ), + child: Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgGenImage(icon).svg(width: 50, height: 50), + const SizedBox(height: 8), + Text( + title, + style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/chips/r_chips.dart b/packages/core/lib/presentation/widget/chips/r_chips.dart new file mode 100644 index 0000000..7788061 --- /dev/null +++ b/packages/core/lib/presentation/widget/chips/r_chips.dart @@ -0,0 +1,112 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class CustomChip extends StatelessWidget { + final bool isSelected; + final String title; + final int index; + final Function(int) onTap; + final Color selectedColor; + final Color unSelectedColor; + + const CustomChip({ + super.key, + this.isSelected = false, + required this.title, + required this.index, + required this.onTap, + this.selectedColor = AppColor.blueNormal, + this.unSelectedColor = AppColor.whiteGreyNormal, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => onTap.call(index), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: isSelected ? selectedColor : unSelectedColor, + borderRadius: BorderRadius.circular(8), + border: + isSelected + ? Border.fromBorderSide(BorderSide.none) + : Border.all(width: 0.25, color: const Color(0xFFB0B0B0)), + ), + child: Text( + title, + textAlign: TextAlign.center, + style: + isSelected + ? AppFonts.yekan10.copyWith(color: AppColor.whiteLight) + : AppFonts.yekan10, + ), + ), + ); + } +} + +class RFilterChips extends StatelessWidget { + const RFilterChips({ + super.key, + this.isSelected = false, + required this.title, + required this.index, + required this.onTap, + this.selectedColor = AppColor.blueNormal, + this.unSelectedColor = AppColor.whiteGreyDark, + }); + + final bool isSelected; + final String title; + final int index; + final Function(int) onTap; + final Color selectedColor; + final Color unSelectedColor; + + @override + /* Widget build(BuildContext context) { + return FilterChip( + labelStyle: isSelected + ? AppFonts.yekan10.copyWith(color: AppColor.mediumGreyDarkActive) + : AppFonts.yekan10, + label: Text( + title, + textAlign: TextAlign.center), + selected: isSelected, + showCheckmark: false, // مخفی‌کردن چک‌مارک پیش‌فرض + avatar: isSelected + ? Icon( + Icons.star, // آیکون دلخواه به‌جای چک‌مارک + size: 18, + color: Colors.orange, + ) + : null, + selectedColor: selectedColor, + onSelected: (bool selected) { + onTap.call(index); + }, + ); + }*/ + Widget build(BuildContext context) { + return RawChip( + label: Text(title), + labelStyle: isSelected + ? AppFonts.yekan10.copyWith(color: AppColor.mediumGreyDarkActive) + : AppFonts.yekan10, + selected: isSelected, + onSelected: (bool selected) => onTap(index), + backgroundColor: Colors.grey[200], + selectedColor: selectedColor, + showCheckmark: false, + shape: RoundedRectangleBorder( + borderRadius: const BorderRadius.all(Radius.circular(8.0)), + side: BorderSide(width: 1, color: isSelected? selectedColor :unSelectedColor), + ), + deleteIcon: Icon(CupertinoIcons.clear_circled), + onDeleted: isSelected ? () => onTap(index) : null, + ); + } +} diff --git a/packages/core/lib/presentation/widget/dialog/delete_dialog.dart b/packages/core/lib/presentation/widget/dialog/delete_dialog.dart new file mode 100644 index 0000000..5ec7dd2 --- /dev/null +++ b/packages/core/lib/presentation/widget/dialog/delete_dialog.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +import '../../../core.dart'; + + + +Future buildDeleteDialog({ + required Future Function() onConfirm, + required Future Function() onRefresh, +}) async { + await Get.defaultDialog( + title: 'حذف', + middleText: 'آیا از حذف این مورد مطمئن هستید؟', + confirm: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.error, + foregroundColor: Colors.white, + ), + onPressed: () async { + await onConfirm(); + onRefresh(); + Get.back(); + }, + child: Text('بله'), + ), + cancel: ElevatedButton( + onPressed: () { + Get.back(); + }, + child: Text('خیر'), + ), + ); +} diff --git a/packages/core/lib/presentation/widget/dialog/dialog.dart b/packages/core/lib/presentation/widget/dialog/dialog.dart new file mode 100644 index 0000000..9f489da --- /dev/null +++ b/packages/core/lib/presentation/widget/dialog/dialog.dart @@ -0,0 +1,3 @@ +export 'delete_dialog.dart'; +export 'warning_dialog.dart'; +export 'update_dialog.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/dialog/update_dialog.dart b/packages/core/lib/presentation/widget/dialog/update_dialog.dart new file mode 100644 index 0000000..0b4e748 --- /dev/null +++ b/packages/core/lib/presentation/widget/dialog/update_dialog.dart @@ -0,0 +1,53 @@ +import 'dart:io'; + +import 'package:rasadyar_core/core.dart'; + +Future requiredUpdateDialog({required Future Function() onConfirm}) async { + await Get.defaultDialog( + barrierDismissible: false, + onWillPop: () async => false, + title: 'بروزرسانی', + middleText: 'برای استفاده از امکانات برنامه لطفا برنامه را بروز رسانی نمایید.', + confirm: RElevated( + height: 40.h, + width: 150.w, + text: 'خروج', + backgroundColor: AppColor.error, + onPressed: () { + exit(0); + }, + ), + + cancel: RElevated( + height: 40.h, + width: 150.w, + text: 'بروز رسانی', + onPressed: onConfirm, + backgroundColor: AppColor.greenNormal, + ), + ); +} + +Future optionalUpdateDialog({required Future Function() onConfirm}) async { + await Get.defaultDialog( + barrierDismissible: false, + onWillPop: () async => false, + title: 'بروزرسانی', + middleText: 'برای استفاده از امکانات جدید برنامه می توانید آن را بروزرسانی نمایید.', + confirm: RElevated( + height: 40.h, + width: 150.w, + text: 'ادامه', + backgroundColor: AppColor.error, + onPressed: () => Get.back(), + ), + + cancel: RElevated( + height: 40.h, + width: 150.w, + text: 'بروز رسانی', + onPressed: onConfirm, + backgroundColor: AppColor.greenNormal, + ), + ); +} diff --git a/packages/core/lib/presentation/widget/dialog/warning_dialog.dart b/packages/core/lib/presentation/widget/dialog/warning_dialog.dart new file mode 100644 index 0000000..112c9f3 --- /dev/null +++ b/packages/core/lib/presentation/widget/dialog/warning_dialog.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +import '../../../core.dart'; + +Future buildWarningDialog({ + required String title, + required String middleText, + required Future Function() onConfirm, + required Future Function() onRefresh, +}) async { + await Get.defaultDialog( + title: title, + middleText: middleText, + confirm: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.error, + foregroundColor: Colors.white, + ), + onPressed: () async { + await onConfirm(); + onRefresh(); + Get.back(); + }, + child: Text('بله'), + ), + cancel: ElevatedButton( + onPressed: () { + Get.back(); + }, + child: Text('خیر'), + ), + ); +} diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/bottom_sheet_manger.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/bottom_sheet_manger.dart new file mode 100644 index 0000000..7be010e --- /dev/null +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/bottom_sheet_manger.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; + +import 'draggable_bottom_sheet.dart'; +import 'draggable_bottom_sheet_controller.dart'; + +class BottomSheetManager { + final Map _sheetBuilders; + + BottomSheetManager(this._sheetBuilders); + + bool get isAnyVisible => + _sheetBuilders.keys.any((controller) => controller.isVisible.value); + + void closeFirstVisible() { + for (final controller in _sheetBuilders.keys) { + if (controller.isVisible.value) { + controller.toggle(); + break; + } + } + } + + Widget buildVisibleSheet() { + for (final entry in _sheetBuilders.entries) { + if (entry.key.isVisible.value) { + return _buildDraggableSheet(entry.key, entry.value()); + } + } + return const SizedBox.shrink(); + } + + Widget _buildDraggableSheet( + DraggableBottomSheetController controller, + Widget child, + ) { + return DraggableBottomSheet( + controller: controller, + backgroundColor: Colors.white, + child: child, + ); + } +} diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart new file mode 100644 index 0000000..aa74dbc --- /dev/null +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart @@ -0,0 +1,90 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +class DraggableBottomSheet extends StatelessWidget { + final DraggableBottomSheetController controller; + final Widget? child; + final Color? backgroundColor; + + + const DraggableBottomSheet({ + super.key, + required this.controller, + this.child, + this.backgroundColor = Colors.white, + }); + + @override + Widget build(BuildContext context) { + + WidgetsBinding.instance.addPostFrameCallback((_) { + if (controller.isVisible.value && !controller.isVisible.value) { + controller.show(); + } + }); + + return Obx(() { + if (!controller.isVisible.value) return SizedBox.shrink(); + return Stack( + + children: [ + // پس‌زمینه تیره + Positioned.fill( + child: GestureDetector( + onTap: controller.toggle, + child: Container(color: Colors.black54), + ), + ), + // محتوای BottomSheet + AnimatedPositioned( + duration: Duration(milliseconds: 300), + curve: Curves.easeOut, + left: 0, + right: 0, + bottom: 0, + child: GestureDetector( + onVerticalDragUpdate: (details) => + controller.updateHeight(details.primaryDelta), + child: Container( + height: controller.currentHeight.value, + decoration: BoxDecoration( + color: backgroundColor, + borderRadius: BorderRadius.vertical( + top: Radius.circular(20), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.1), + blurRadius: 10, + ), + ], + ), + child: Column( + children: [ + GestureDetector( + onTap: controller.toggle, + child: Container( + padding: EdgeInsets.all(10), + child: Icon(Icons.drag_handle), + ), + ), + Expanded(child: child ?? SizedBox.shrink()), + ], + ), + ), + ), + ), + ], + ); + + } + + ); + } +} \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart new file mode 100644 index 0000000..8ba0671 --- /dev/null +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import 'draggable_bottom_sheet_controller.dart'; + + +class DraggableBottomSheet2 extends GetView { + final Color? backgroundColor; + + const DraggableBottomSheet2({super.key, this.backgroundColor = Colors.white}); + + @override + Widget build(BuildContext context) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (controller.isVisible.value && !controller.isVisible.value) { + controller.show(); + } + }); + + return ObxValue((data) { + return Stack( + children: [ + Positioned.fill( + child: GestureDetector( + onTap: () {}, + child: Container(color: Colors.black54), + ), + ), + // محتوای BottomSheet + AnimatedPositioned( + duration: Duration(milliseconds: 300), + curve: Curves.easeOut, + left: 0, + right: 0, + bottom: 0, + child: GestureDetector( + onVerticalDragUpdate: (details) { + controller.updateHeight(details.primaryDelta); + }, + child: Container( + height: 350, + decoration: BoxDecoration( + color: backgroundColor, + borderRadius: BorderRadius.vertical(top: Radius.circular(20)), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.1), + blurRadius: 10, + ), + ], + ), + child: Column( + children: [ + GestureDetector( + onTap: () {}, + child: Container( + padding: EdgeInsets.all(10), + child: Icon(Icons.drag_handle), + ), + ), + Expanded( + child: controller.items[data.value], + ), + ], + ), + ), + ), + ), + ], + ); + }, controller.currentIndex); + } +} diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart new file mode 100644 index 0000000..2bf39e1 --- /dev/null +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart @@ -0,0 +1,163 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:rasadyar_core/core.dart'; +import 'draggable_bottom_sheet.dart'; + +/*class DraggableBottomSheetController extends GetxController { + final RxList bottomSheets = + [].obs; + + // Observable variables + final RxBool isVisible = false.obs; + final RxDouble currentHeight = 200.0.obs; + + // Configuration values + final double initialHeight; + final double minHeight; + final double maxHeight; + + DraggableBottomSheetController({ + bool initialVisibility = false, + this.initialHeight = 200, + this.minHeight = 0, + this.maxHeight = 700, + }) { + isVisible.value = initialVisibility; + currentHeight.value = initialHeight; + } + + // Show the bottom sheet + void show() { + if (!isVisible.value) { + isVisible.value = true; + currentHeight.value = initialHeight; + } + } + + // Hide the bottom sheet + void hide() { + if (isVisible.value) { + isVisible.value = false; + } + } + + // Toggle visibility + void toggle() { + isVisible.value = !isVisible.value; + if (isVisible.value) { + currentHeight.value = initialHeight; + } + } + + // Set a specific height for the bottom sheet + void setHeight(double height) { + final clampedHeight = height.clamp(minHeight, maxHeight); + if (currentHeight.value != clampedHeight) { + currentHeight.value = clampedHeight; + } + } + + void updateHeight(double? delta) { + if (delta == null) return; + final newHeight = (currentHeight.value - delta).clamp(minHeight, maxHeight); + + if (newHeight <= minHeight) { + toggle(); + } else { + currentHeight.value = newHeight; + } + } + + // Expand to maximum height + void expandFully() { + currentHeight.value = maxHeight; + isVisible.value = true; + } + + // Collapse to minimum height + void collapse() { + currentHeight.value = minHeight; + } + + void addBottomSheet({ + required Widget child, + required double initHeight, + required double maxHeight, + required double minHeight, + }) { + final controller = DraggableBottomSheetController( + initialVisibility: true, + initialHeight: initHeight, + minHeight: minHeight, + maxHeight: maxHeight, + ); + + final bottomSheet = DraggableBottomSheet( + controller: controller, + backgroundColor: AppColor.lightGreyLightActive, + child: child, + ); + if (bottomSheets.isNotEmpty) { + bottomSheets.removeLast(); + } + + bottomSheets.add(bottomSheet); + } + + void removeLastBottomSheet() { + if (bottomSheets.isNotEmpty) { + bottomSheets.last.controller?.hide(); + Future.delayed(Duration(milliseconds: 200), () { + bottomSheets.removeLast(); + if(bottomSheets.isNotEmpty){ + bottomSheets.last.controller?.show(); + } + + }); + } + } + bool get handleBack{ + if (bottomSheets.isNotEmpty) { + removeLastBottomSheet(); + return true; + } + return false; + } + +}*/ + +class DraggableBottomSheetController extends GetxController { + final RxBool isVisible = false.obs; + final RxDouble currentHeight = 200.0.obs; + RxList items = [].obs; + RxInt currentIndex = 0.obs; + late double initialHeight; + late double minHeight; + late double maxHeight; + + DraggableBottomSheetController({ + this.initialHeight = 200, + this.minHeight = 100, + this.maxHeight = 700, + }) { + currentHeight.value = initialHeight; + } + + void show() => isVisible.value = true; + + void hide() => isVisible.value = false; + + void toggle() => isVisible.value = !isVisible.value; + + void updateHeight(double? delta) { + if (delta == null) return; + final newHeight = (currentHeight.value - delta).clamp(minHeight, maxHeight); + if (newHeight <= minHeight) { + hide(); + } else { + currentHeight.value = newHeight; + } + } + + +} diff --git a/packages/core/lib/presentation/widget/empty_widget.dart b/packages/core/lib/presentation/widget/empty_widget.dart new file mode 100644 index 0000000..f07c421 --- /dev/null +++ b/packages/core/lib/presentation/widget/empty_widget.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class EmptyWidget extends StatelessWidget { + const EmptyWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(), + Assets.vec.emptySvg.svg(width: 170.w,height: 170.h), + Text('داده ای یافت نشد!', style: AppFonts.yekan20.copyWith(color: AppColor.textColor)), + ], + ); + } +} diff --git a/packages/core/lib/presentation/widget/error_widget.dart b/packages/core/lib/presentation/widget/error_widget.dart new file mode 100644 index 0000000..75b657f --- /dev/null +++ b/packages/core/lib/presentation/widget/error_widget.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ErrorWidget extends StatelessWidget { + const ErrorWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(), + Assets.anim.error.lottie(width: 160.w, height: 160.h), + Text( + 'مشکلی پیش آمده\nدوباره تلاش کنید..', + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + ], + ); + } +} diff --git a/packages/core/lib/presentation/widget/inputs/input_fixed_hint.dart b/packages/core/lib/presentation/widget/inputs/input_fixed_hint.dart new file mode 100644 index 0000000..ad4004b --- /dev/null +++ b/packages/core/lib/presentation/widget/inputs/input_fixed_hint.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; + +import '../../common/app_color.dart'; +import '../../common/app_fonts.dart' show AppFonts; + +enum InputType { text, number, email, password } + +class TextFiledFixedHint extends StatefulWidget { + const TextFiledFixedHint({ + super.key, + required this.hintText, + required this.onChanged, + this.inputType = InputType.text, + this.initialValue, + this.controller, + this.keyboardType, + this.textInputAction, + this.enabled, + this.readOnly, + this.maxLines, + this.minLines, + }); + + final String hintText; + final InputType inputType; + + final ValueChanged? onChanged; + final String? initialValue; + final TextEditingController? controller; + final TextInputType? keyboardType; + final TextInputAction? textInputAction; + final bool? enabled; + final bool? readOnly; + final int? maxLines; + final int? minLines; + + @override + State createState() => _TextFiledFixedHintState(); +} + +class _TextFiledFixedHintState extends State { + TextEditingController? tmpController; + + @override + void initState() { + super.initState(); + if (widget.controller == null) { + tmpController = TextEditingController(text: widget.initialValue); + if (widget.initialValue != null) { + tmpController?.text = widget.initialValue!; + } + } else { + tmpController = widget.controller; + } + } + + @override + Widget build(BuildContext context) { + return Container( + height: 40, + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only(top: 3), + child: Text(widget.hintText, style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyNormalActive)), + ), + Expanded( + child: TextField( + controller: tmpController, + keyboardType: widget.inputType == InputType.number ? TextInputType.number : widget.keyboardType, + textInputAction: widget.textInputAction, + onChanged: widget.onChanged, + enabled: widget.enabled, + readOnly: widget.readOnly ?? false, + maxLines: widget.maxLines ?? 1, + minLines: widget.minLines ?? 1, + cursorHeight: 25, + textAlignVertical: TextAlignVertical.top, + obscureText: widget.inputType == InputType.password, + textAlign: widget.inputType == InputType.number ? TextAlign.start : TextAlign.start, + textDirection: widget.inputType == InputType.number ? TextDirection.ltr : TextDirection.rtl, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyNormalActive), + decoration: InputDecoration(border: InputBorder.none), + ), + ), + ], + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/inputs/inputs.dart b/packages/core/lib/presentation/widget/inputs/inputs.dart new file mode 100644 index 0000000..bf7f7ce --- /dev/null +++ b/packages/core/lib/presentation/widget/inputs/inputs.dart @@ -0,0 +1,3 @@ +export 'unit_text_field.dart'; +export 'r_input.dart'; +export 'input_fixed_hint.dart'; diff --git a/packages/core/lib/presentation/widget/inputs/r_input.dart b/packages/core/lib/presentation/widget/inputs/r_input.dart new file mode 100644 index 0000000..81c2ff6 --- /dev/null +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -0,0 +1,262 @@ +import 'dart:async'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_core/core.dart'; + +enum RTextFieldVariant { normal, noBorder, password, passwordNoBorder } + +class RTextField extends StatefulWidget { + final TextEditingController controller; + final String? label; + final String? hintText; + final String? initText; + final bool obscure; + final bool readonly; + final bool enabled; + final int? maxLength; + final int? minLines; + final int? maxLines; + final Widget? suffixIcon; + final Widget? prefixIcon; + final BoxConstraints? boxConstraints; + final RTextFieldVariant variant; + final bool filled; + final Color? filledColor; + final Color? borderColor; + final bool showCounter; + final bool isDense; + final TextInputType? keyboardType; + final TextStyle? style; + final TextStyle? hintStyle; + final TextStyle? labelStyle; + final TextStyle? errorStyle; + final EdgeInsets? padding; + final FormFieldValidator? validator; + final void Function(String)? onChanged; + final void Function(String)? onSubmitted; + final VoidCallback? onTap; + final List? inputFormatters; + final Widget? suffix; + final FocusNode? focusNode; + final AutovalidateMode? autoValidateMode; + final TextAlign? textAlign; + final TextCapitalization textCapitalization; + final Color? cursorColor; + final bool? autocorrect; + final bool? enableSuggestions; + final TextInputAction? textInputAction; + final double? height; + final Iterable? autofillHints; + final InputBorder? focusedBorder; + + const RTextField({ + super.key, + // 🔹 Core + required this.controller, + this.label, + this.hintText, + this.initText, + this.onChanged, + this.onSubmitted, + this.onTap, + this.height, + + // 🔸 Behavior + this.obscure = false, + this.readonly = false, + this.enabled = true, + this.maxLength, + this.minLines, + this.maxLines = 1, + this.textInputAction, + this.keyboardType, + this.focusNode, + this.autofillHints, + + // ⚙️ Input styling + this.textAlign, + this.textCapitalization = TextCapitalization.none, + this.cursorColor, + this.autocorrect, + this.enableSuggestions, + this.style, + this.hintStyle, + this.labelStyle, + this.errorStyle, + this.focusedBorder, + + // 🎨 Decorations + this.suffixIcon, + this.prefixIcon, + this.suffix, + this.boxConstraints, + + // 📐 Layout & appearance + this.borderColor, + this.filled = false, + this.filledColor, + this.padding, + this.variant = RTextFieldVariant.normal, + + // 📋 Form validation + this.validator, + this.autoValidateMode, + this.inputFormatters, + this.showCounter = false, + this.isDense = false, + }); + + @override + State createState() => _RTextFieldState(); + + bool get _isPassword => variant == RTextFieldVariant.password; + + bool get _noBorder => variant == RTextFieldVariant.noBorder; + + bool get _passwordNoBorder => variant == RTextFieldVariant.passwordNoBorder; + + InputBorder get _inputBorder => OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: _noBorder || _passwordNoBorder + ? BorderSide.none + : BorderSide(color: borderColor ?? AppColor.darkGreyLight, width: 1), + ); +} + +class _RTextFieldState extends State { + late bool obscure; + late TextDirection textDirection; + + Timer? _debounceTimer; + + TextDirection _detectDirection(String text) { + final isPersian = RegExp(r'[\u0600-\u06FF]').hasMatch(text); + return isPersian ? TextDirection.rtl : TextDirection.ltr; + } + + void _debouncedUpdateTextDirection() { + if (_debounceTimer?.isActive ?? false) _debounceTimer!.cancel(); + + _debounceTimer = Timer(const Duration(milliseconds: 300), () { + final newDirection = _detectDirection(widget.controller.text); + if (newDirection != textDirection) { + setState(() { + textDirection = newDirection; + }); + } + }); + } + + @override + void initState() { + super.initState(); + if (widget.initText != null) { + widget.controller.text = widget.initText!; + } + obscure = widget.obscure; + + textDirection = _detectDirection( + widget.controller.text.isNotEmpty ? widget.controller.text : widget.initText ?? 'سلام', + ); + + widget.controller.addListener(_debouncedUpdateTextDirection); + } + + @override + void didUpdateWidget(covariant RTextField oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.initText != null && widget.controller.text != widget.initText) { + widget.controller.text = widget.initText!; + } + } + + Widget? _buildSuffixIcon() { + if (widget._isPassword || widget._passwordNoBorder) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: GestureDetector( + onTap: () { + setState(() { + obscure = !obscure; + }); + }, + child: Icon( + obscure ? CupertinoIcons.eye : CupertinoIcons.eye_slash, + color: AppColor.darkGreyDarkActive, + ), + ), + ); + } + return widget.suffixIcon; + } + + @override + Widget build(BuildContext context) { + return SizedBox( + height: widget.height, + child: Padding( + padding: widget.padding ?? EdgeInsets.zero, + child: TextFormField( + controller: widget.controller, + focusNode: widget.focusNode, + textAlign: widget.textAlign ?? TextAlign.start, + readOnly: widget.readonly, + minLines: widget.minLines, + maxLines: widget.maxLines, + onChanged: widget.onChanged, + validator: widget.validator, + inputFormatters: widget.inputFormatters, + enabled: widget.enabled, + obscureText: obscure, + onTap: widget.onTap, + onTapOutside: (_) => FocusScope.of(context).unfocus(), + onFieldSubmitted: widget.onSubmitted, + maxLength: widget.maxLength, + textDirection: textDirection, + style: widget.style, + keyboardType: widget.keyboardType, + autovalidateMode: widget.autoValidateMode ?? AutovalidateMode.disabled, + cursorColor: widget.cursorColor, + textCapitalization: widget.textCapitalization, + autocorrect: widget.autocorrect ?? true, + enableSuggestions: widget.enableSuggestions ?? true, + textInputAction: widget.textInputAction, + autofillHints: widget.autofillHints, + decoration: InputDecoration( + contentPadding: const EdgeInsets.symmetric(horizontal: 16), + errorStyle: widget.errorStyle, + errorMaxLines: 1, + isDense: widget.isDense, + suffix: widget.suffix, + suffixIcon: _buildSuffixIcon(), + suffixIconConstraints: widget.boxConstraints, + prefixIcon: widget.prefixIcon, + prefixIconConstraints: widget.boxConstraints, + hintText: widget.hintText, + labelText: widget.label, + alignLabelWithHint: true, + labelStyle: AppFonts.yekan14 + .copyWith(color: AppColor.lightGreyDarkActive) + .merge(widget.labelStyle), + filled: widget.filled || widget._noBorder || widget._passwordNoBorder, + fillColor: widget.filledColor, + counter: widget.showCounter ? null : const SizedBox(), + hintStyle: widget.hintStyle, + enabledBorder: widget._inputBorder, + focusedBorder: widget.focusedBorder ?? widget._inputBorder, + border: widget._inputBorder, + ), + ), + ), + ); + } + + @override + void dispose() { + _debounceTimer?.cancel(); + widget.controller.removeListener(_debouncedUpdateTextDirection); + super.dispose(); + } +} diff --git a/packages/core/lib/presentation/widget/inputs/unit_text_field.dart b/packages/core/lib/presentation/widget/inputs/unit_text_field.dart new file mode 100644 index 0000000..e1bc585 --- /dev/null +++ b/packages/core/lib/presentation/widget/inputs/unit_text_field.dart @@ -0,0 +1,119 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class UnitTextField extends StatefulWidget { + const UnitTextField({ + super.key, + required this.hint, + required this.unit, + this.onChanged, + this.initialValue, + this.controller, + this.keyboardType, + this.textInputAction, + this.enabled, + this.readOnly, + this.maxLines, + this.minLines, + this.textStyle, + this.textColor, + this.inputFormatters, + this.validator + }); + + final String hint; + final String unit; + final TextStyle? textStyle; + final Color? textColor; + final ValueChanged? onChanged; + final String? initialValue; + final TextEditingController? controller; + final TextInputType? keyboardType; + final TextInputAction? textInputAction; + final List? inputFormatters; + final FormFieldValidator? validator; + final bool? enabled; + final bool? readOnly; + final int? maxLines; + final int? minLines; + + @override + State createState() => _UnitTextFieldState(); +} + +class _UnitTextFieldState extends State { + TextEditingController? tmpController; + + @override + void initState() { + super.initState(); + if (widget.controller == null) { + tmpController = TextEditingController(text: widget.initialValue); + if (widget.initialValue != null) { + tmpController?.text = widget.initialValue!; + } + } else { + tmpController = widget.controller; + } + } + + @override + Widget build(BuildContext context) { + return Container( + height: 40, + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: AppColor.bgLight, + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + widget.hint, + style: + widget.textStyle?.copyWith(color: widget.textColor) ?? + AppFonts.yekan14.copyWith(color: widget.textColor ?? AppColor.textColorLight), + ), + + const SizedBox(width: 8), + + Expanded( + child: TextFormField( + controller: tmpController, + keyboardType: TextInputType.number, + textInputAction: widget.textInputAction, + onChanged: widget.onChanged, + enabled: widget.enabled, + readOnly: widget.readOnly ?? false, + maxLines: 1, + textAlign: TextAlign.center, + textDirection: TextDirection.ltr, + inputFormatters: widget.inputFormatters, + validator: widget.validator, + style: AppFonts.yekan18.copyWith(color: AppColor.darkGreyNormalActive), + decoration: const InputDecoration( + isDense: true, + border: InputBorder.none, + contentPadding: EdgeInsets.symmetric(vertical: 8), + ), + ), + ), + + const SizedBox(width: 8), + + Text( + widget.unit, + style: + widget.textStyle?.copyWith(color: widget.textColor) ?? + AppFonts.yekan14.copyWith(color: widget.textColor ?? AppColor.textColorLight), + ), + ], + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/list_item/list_item.dart b/packages/core/lib/presentation/widget/list_item/list_item.dart new file mode 100644 index 0000000..01a146d --- /dev/null +++ b/packages/core/lib/presentation/widget/list_item/list_item.dart @@ -0,0 +1,127 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ListItem extends StatelessWidget { + const ListItem({ + super.key, + required this.index, + required this.child, + required this.secondChild, + required this.labelColor, + required this.labelIcon, + required this.onTap, + required this.selected, + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final int index; + final Widget child; + final Widget secondChild; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback onTap; + final bool selected; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: AnimatedSize( + duration: Duration(milliseconds: 400), + alignment: Alignment.center, + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.centerRight, + children: [ + AnimatedSize( + duration: Duration(milliseconds: 300), + child: Container( + width: Get.width - 30, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + child: AnimatedCrossFade( + alignment: Alignment.center, + firstChild: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + secondChild: Container( + padding: EdgeInsets.fromLTRB(8, 12, 14, 12), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: secondChild, + ), + crossFadeState: selected + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, + duration: Duration(milliseconds: 300), + ), + ), + Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn), + ), + ), + ), + ], + ), + ), + ), + + Positioned( + right: -12, + child: Container( + width: index < 999 ? 24 : null, + height: index < 999 ? 24 : null, + padding: EdgeInsets.all(2), + decoration: BoxDecoration( + color: AppColor.greenLightHover, + borderRadius: BorderRadius.circular(4), + border: Border.all(width: 0.50, color: AppColor.greenDarkActive), + ), + alignment: Alignment.center, + child: Text( + (index + 1).toString(), + style: AppFonts.yekan12.copyWith(color: Colors.black), + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/list_item/list_item2.dart b/packages/core/lib/presentation/widget/list_item/list_item2.dart new file mode 100644 index 0000000..cd62606 --- /dev/null +++ b/packages/core/lib/presentation/widget/list_item/list_item2.dart @@ -0,0 +1,212 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ExpandableListItem2 extends StatelessWidget { + const ExpandableListItem2({ + super.key, + required this.index, + required this.child, + required this.secondChild, + required this.labelColor, + required this.labelIcon, + required this.onTap, + required this.selected, + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final int index; + final Widget child; + final Widget secondChild; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback onTap; + final bool selected; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: AnimatedSize( + duration: Duration(milliseconds: 400), + alignment: Alignment.center, + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.centerRight, + children: [ + AnimatedCrossFade( + firstChild: Row( + children: [ + Expanded( + child: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + ), + Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + //TODO + colorFilter: ColorFilter.mode( + labelIconColor ?? AppColor.mediumGreyDarkActive, + BlendMode.srcIn, + ), + ), + ), + ), + ], + ), + secondChild: Container( + padding: EdgeInsets.fromLTRB(8, 8, 12, 12), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: secondChild, + ), + crossFadeState: selected ? CrossFadeState.showSecond : CrossFadeState.showFirst, + duration: Duration(milliseconds: 300), + ), + + Positioned( + right: -12, + child: Container( + width: index < 999 ? 24 : null, + height: index < 999 ? 24 : null, + padding: EdgeInsets.all(2), + decoration: BoxDecoration( + color: AppColor.greenLightHover, + borderRadius: BorderRadius.circular(4), + border: Border.all(width: 0.50, color: AppColor.greenDarkActive), + ), + alignment: Alignment.center, + child: Text( + (index + 1).toString(), + style: AppFonts.yekan12.copyWith(color: Colors.black), + ), + ), + ), + ], + ), + ), + ), + ); + } +} + +class ListItem2 extends StatelessWidget { + const ListItem2({ + super.key, + required this.index, + required this.child, + required this.labelColor, + required this.labelIcon, + this.onTap, + + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final int index; + final Widget child; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback? onTap; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.centerRight, + children: [ + Row( + children: [ + Expanded( + child: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + ), + Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + //TODO + colorFilter: ColorFilter.mode( + labelIconColor ?? AppColor.mediumGreyDarkActive, + BlendMode.srcIn, + ), + ), + ), + ), + ], + ), + + Positioned( + right: -12, + child: Container( + width: index < 999 ? 24 : null, + height: index < 999 ? 24 : null, + padding: EdgeInsets.all(2), + decoration: BoxDecoration( + color: AppColor.greenLightHover, + borderRadius: BorderRadius.circular(4), + border: Border.all(width: 0.50, color: AppColor.greenDarkActive), + ), + alignment: Alignment.center, + child: Text( + (index + 1).toString(), + style: AppFonts.yekan12.copyWith(color: Colors.black), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart b/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart new file mode 100644 index 0000000..5e392e0 --- /dev/null +++ b/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ListItemWithOutCounter extends StatelessWidget { + const ListItemWithOutCounter({ + super.key, + required this.child, + required this.secondChild, + required this.labelColor, + required this.labelIcon, + required this.onTap, + required this.selected, + this.labelIconColor = AppColor.mediumGreyDarkHover, + }); + + final Widget child; + final Widget secondChild; + final Color labelColor; + final String labelIcon; + final Color? labelIconColor; + final VoidCallback onTap; + final bool selected; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + decoration: BoxDecoration( + color: labelColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: AnimatedSize( + duration: Duration(milliseconds: 400), + alignment: Alignment.center, + child: AnimatedSize( + duration: Duration(milliseconds: 300), + child: Container( + width: Get.width - 30, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + child: AnimatedCrossFade( + alignment: Alignment.center, + firstChild: Container( + height: 75, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8), + topLeft: Radius.zero, + topRight: Radius.circular(8), + ), + ), + clipBehavior: Clip.antiAlias, + child: child, + ), + secondChild: Container( + padding: EdgeInsets.all(8), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: secondChild, + ), + crossFadeState: selected + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, + duration: Duration(milliseconds: 300), + ), + ), + Visibility( + visible: selected==false, + child: Container( + width: 20, + child: Center( + child: SvgGenImage.vec(labelIcon).svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode(labelColor, BlendMode.srcIn), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} + diff --git a/packages/core/lib/presentation/widget/list_row_item.dart b/packages/core/lib/presentation/widget/list_row_item.dart new file mode 100644 index 0000000..cd6bdaf --- /dev/null +++ b/packages/core/lib/presentation/widget/list_row_item.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +Widget buildRow({ + required String title, + required String value, + TextStyle? titleStyle, + TextStyle? valueStyle, +}) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 2, + child: Text( + title, + textAlign: TextAlign.right, + style: titleStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + Flexible( + flex: 2, + child: Text( + value, + textAlign: TextAlign.left, + style: valueStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + ], + ), + ); +} + +Widget buildRowOnTapped({ + String? title, + String? value, + Widget? titleWidget, + Widget? valueWidget, + TextStyle? titleStyle, + TextStyle? valueStyle, + required VoidCallback onTap, +}) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 2, + child: titleWidget ?? + Text( + title ?? 'N/A', + textAlign: TextAlign.right, + style: titleStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + Flexible( + flex: 2, + child: GestureDetector( + onTap: onTap, + child: valueWidget ?? + Text( + value ?? 'N/A', + textAlign: TextAlign.left, + style: valueStyle ?? AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ), + ), + ], + ), + ); +} diff --git a/packages/core/lib/presentation/widget/list_view/list_view.dart b/packages/core/lib/presentation/widget/list_view/list_view.dart new file mode 100644 index 0000000..5336777 --- /dev/null +++ b/packages/core/lib/presentation/widget/list_view/list_view.dart @@ -0,0 +1,3 @@ + +export 'r_shimmer_list.dart'; +export 'r_paginated_list_view.dart'; diff --git a/packages/core/lib/presentation/widget/list_view/r_list_view.dart b/packages/core/lib/presentation/widget/list_view/r_list_view.dart new file mode 100644 index 0000000..1e62589 --- /dev/null +++ b/packages/core/lib/presentation/widget/list_view/r_list_view.dart @@ -0,0 +1,219 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:rasadyar_core/utils/network/resource.dart'; + +import 'r_shimmer_list.dart'; + +enum ListType { builder, separated } + +class RListView extends StatelessWidget { + final ListType type; + final Axis scrollDirection; + final bool reverse; + final ScrollController? controller; + final bool? primary; + final ScrollPhysics? physics; + final ScrollBehavior? scrollBehavior; + final bool shrinkWrap; + final Key? center; + final double? cacheExtent; + final int? semanticChildCount; + final int itemCount; + final DragStartBehavior dragStartBehavior; + final ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior; + final String? restorationId; + final Clip clipBehavior; + final HitTestBehavior hitTestBehavior; + final Widget? prototypeItem; + final EdgeInsetsGeometry? padding; + final double? itemExtent; + final ItemExtentBuilder? itemExtentBuilder; + final ChildIndexGetter? findChildIndexCallback; + final NullableIndexedWidgetBuilder itemBuilder; + final IndexedWidgetBuilder? separatorBuilder; + final bool addAutomaticKeepAlives; + final bool addRepaintBoundaries; + final bool addSemanticIndexes; + final Widget loadingWidget; + final Widget emptyWidget; + final Widget errorWidget; + final Resource> resource; + final Future Function()? onRefresh; + + const RListView.builder({ + super.key, + this.scrollDirection = Axis.vertical, + this.reverse = false, + this.controller, + this.primary, + this.physics, + this.scrollBehavior, + this.shrinkWrap = false, + this.center, + this.cacheExtent, + this.semanticChildCount, + required this.itemCount, + this.dragStartBehavior = DragStartBehavior.start, + this.keyboardDismissBehavior, + this.restorationId, + this.clipBehavior = Clip.hardEdge, + this.hitTestBehavior = HitTestBehavior.opaque, + this.prototypeItem, + this.padding, + this.itemExtent, + this.itemExtentBuilder, + this.findChildIndexCallback, + required this.itemBuilder, + this.addAutomaticKeepAlives = true, + this.addRepaintBoundaries = true, + this.addSemanticIndexes = true, + this.loadingWidget = const RShimmerList(isSeparated: true), + this.emptyWidget = const Center(child: Text("هیچ آیتمی یافت نشد")), + this.errorWidget = const Center(child: CircularProgressIndicator()), + required this.resource, + this.onRefresh, + }) : type = ListType.builder, + separatorBuilder = null; + + const RListView.separated({ + super.key, + this.scrollDirection = Axis.vertical, + this.reverse = false, + this.controller, + this.primary, + this.physics, + this.scrollBehavior, + this.shrinkWrap = false, + this.center, + this.cacheExtent, + this.semanticChildCount, + required this.itemCount, + this.dragStartBehavior = DragStartBehavior.start, + this.keyboardDismissBehavior, + this.restorationId, + this.clipBehavior = Clip.hardEdge, + this.hitTestBehavior = HitTestBehavior.opaque, + this.prototypeItem, + this.padding, + this.itemExtent, + this.itemExtentBuilder, + this.findChildIndexCallback, + required this.itemBuilder, + required this.separatorBuilder, + this.addAutomaticKeepAlives = true, + this.addRepaintBoundaries = true, + this.addSemanticIndexes = true, + this.loadingWidget = const Center(child: CircularProgressIndicator()), + this.emptyWidget = const Center(child: Text("هیچ آیتمی یافت نشد")), + this.errorWidget = const Center(child: CircularProgressIndicator()), + required this.resource, + this.onRefresh, + }) : type = ListType.separated; + + @override + Widget build(BuildContext context) { + switch (resource.status) { + case ResourceStatus.initial: + case ResourceStatus.loading: + return loadingWidget; + + case ResourceStatus.error: + return errorWidget; + + case ResourceStatus.empty: + return emptyWidget; + + case ResourceStatus.success: + if (resource.data?.isEmpty ?? true) { + return emptyWidget; + } + + final list = type == ListType.builder + ? ListView.builder( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + itemExtent: itemExtent, + itemBuilder: itemBuilder, + itemCount: itemCount, + prototypeItem: prototypeItem, + itemExtentBuilder: itemExtentBuilder, + findChildIndexCallback: findChildIndexCallback, + addAutomaticKeepAlives: addAutomaticKeepAlives, + addRepaintBoundaries: addRepaintBoundaries, + addSemanticIndexes: addSemanticIndexes, + cacheExtent: cacheExtent, + semanticChildCount: semanticChildCount, + dragStartBehavior: dragStartBehavior, + keyboardDismissBehavior: keyboardDismissBehavior, + restorationId: restorationId, + clipBehavior: clipBehavior, + ) + : ListView.separated( + key: key, + scrollDirection: scrollDirection, + reverse: reverse, + controller: controller, + primary: primary, + physics: physics, + shrinkWrap: shrinkWrap, + padding: padding, + itemBuilder: itemBuilder, + separatorBuilder: separatorBuilder!, + itemCount: itemCount, + findChildIndexCallback: findChildIndexCallback, + addAutomaticKeepAlives: addAutomaticKeepAlives, + addRepaintBoundaries: addRepaintBoundaries, + addSemanticIndexes: addSemanticIndexes, + cacheExtent: cacheExtent, + dragStartBehavior: dragStartBehavior, + keyboardDismissBehavior: keyboardDismissBehavior, + restorationId: restorationId, + clipBehavior: clipBehavior, + ); + + return onRefresh != null ? RefreshIndicator(onRefresh: onRefresh!, child: list) : list; + } + } + + RListView._({ + required this.type, + required this.scrollDirection, + required this.reverse, + required this.controller, + required this.primary, + required this.physics, + required this.scrollBehavior, + required this.shrinkWrap, + required this.center, + required this.cacheExtent, + required this.semanticChildCount, + required this.itemCount, + required this.dragStartBehavior, + required this.keyboardDismissBehavior, + required this.restorationId, + required this.clipBehavior, + required this.hitTestBehavior, + required this.prototypeItem, + required this.padding, + required this.itemExtent, + required this.itemExtentBuilder, + required this.findChildIndexCallback, + required this.itemBuilder, + required this.separatorBuilder, + required this.addAutomaticKeepAlives, + required this.addRepaintBoundaries, + required this.addSemanticIndexes, + required this.loadingWidget, + required this.emptyWidget, + required this.errorWidget, + required this.resource, + required this.onRefresh, + }); +} diff --git a/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart b/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart new file mode 100644 index 0000000..4876689 --- /dev/null +++ b/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart @@ -0,0 +1,117 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/data/model/pagination_model/pagination_model.dart'; + +enum ListType { builder, separated } + +class RPaginatedListView extends StatelessWidget { + const RPaginatedListView({ + super.key, + required this.resource, + required this.itemBuilder, + required this.itemCount, + this.separatorBuilder, + this.onRefresh, + required this.onLoadMore, + this.isPaginating = false, + this.hasMore = true, + this.loadingWidget, + this.emptyWidget, + this.errorWidget, + this.scrollController, + this.padding = const EdgeInsets.all(8.0), + this.listType = ListType.builder, + this.physics = const BouncingScrollPhysics(), + }); + + final Resource> resource; + final NullableIndexedWidgetBuilder itemBuilder; + final IndexedWidgetBuilder? separatorBuilder; + final Future Function()? onRefresh; + final Future Function() onLoadMore; + final bool isPaginating; + final bool hasMore; + final int itemCount; + final Widget? loadingWidget; + final Widget? emptyWidget; + final Widget? errorWidget; + final ScrollController? scrollController; + final ListType listType; + final EdgeInsets padding; + final ScrollPhysics physics; + + @override + Widget build(BuildContext context) { + /* if (resource.isLoading) { + return loadingWidget ?? RShimmerList(isSeparated: listType == ListType.separated); + }*/ + + if (resource.isLoading) { + return loadingWidget ?? const LoadingWidget(); + } + + if (resource.isError) { + return errorWidget ?? Center(child: Text(resource.message ?? 'خطا')); + } + + if (resource.isEmpty || resource.data?.results?.isEmpty == true) { + return emptyWidget ?? const EmptyWidget(); + } + + final controller = scrollController ?? ScrollController(); + + return NotificationListener( + onNotification: (ScrollNotification scrollInfo) { + if (!isPaginating && + hasMore && + scrollInfo.metrics.pixels >= scrollInfo.metrics.maxScrollExtent - 100) { + onLoadMore(); + } + return false; + }, + child: RefreshIndicator( + color: AppColor.blueNormal, + onRefresh: onRefresh ?? () async {}, + child: listType == ListType.separated + ? ListView.separated( + padding: padding, + controller: controller, + shrinkWrap: true, + itemCount: itemCount + (isPaginating ? 1 : 0), + itemBuilder: (context, index) { + if (isPaginating && index == itemCount) { + return SizedBox( + height: 50, + child: const Padding( + padding: EdgeInsets.all(16), + child: Center(child: CupertinoActivityIndicator()), + ), + ); + } + return itemBuilder(context, index); + }, + separatorBuilder: separatorBuilder ?? (_, __) => const SizedBox(height: 8), + ) + : ListView.builder( + padding: padding, + controller: controller, + shrinkWrap: true, + itemCount: itemCount + (isPaginating ? 1 : 0), + itemBuilder: (context, index) { + if (isPaginating && index == itemCount) { + return SizedBox( + height: 50, + child: const Padding( + padding: EdgeInsets.all(16), + child: Center(child: CupertinoActivityIndicator()), + ), + ); + } + return itemBuilder(context, index); + }, + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/list_view/r_shimmer_list.dart b/packages/core/lib/presentation/widget/list_view/r_shimmer_list.dart new file mode 100644 index 0000000..c6fd4e9 --- /dev/null +++ b/packages/core/lib/presentation/widget/list_view/r_shimmer_list.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; + +class RShimmerList extends StatelessWidget { + const RShimmerList({super.key, this.itemCount = 6, this.itemBuilder, this.height = 80, this.isSeparated = false}); + + final int itemCount; + final double height; + final bool isSeparated; + final IndexedWidgetBuilder? itemBuilder; + + @override + Widget build(BuildContext context) { + final builder = + itemBuilder ?? + (_, __) => Container( + height: height, + margin: const EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration(color: Colors.grey[300], borderRadius: BorderRadius.circular(8)), + ); + + final children = List.generate(itemCount, (index) => builder(context, index)); + + return Shimmer.fromColors( + baseColor: Colors.grey.shade300, + highlightColor: Colors.grey.shade100, + child: isSeparated + ? ListView.separated( + itemCount: itemCount, + padding: const EdgeInsets.all(12), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: builder, + separatorBuilder: (_, __) => const SizedBox(height: 8), + ) + : ListView.builder( + itemCount: itemCount, + padding: const EdgeInsets.all(12), + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: builder, + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/loading_widget.dart b/packages/core/lib/presentation/widget/loading_widget.dart new file mode 100644 index 0000000..98f4671 --- /dev/null +++ b/packages/core/lib/presentation/widget/loading_widget.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class LoadingWidget extends StatelessWidget { + const LoadingWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Center(child: Assets.anim.loading.lottie( + width: 120.w, + height: 120.h, + )); + } +} diff --git a/packages/core/lib/presentation/widget/logo_widget.dart b/packages/core/lib/presentation/widget/logo_widget.dart new file mode 100644 index 0000000..b8abdb1 --- /dev/null +++ b/packages/core/lib/presentation/widget/logo_widget.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class LogoWidget extends StatelessWidget { + const LogoWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row(), + Assets.images.innerSplash.image( + width: 120.w, + height: 120.h, + ), + Text( + 'سامانه رصدیار', + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyNormal), + ), + ], + ); + } +} diff --git a/packages/core/lib/presentation/widget/map/custom_marker.dart b/packages/core/lib/presentation/widget/map/custom_marker.dart new file mode 100644 index 0000000..d1e5cae --- /dev/null +++ b/packages/core/lib/presentation/widget/map/custom_marker.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; +import 'package:latlong2/latlong.dart'; + +class CustomMarker { + final LatLng point; + final VoidCallback? onTap; +final int? id; + + CustomMarker({ this.id, required this.point, this.onTap}); +} \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/map/logic.dart b/packages/core/lib/presentation/widget/map/logic.dart new file mode 100644 index 0000000..78ab225 --- /dev/null +++ b/packages/core/lib/presentation/widget/map/logic.dart @@ -0,0 +1,170 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_map/flutter_map.dart'; +import 'package:flutter_map_animations/flutter_map_animations.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:get/get.dart'; +import 'package:latlong2/latlong.dart'; +import 'package:rasadyar_core/utils/logger_utils.dart'; + +import 'custom_marker.dart'; + +enum ErrorLocationType { serviceDisabled, permissionDenied, none } + +class MapWidgetLogic extends GetxController with GetTickerProviderStateMixin { + Rx currentLocation = LatLng(35.824891, 50.948025).obs; + String tileType = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'; + + + RxList markers = [].obs; + RxList allMarkers = [].obs; + Rx mapController = MapController().obs; + RxList errorLocationType = RxList(); + late final AnimatedMapController animatedMapController; + Timer? _debounceTimer; + RxBool isLoading = false.obs; + + @override + void onInit() { + super.onInit(); + animatedMapController = AnimatedMapController( + vsync: this, + duration: const Duration(milliseconds: 500), + curve: Curves.easeInOut, + cancelPreviousAnimations: true, + ); + locationServiceEnabled().then((value) { + if (!value) { + errorLocationType.add(ErrorLocationType.serviceDisabled); + } + }); + + checkPermission().then((value) { + if (!value) { + errorLocationType.add(ErrorLocationType.permissionDenied); + } + }); + + listenToLocationServiceStatus().listen((event) { + if (!event) { + errorLocationType.add(ErrorLocationType.serviceDisabled); + } else { + errorLocationType.remove(ErrorLocationType.serviceDisabled); + } + }); + } + + @override + void onReady() { + super.onReady(); + determineCurrentPosition(); + } + + @override + void onClose() { + super.onClose(); + _debounceTimer?.cancel(); + animatedMapController.dispose(); + mapController.close(); + } + + Stream listenToLocationServiceStatus() { + return Geolocator.getServiceStatusStream().map((status) { + return status == ServiceStatus.enabled; + }); + } + + Future locationServiceEnabled() async { + bool serviceEnabled = await Geolocator.isLocationServiceEnabled(); + if (!serviceEnabled) { + return false; + } + return true; + } + + Future checkPermission({bool request = false}) async { + try { + final LocationPermission permission = await Geolocator.checkPermission(); + + switch (permission) { + case LocationPermission.denied: + final LocationPermission requestResult = + await Geolocator.requestPermission(); + return requestResult != LocationPermission.denied && + requestResult != LocationPermission.deniedForever; + + case LocationPermission.deniedForever: + return request ? await Geolocator.openAppSettings() : false; + + case LocationPermission.always: + case LocationPermission.whileInUse: + return true; + + default: + return false; + } + } catch (e) { + eLog(e); + return await Geolocator.openLocationSettings(); + } + } + + Future determineCurrentPosition() async { + final position = await Geolocator.getCurrentPosition( + locationSettings: AndroidSettings(accuracy: LocationAccuracy.best), + ); + final latLng = LatLng(position.latitude, position.longitude); + + currentLocation.value = latLng; + markers.add( + CustomMarker(id: -1, point: latLng, ), + ); + animatedMapController.animateTo( + dest: latLng, + zoom: 18, + curve: Curves.easeInOut, + duration: const Duration(milliseconds: 1500), + ); + } + + void debouncedUpdateVisibleMarkers({required LatLng center}) { + _debounceTimer?.cancel(); + _debounceTimer = Timer(const Duration(milliseconds: 300), () { + final filtered = filterNearbyMarkers({ + 'markers': allMarkers, + 'centerLat': center.latitude, + 'centerLng': center.longitude, + 'radius': 1000.0, + }); + + // markers.addAll(filtered); + }); + } + + List filterNearbyMarkers(Map args) { + final List rawMarkers = args['markers']; + final double centerLat = args['centerLat']; + final double centerLng = args['centerLng']; + final double radiusInMeters = args['radius']; + final center = LatLng(centerLat, centerLng); + final distance = Distance(); + + return rawMarkers + .where((marker) => distance(center, marker) <= radiusInMeters) + .toList(); + } + + void addMarker(CustomMarker marker) { + markers.add(marker); + } + + void setMarkers(List newMarkers) { + markers.value = newMarkers; + } + + void clearMarkers() { + markers.clear(); + } + +} diff --git a/packages/core/lib/presentation/widget/map/view.dart b/packages/core/lib/presentation/widget/map/view.dart new file mode 100644 index 0000000..4204919 --- /dev/null +++ b/packages/core/lib/presentation/widget/map/view.dart @@ -0,0 +1,207 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_map/flutter_map.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:get/get.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; +import 'package:rasadyar_core/presentation/common/assets.gen.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/outline_elevated.dart'; + +import 'logic.dart'; + +class MapWidget extends GetView { + final VoidCallback? initOnTap; + final Widget? initMarkerWidget; + final Widget markerWidget; + + const MapWidget({ + this.initOnTap, + this.initMarkerWidget, + required this.markerWidget, + super.key, + }); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + ObxValue((errorType) { + if (errorType.isNotEmpty) { + if (errorType.contains(ErrorLocationType.serviceDisabled)) { + Future.microtask(() { + Get.defaultDialog( + title: 'خطا', + content: const Text('سرویس مکان‌یابی غیرفعال است'), + cancel: ROutlinedElevated( + text: 'بررسی مجدد', + width: 120, + textStyle: AppFonts.yekan16, + onPressed: () async { + var service = await controller.locationServiceEnabled(); + if (service) { + controller.errorLocationType.remove( + ErrorLocationType.serviceDisabled, + ); + Get.back(); + } + // Don't call Get.back() if service is still disabled + }, + ), + confirm: RElevated( + text: 'روشن کردن', + textStyle: AppFonts.yekan16, + width: 120, + onPressed: () async { + var res = await Geolocator.openLocationSettings(); + if (res) { + var service = await controller.locationServiceEnabled(); + if (service) { + controller.errorLocationType.remove( + ErrorLocationType.serviceDisabled, + ); + Get.back(); + } + } + }, + ), + contentPadding: EdgeInsets.all(8), + onWillPop: () async { + return controller.errorLocationType.isEmpty; + }, + barrierDismissible: false, + ); + }); + } else { + Future.microtask(() { + Get.defaultDialog( + title: 'خطا', + content: const Text(' دسترسی به سرویس مکان‌یابی غیرفعال است'), + cancel: ROutlinedElevated( + text: 'بررسی مجدد', + width: 120, + textStyle: AppFonts.yekan16, + onPressed: () async { + await controller.checkPermission(); + }, + ), + confirm: RElevated( + text: 'اجازه دادن', + textStyle: AppFonts.yekan16, + width: 120, + onPressed: () async { + var res = await controller.checkPermission(request: true); + if (res) { + controller.errorLocationType.remove( + ErrorLocationType.permissionDenied, + ); + Get.back(); + } + }, + ), + + contentPadding: EdgeInsets.all(8), + onWillPop: () async { + return controller.errorLocationType.isEmpty; + }, + barrierDismissible: false, + ); + }); + } + } + return const SizedBox.shrink(); + }, controller.errorLocationType), + _buildMap(), + _buildGpsButton(), + _buildFilterButton(), + ], + ); + } + + Widget _buildMap() { + return ObxValue((currentLocation) { + return FlutterMap( + mapController: controller.animatedMapController.mapController, + options: MapOptions( + initialCenter: currentLocation.value, + initialZoom: 18, + onPositionChanged: (camera, hasGesture) { + if (hasGesture) { + controller.debouncedUpdateVisibleMarkers(center: camera.center); + } + //controller.debouncedUpdateVisibleMarkers(center: camera.center); + }, + ), + children: [ + TileLayer(urlTemplate: controller.tileType), + ObxValue((markers) { + return MarkerLayer( + markers: + markers + .map( + (e) => Marker( + point: e.point, + child: GestureDetector( + onTap: e.id != -1 ? e.onTap : initOnTap, + child: + e.id != -1 + ? markerWidget + : initMarkerWidget ?? SizedBox.shrink(), + ), + ), + ) + .toList(), + ); + }, controller.markers), + ], + ); + }, controller.currentLocation); + } + + Widget _buildGpsButton() { + return Positioned( + right: 10, + bottom: 83, + child: ObxValue((data) { + return RFab.small( + backgroundColor: AppColor.greenNormal, + isLoading: data.value, + icon: Assets.vec.gpsSvg.svg(), + onPressed: () async { + controller.isLoading.value = true; + await controller.determineCurrentPosition(); + controller.isLoading.value = false; + }, + ); + }, controller.isLoading), + ); + } + + Widget _buildFilterButton() { + return Positioned( + right: 10, + bottom: 30, + child: RFab.small( + backgroundColor: AppColor.blueNormal, + icon: Assets.vec.filterSvg.svg(width: 24, height: 24), + onPressed: () {}, + ), + ); + } + + /*Marker markerWidget({required LatLng marker, required VoidCallback onTap}) { + return Marker( + point: marker, + child: GestureDetector( + onTap: onTap, + behavior: HitTestBehavior.opaque, + child: SizedBox( + width: 36, + height: 36, + child: Assets.vec.mapMarkerSvg.svg(width: 30, height: 30), + ), + ), + ); + }*/ +} diff --git a/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart b/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart new file mode 100644 index 0000000..86a7ba1 --- /dev/null +++ b/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart @@ -0,0 +1,362 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; + +class OverlayDropdownWidget extends StatefulWidget { + final List items; + final T? selectedItem; + final T? initialValue; + final int? height; + final Color? background; + final bool? hasDropIcon; + final Widget Function(T item) itemBuilder; + final Widget Function(T? selected) labelBuilder; + final void Function(T selected)? onChanged; + final EdgeInsets? contentPadding; + final bool isDisabled; + const OverlayDropdownWidget({ + super.key, + required this.items, + required this.itemBuilder, + required this.labelBuilder, + this.initialValue, + this.onChanged, + this.selectedItem, + this.contentPadding, + this.height, + this.background, + this.hasDropIcon = true, + this.isDisabled = false, + }); + + @override + State> createState() => _OverlayDropdownState(); +} + +class _OverlayDropdownState extends State> { + final GlobalKey _key = GlobalKey(); + OverlayEntry? _overlayEntry; + final RxBool _isOpen = false.obs; + T? selectedItem; + + @override + void initState() { + super.initState(); + selectedItem = widget.selectedItem ?? widget.initialValue; + } + + + @override + void didUpdateWidget(covariant OverlayDropdownWidget oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.selectedItem != oldWidget.selectedItem) { + setState(() { + selectedItem = widget.selectedItem; + }); + } + } + + void _showOverlay() { + final renderBox = _key.currentContext!.findRenderObject() as RenderBox; + final size = renderBox.size; + final offset = renderBox.localToGlobal(Offset.zero); + + _overlayEntry = OverlayEntry( + builder: (_) => GestureDetector( + onTap: _removeOverlay, + behavior: HitTestBehavior.translucent, + child: Stack( + children: [ + Positioned( + left: offset.dx, + top: offset.dy + size.height + 4, + width: size.width, + child: Material( + elevation: 4, + borderRadius: BorderRadius.circular(8), + child: Container( + decoration: BoxDecoration( + color: AppColor.bgLight, + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + child: Container( + constraints: BoxConstraints(maxHeight: 300), + child: ListView( + padding: EdgeInsets.only(bottom: 50), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + scrollDirection: Axis.vertical, + children: widget.items.map((item) { + return InkWell( + onTap: () { + widget.onChanged?.call(item); + setState(() { + selectedItem = item; + }); + _removeOverlay(); + }, + child: Padding( + padding: + widget.contentPadding ?? + const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: widget.itemBuilder(item), + ), + ); + }).toList(), + ), + ), + ), + ), + ), + ], + ), + ), + ); + + Overlay.of(context).insert(_overlayEntry!); + _isOpen.value = true; + } + + void _removeOverlay() { + _overlayEntry?.remove(); + _overlayEntry = null; + _isOpen.value = false; + } + + @override + void dispose() { + _removeOverlay(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + key: _key, + onTap: widget.isDisabled + ? null + : () { + _isOpen.value ? _removeOverlay() : _showOverlay(); + }, + child: Container( + height: widget.height?.toDouble() ?? 40, + width: Get.width, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: widget.background ?? AppColor.bgLight, + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: widget.labelBuilder(selectedItem)), + Visibility( + visible: widget.hasDropIcon!, + child: Icon( + _isOpen.value ? CupertinoIcons.chevron_up : CupertinoIcons.chevron_down, + size: 14, + ), + ), + ], + ), + ), + ); + } +} + +class OverlayDropdownWidget2 extends StatefulWidget { + final List items; + final T? selectedItem; + final T? initialValue; + final Widget Function(T item) itemBuilder; + final Widget Function(T? selected) labelBuilder; + final void Function(T selected)? onChanged; + final EdgeInsets? contentPadding; + final String Function(T item)? itemToString; + + const OverlayDropdownWidget2({ + super.key, + required this.items, + required this.itemBuilder, + required this.labelBuilder, + this.initialValue, + this.onChanged, + this.selectedItem, + this.contentPadding, + this.itemToString, + }); + + @override + State> createState() => _OverlayDropdownState2(); +} + +class _OverlayDropdownState2 extends State> { + final GlobalKey _key = GlobalKey(); + OverlayEntry? _overlayEntry; + final RxBool _isOpen = false.obs; + T? selectedItem; + + late TextEditingController _searchController; + late RxList _filteredItems; + + @override + void initState() { + super.initState(); + selectedItem = widget.selectedItem ?? widget.initialValue; + _searchController = TextEditingController(); + _filteredItems = RxList(widget.items); + } + + void _showOverlay() { + final renderBox = _key.currentContext!.findRenderObject() as RenderBox; + final size = renderBox.size; + final offset = renderBox.localToGlobal(Offset.zero); + final screenHeight = MediaQuery.of(context).size.height; + + final bool openUp = offset.dy + size.height + 300 > screenHeight; + + _searchController.clear(); + _filteredItems.value = widget.items; + + _overlayEntry = OverlayEntry( + builder: (_) => GestureDetector( + onTap: _removeOverlay, + behavior: HitTestBehavior.translucent, + child: Stack( + children: [ + Positioned( + left: offset.dx, + top: openUp ? offset.dy - 300 - 4 : offset.dy + size.height + 4, + width: size.width, + child: Material( + elevation: 4, + borderRadius: BorderRadius.circular(8), + child: Obx( + () => Container( + decoration: BoxDecoration( + color: AppColor.bgLight, + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + constraints: BoxConstraints(maxHeight: 300), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8), + child: TextField( + controller: _searchController, + decoration: const InputDecoration( + hintText: 'جستجو...', + isDense: true, + contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 8), + border: OutlineInputBorder(), + ), + onChanged: (query) { + _filteredItems.value = widget.items + .where( + (item) => + widget.itemToString + ?.call(item) + .toLowerCase() + .contains(query.toLowerCase()) ?? + false, + ) + .toList(); + }, + ), + ), + if (_filteredItems.isEmpty) + const Padding( + padding: EdgeInsets.all(16.0), + child: Text("نتیجه‌ای یافت نشد."), + ), + if (_filteredItems.isNotEmpty) + Expanded( + child: ListView( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + children: _filteredItems.map((item) { + return InkWell( + onTap: () { + widget.onChanged?.call(item); + setState(() { + selectedItem = item; + }); + _removeOverlay(); + }, + child: Padding( + padding: + widget.contentPadding ?? + const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: widget.itemBuilder(item), + ), + ); + }).toList(), + ), + ), + ], + ), + ), + ), + ), + ), + ], + ), + ), + ); + + Overlay.of(context).insert(_overlayEntry!); + _isOpen.value = true; + } + + void _removeOverlay() { + _overlayEntry?.remove(); + _overlayEntry = null; + _isOpen.value = false; + } + + @override + void dispose() { + _removeOverlay(); + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return IgnorePointer( + ignoring: widget.items.isEmpty, + child: GestureDetector( + key: _key, + onTap: () { + _isOpen.value ? _removeOverlay() : _showOverlay(); + }, + child: Container( + height: 40, + width: Get.width, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: widget.items.isEmpty ? Colors.grey.shade200 : AppColor.bgLight, + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + child: Obx( + () => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: widget.labelBuilder(selectedItem)), + Icon( + _isOpen.value ? CupertinoIcons.chevron_up : CupertinoIcons.chevron_down, + size: 14, + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart b/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart new file mode 100644 index 0000000..63c1ac0 --- /dev/null +++ b/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart @@ -0,0 +1,255 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class PaginationFromUntil extends StatefulWidget { + const PaginationFromUntil({super.key}); + + @override + State createState() => _PaginationFromUntilState(); +} + +class _PaginationFromUntilState extends State { + int current = 1; + int total = 10; + + @override + Widget build(BuildContext context) { + return Container( + width: 164, + height: 47, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: const Color(0xFFEAEFFF), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)), + ), + child: Row( + children: [ + FloatingActionButton.small( + onPressed: () { + if(current>1){ + setState(() { + current--; + }); + } + + }, + shape: CircleBorder(), + elevation: 0, + backgroundColor: Colors.white, + child: Icon(CupertinoIcons.arrow_left, color: AppColor.blueNormal), + ), + Expanded( + child: Text( + '$current از $total', + textAlign: TextAlign.center, + textDirection: TextDirection.rtl, + style: AppFonts.yekan16.copyWith( + color: AppColor.blueNormal, + ), + ), + ), + FloatingActionButton.small( + + onPressed:() { + if (current < total) { + setState(() { + current++; + }); + } + }, + shape: CircleBorder(), + elevation: 0, + backgroundColor: AppColor.blueNormal, + child: Icon(CupertinoIcons.arrow_right, color: Colors.white), + ), + ], + ), + ); + } + + Stack buildStack() { + return Stack( + children: [ + Positioned( + left: 4, + top: 4, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 40, + top: 40, + child: Container( + transform: + Matrix4.identity() + ..translate(0.0, 0.0) + ..rotateZ(-3.14), + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: + Colors.white /* Secondary */, + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + color: + Colors + .white /* Secondary */, + ), + borderRadius: + BorderRadius.circular(50), + ), + ), + child: Stack(), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + Positioned( + left: 8, + top: 8, + child: Container(width: 24, height: 24, child: Stack()), + ), + ], + ), + ), + ), + Positioned( + left: 120, + top: 3, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 40, + top: 40, + child: Container( + transform: + Matrix4.identity() + ..translate(0.0, 0.0) + ..rotateZ(-3.14), + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: 40, + height: 40, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: const Color( + 0xFF2D5FFF, + ) /* Primary */, + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + color: const Color( + 0xFF2D5FFF, + ) /* Primary */, + ), + borderRadius: + BorderRadius.circular(50), + ), + ), + child: Stack(), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + Positioned( + left: 8, + top: 8, + child: Container(width: 24, height: 24, child: Stack()), + ), + ], + ), + ), + ), + Positioned( + left: 63, + top: 9, + child: Text( + '1 از 17', + style: TextStyle( + color: const Color(0xFF2D5FFF) /* Primary */, + fontSize: 16, + fontFamily: 'IRANYekanFN', + fontWeight: FontWeight.w400, + height: 1.75, + ), + ), + ), + ], + ); + } +} diff --git a/packages/core/lib/presentation/widget/pagination/show_more.dart b/packages/core/lib/presentation/widget/pagination/show_more.dart new file mode 100644 index 0000000..757e952 --- /dev/null +++ b/packages/core/lib/presentation/widget/pagination/show_more.dart @@ -0,0 +1,78 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +class RShowMore extends StatefulWidget { + const RShowMore({super.key}); + + @override + State createState() => _RShowMoreState(); +} + +class _RShowMoreState extends State + with SingleTickerProviderStateMixin { + bool _toggled = false; + late final AnimationController _controller; + late final Animation _iconRotation; + + @override + void initState() { + super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 500), + ); + _iconRotation = Tween( + begin: 0, + end: 0.50, + ) // 90 degrees (quarter turn) + .animate(CurvedAnimation(parent: _controller, curve: Curves.easeInOut)); + } + + void _toggle() { + setState(() => _toggled = !_toggled); + _toggled ? _controller.forward() : _controller.reverse(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: _toggle, + behavior: HitTestBehavior.opaque, + child: Row( + mainAxisSize: MainAxisSize.min, + spacing: 8, + children: [ + RotationTransition( + turns: _iconRotation, + child: const Icon(CupertinoIcons.chevron_down, size: 12,color:AppColor.blueNormal ,), + ), + + AnimatedSwitcher( + duration: const Duration(milliseconds: 500), + transitionBuilder: + (child, animation) => + FadeTransition(opacity: animation, child: child), + child: Text( + _toggled ? 'کمتر' : 'مشاهده بیشتر', + key: ValueKey(_toggled), + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + ), + SizedBox(height: 50,) + ], + + + + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/tabs/new_tab.dart b/packages/core/lib/presentation/widget/tabs/new_tab.dart new file mode 100644 index 0000000..308ebb2 --- /dev/null +++ b/packages/core/lib/presentation/widget/tabs/new_tab.dart @@ -0,0 +1,765 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// @docImport 'switch.dart'; +library; + +import 'dart:collection'; +import 'dart:math' as math; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/rendering.dart'; + +// Minimum padding from edges of the segmented control to edges of +// encompassing widget. +const EdgeInsetsGeometry _kHorizontalItemPadding = EdgeInsets.symmetric(horizontal: 16.0); + +// Minimum height of the segmented control. +const double _kMinSegmentedControlHeight = 28.0; + +// The default color used for the text of the disabled segment. +const Color _kDisableTextColor = Color.fromARGB(115, 122, 122, 122); + +// The duration of the fade animation used to transition when a new widget +// is selected. +const Duration _kFadeDuration = Duration(milliseconds: 165); + +class NewCupertinoSegmentedControl extends StatefulWidget { + /// Creates an iOS-style segmented control bar. + /// + /// The [children] argument must be an ordered [Map] such as a + /// [LinkedHashMap]. Further, the length of the [children] list must be + /// greater than one. + /// + /// Each widget value in the map of [children] must have an associated key + /// that uniquely identifies this widget. This key is what will be returned + /// in the [onValueChanged] callback when a new value from the [children] map + /// is selected. + /// + /// The [groupValue] is the currently selected value for the segmented control. + /// If no [groupValue] is provided, or the [groupValue] is null, no widget will + /// appear as selected. The [groupValue] must be either null or one of the keys + /// in the [children] map. + NewCupertinoSegmentedControl({ + super.key, + required this.children, + required this.onValueChanged, + this.groupValue, + this.unselectedColor, + this.selectedColor, + this.borderColor, + this.selectedBorderColor, + this.pressedColor, + this.disabledColor, + this.disabledTextColor, + this.padding, + this.unselectedItemStyle, + this.selectedItemStyle, + this.disabledChildren = const {}, + }) : assert(children.length >= 2), + assert( + groupValue == null || children.keys.any((T child) => child == groupValue), + 'The groupValue must be either null or one of the keys in the children map.', + ); + + /// The identifying keys and corresponding widget values in the + /// segmented control. + /// + /// The map must have more than one entry. + /// This attribute must be an ordered [Map] such as a [LinkedHashMap]. + final Map children; + + /// The identifier of the widget that is currently selected. + /// + /// This must be one of the keys in the [Map] of [children]. + /// If this attribute is null, no widget will be initially selected. + final T? groupValue; + + /// The callback that is called when a new option is tapped. + /// + /// The segmented control passes the newly selected widget's associated key + /// to the callback but does not actually change state until the parent + /// widget rebuilds the segmented control with the new [groupValue]. + final ValueChanged onValueChanged; + + /// The color used to fill the backgrounds of unselected widgets and as the + /// text color of the selected widget. + /// + /// Defaults to [CupertinoTheme]'s `primaryContrastingColor` if null. + final Color? unselectedColor; + + /// The color used to fill the background of the selected widget and as the text + /// color of unselected widgets. + /// + /// Defaults to [CupertinoTheme]'s `primaryColor` if null. + final Color? selectedColor; + + /// The color used as the border around each widget. + /// + /// Defaults to [CupertinoTheme]'s `primaryColor` if null. + final Color? borderColor; + + /// The color used as the border around selected widget. + /// + /// Defaults to [CupertinoTheme]'s `primaryColor` if null. + final Color? selectedBorderColor; + + /// The color used to fill the background of the widget the user is + /// temporarily interacting with through a long press or drag. + /// + /// Defaults to the selectedColor at 20% opacity if null. + final Color? pressedColor; + + /// The color used to fill the background of the segment when it is disabled. + /// + /// If null, this color will be 50% opacity of the [selectedColor] when + /// the segment is selected. If the segment is unselected, this color will be + /// set to [unselectedColor]. + final Color? disabledColor; + + /// The color used for the text of the segment when it is disabled. + final Color? disabledTextColor; + + /// The CupertinoSegmentedControl will be placed inside this padding. + /// + /// Defaults to EdgeInsets.symmetric(horizontal: 16.0) + final EdgeInsetsGeometry? padding; + + /// The set of identifying keys that correspond to the segments that should be disabled. + /// + /// All segments are enabled by default. + final Set disabledChildren; + + /// The text style for unselected items. + /// + /// Defaults to null, which means it will use the default text style. + final TextStyle? unselectedItemStyle; + + /// The text style for selected items. + /// + /// Defaults to null, which means it will use the default text style. + final TextStyle? selectedItemStyle; + + @override + State> createState() => _SegmentedControlState(); +} + +class _SegmentedControlState extends State> + with TickerProviderStateMixin> { + T? _pressedKey; + + final List _selectionControllers = []; + final List _childTweens = []; + + late ColorTween _forwardBackgroundColorTween; + late ColorTween _reverseBackgroundColorTween; + late ColorTween _textColorTween; + + Color? _selectedColor; + Color? _unselectedColor; + Color? _borderColor; + Color? _selectedBorderColor; + Color? _pressedColor; + Color? _selectedDisabledColor; + Color? _unselectedDisabledColor; + Color? _disabledTextColor; + + AnimationController createAnimationController() { + return AnimationController(duration: _kFadeDuration, vsync: this)..addListener(() { + setState(() { + // State of background/text colors has changed + }); + }); + } + + bool _updateColors() { + assert(mounted, 'This should only be called after didUpdateDependencies'); + bool changed = false; + final Color disabledTextColor = widget.disabledTextColor ?? _kDisableTextColor; + if (_disabledTextColor != disabledTextColor) { + changed = true; + _disabledTextColor = disabledTextColor; + } + final Color selectedColor = widget.selectedColor ?? CupertinoTheme.of(context).primaryColor; + if (_selectedColor != selectedColor) { + changed = true; + _selectedColor = selectedColor; + } + final Color unselectedColor = + widget.unselectedColor ?? CupertinoTheme.of(context).primaryContrastingColor; + if (_unselectedColor != unselectedColor) { + changed = true; + _unselectedColor = unselectedColor; + } + final Color selectedDisabledColor = widget.disabledColor ?? selectedColor.withOpacity(0.5); + final Color unselectedDisabledColor = widget.disabledColor ?? unselectedColor; + if (_selectedDisabledColor != selectedDisabledColor || + _unselectedDisabledColor != unselectedDisabledColor) { + changed = true; + _selectedDisabledColor = selectedDisabledColor; + _unselectedDisabledColor = unselectedDisabledColor; + } + final Color borderColor = widget.borderColor ?? CupertinoTheme.of(context).primaryColor; + final Color selectedBorderColor = widget.selectedBorderColor ?? CupertinoTheme.of(context).primaryColor; + if (_borderColor != borderColor) { + changed = true; + _borderColor = borderColor; + } + if (_selectedBorderColor != selectedBorderColor) { + changed = true; + _selectedBorderColor = selectedBorderColor; + } + final Color pressedColor = + widget.pressedColor ?? CupertinoTheme.of(context).primaryColor.withOpacity(0.2); + if (_pressedColor != pressedColor) { + changed = true; + _pressedColor = pressedColor; + } + + _forwardBackgroundColorTween = ColorTween(begin: _pressedColor, end: _selectedColor); + _reverseBackgroundColorTween = ColorTween(begin: _unselectedColor, end: _selectedColor); + _textColorTween = ColorTween(begin: _selectedColor, end: _unselectedColor); + return changed; + } + + void _updateAnimationControllers() { + assert(mounted, 'This should only be called after didUpdateDependencies'); + for (final AnimationController controller in _selectionControllers) { + controller.dispose(); + } + _selectionControllers.clear(); + _childTweens.clear(); + + for (final T key in widget.children.keys) { + final AnimationController animationController = createAnimationController(); + if (widget.groupValue == key) { + _childTweens.add(_reverseBackgroundColorTween); + animationController.value = 1.0; + } else { + _childTweens.add(_forwardBackgroundColorTween); + } + _selectionControllers.add(animationController); + } + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + if (_updateColors()) { + _updateAnimationControllers(); + } + } + + @override + void didUpdateWidget(NewCupertinoSegmentedControl oldWidget) { + super.didUpdateWidget(oldWidget); + + if (_updateColors() || oldWidget.children.length != widget.children.length) { + _updateAnimationControllers(); + } + + if (oldWidget.groupValue != widget.groupValue) { + int index = 0; + for (final T key in widget.children.keys) { + if (widget.groupValue == key) { + _childTweens[index] = _forwardBackgroundColorTween; + _selectionControllers[index].forward(); + } else { + _childTweens[index] = _reverseBackgroundColorTween; + _selectionControllers[index].reverse(); + } + index += 1; + } + } + } + + @override + void dispose() { + for (final AnimationController animationController in _selectionControllers) { + animationController.dispose(); + } + super.dispose(); + } + + void _onTapDown(T currentKey) { + if (_pressedKey == null && currentKey != widget.groupValue) { + setState(() { + _pressedKey = currentKey; + }); + } + } + + void _onTapCancel() { + setState(() { + _pressedKey = null; + }); + } + + void _onTap(T currentKey) { + if (currentKey != _pressedKey) { + return; + } + if (!widget.disabledChildren.contains(currentKey)) { + if (currentKey != widget.groupValue) { + widget.onValueChanged(currentKey); + } + } + _pressedKey = null; + } + + Color? getTextColor(int index, T currentKey) { + if (widget.disabledChildren.contains(currentKey)) { + return _disabledTextColor; + } + if (_selectionControllers[index].isAnimating) { + return _textColorTween.evaluate(_selectionControllers[index]); + } + if (widget.groupValue == currentKey) { + return _unselectedColor; + } + return _selectedColor; + } + + Color? getBackgroundColor(int index, T currentKey) { + if (widget.disabledChildren.contains(currentKey)) { + return widget.groupValue == currentKey ? _selectedDisabledColor : _unselectedDisabledColor; + } + if (_selectionControllers[index].isAnimating) { + return _childTweens[index].evaluate(_selectionControllers[index]); + } + if (widget.groupValue == currentKey) { + return _selectedColor; + } + if (_pressedKey == currentKey) { + return _pressedColor; + } + return _unselectedColor; + } + + @override + Widget build(BuildContext context) { + final List gestureChildren = []; + final List backgroundColors = []; + int index = 0; + int? selectedIndex; + int? pressedIndex; + for (final T currentKey in widget.children.keys) { + selectedIndex = (widget.groupValue == currentKey) ? index : selectedIndex; + pressedIndex = (_pressedKey == currentKey) ? index : pressedIndex; + final isSelected = widget.groupValue == currentKey; + + final textStyle = + (isSelected ? widget.selectedItemStyle : widget.unselectedItemStyle) ?? + DefaultTextStyle.of(context).style.copyWith(color: getTextColor(index, currentKey)); + final IconThemeData iconTheme = IconThemeData(color: getTextColor(index, currentKey)); + + Widget child = Center(child: widget.children[currentKey]); + + child = MouseRegion( + cursor: kIsWeb ? SystemMouseCursors.click : MouseCursor.defer, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTapDown: widget.disabledChildren.contains(currentKey) + ? null + : (TapDownDetails event) { + _onTapDown(currentKey); + }, + onTapCancel: widget.disabledChildren.contains(currentKey) ? null : _onTapCancel, + onTap: () { + _onTap(currentKey); + }, + child: IconTheme( + data: iconTheme, + child: DefaultTextStyle( + style: textStyle, + child: Semantics( + button: true, + inMutuallyExclusiveGroup: true, + selected: widget.groupValue == currentKey, + child: child, + ), + ), + ), + ), + ); + + backgroundColors.add(getBackgroundColor(index, currentKey)!); + gestureChildren.add(child); + index += 1; + } + + final Widget box = _SegmentedControlRenderWidget( + selectedIndex: selectedIndex, + pressedIndex: pressedIndex, + backgroundColors: backgroundColors, + borderColor: _borderColor!, + selectBorderColor: _selectedBorderColor ?? _borderColor!, + children: gestureChildren, + ); + + return Padding( + padding: widget.padding ?? _kHorizontalItemPadding, + child: UnconstrainedBox(constrainedAxis: Axis.horizontal, child: box), + ); + } +} + +class _SegmentedControlRenderWidget extends MultiChildRenderObjectWidget { + const _SegmentedControlRenderWidget({ + super.key, + super.children, + required this.selectedIndex, + required this.pressedIndex, + required this.backgroundColors, + required this.borderColor, + required this.selectBorderColor, + }); + + final int? selectedIndex; + final int? pressedIndex; + final List backgroundColors; + final Color borderColor; + final Color selectBorderColor; + + @override + RenderObject createRenderObject(BuildContext context) { + return _RenderSegmentedControl( + textDirection: Directionality.of(context), + selectedIndex: selectedIndex, + pressedIndex: pressedIndex, + backgroundColors: backgroundColors, + borderColor: borderColor, + selectBorderColor: selectBorderColor, + ); + } + + @override + void updateRenderObject(BuildContext context, _RenderSegmentedControl renderObject) { + renderObject + ..textDirection = Directionality.of(context) + ..selectedIndex = selectedIndex + ..pressedIndex = pressedIndex + ..backgroundColors = backgroundColors + ..borderColor = borderColor + ..selectedItemBorderColor = selectBorderColor; + } +} + +class _SegmentedControlContainerBoxParentData extends ContainerBoxParentData { + RRect? surroundingRect; +} + +typedef _NextChild = RenderBox? Function(RenderBox child); + +class _RenderSegmentedControl extends RenderBox + with + ContainerRenderObjectMixin>, + RenderBoxContainerDefaultsMixin> { + _RenderSegmentedControl({ + required int? selectedIndex, + required int? pressedIndex, + required TextDirection textDirection, + required List backgroundColors, + required Color borderColor, + required Color selectBorderColor, + }) : _textDirection = textDirection, + _selectedIndex = selectedIndex, + _pressedIndex = pressedIndex, + _backgroundColors = backgroundColors, + _selectedBorderColor = selectBorderColor, + _borderColor = borderColor; + + int? get selectedIndex => _selectedIndex; + int? _selectedIndex; + + set selectedIndex(int? value) { + if (_selectedIndex == value) { + return; + } + _selectedIndex = value; + markNeedsPaint(); + } + + int? get pressedIndex => _pressedIndex; + int? _pressedIndex; + + set pressedIndex(int? value) { + if (_pressedIndex == value) { + return; + } + _pressedIndex = value; + markNeedsPaint(); + } + + TextDirection get textDirection => _textDirection; + TextDirection _textDirection; + + set textDirection(TextDirection value) { + if (_textDirection == value) { + return; + } + _textDirection = value; + markNeedsLayout(); + } + + List get backgroundColors => _backgroundColors; + List _backgroundColors; + + set backgroundColors(List value) { + if (_backgroundColors == value) { + return; + } + _backgroundColors = value; + markNeedsPaint(); + } + + Color get borderColor => _borderColor; + Color _borderColor; + + set borderColor(Color value) { + if (_borderColor == value) { + return; + } + _borderColor = value; + markNeedsPaint(); + } + + Color? _selectedBorderColor; + + Color? get selectedItemBorderColor => _selectedBorderColor; + + set selectedItemBorderColor(Color? value) { + if (_selectedBorderColor == value) return; + _selectedBorderColor = value; + markNeedsPaint(); + } + + @override + double computeMinIntrinsicWidth(double height) { + RenderBox? child = firstChild; + double minWidth = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childWidth = child.getMinIntrinsicWidth(height); + minWidth = math.max(minWidth, childWidth); + child = childParentData.nextSibling; + } + return minWidth * childCount; + } + + @override + double computeMaxIntrinsicWidth(double height) { + RenderBox? child = firstChild; + double maxWidth = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childWidth = child.getMaxIntrinsicWidth(height); + maxWidth = math.max(maxWidth, childWidth); + child = childParentData.nextSibling; + } + return maxWidth * childCount; + } + + @override + double computeMinIntrinsicHeight(double width) { + RenderBox? child = firstChild; + double minHeight = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childHeight = child.getMinIntrinsicHeight(width); + minHeight = math.max(minHeight, childHeight); + child = childParentData.nextSibling; + } + return minHeight; + } + + @override + double computeMaxIntrinsicHeight(double width) { + RenderBox? child = firstChild; + double maxHeight = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final double childHeight = child.getMaxIntrinsicHeight(width); + maxHeight = math.max(maxHeight, childHeight); + child = childParentData.nextSibling; + } + return maxHeight; + } + + @override + double? computeDistanceToActualBaseline(TextBaseline baseline) { + return defaultComputeDistanceToHighestActualBaseline(baseline); + } + + @override + void setupParentData(RenderBox child) { + if (child.parentData is! _SegmentedControlContainerBoxParentData) { + child.parentData = _SegmentedControlContainerBoxParentData(); + } + } + + void _layoutRects(_NextChild nextChild, RenderBox? leftChild, RenderBox? rightChild) { + RenderBox? child = leftChild; + double start = 0.0; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final Offset childOffset = Offset(start, 0.0); + childParentData.offset = childOffset; + final Rect childRect = Rect.fromLTWH(start, 0.0, child.size.width, child.size.height); + final RRect rChildRect; + if (child == leftChild) { + rChildRect = RRect.fromRectAndCorners( + childRect, + topLeft: const Radius.circular(10.0), + bottomLeft: const Radius.circular(10.0), + ); + } else if (child == rightChild) { + rChildRect = RRect.fromRectAndCorners( + childRect, + topRight: const Radius.circular(10.0), + bottomRight: const Radius.circular(10.0), + ); + } else { + rChildRect = RRect.fromRectAndCorners(childRect); + } + childParentData.surroundingRect = rChildRect; + start += child.size.width; + child = nextChild(child); + } + } + + Size _calculateChildSize(BoxConstraints constraints) { + double maxHeight = _kMinSegmentedControlHeight; + double childWidth = constraints.minWidth / childCount; + RenderBox? child = firstChild; + while (child != null) { + childWidth = math.max(childWidth, child.getMaxIntrinsicWidth(double.infinity)); + child = childAfter(child); + } + childWidth = math.min(childWidth, constraints.maxWidth / childCount); + child = firstChild; + while (child != null) { + final double boxHeight = child.getMaxIntrinsicHeight(childWidth); + maxHeight = math.max(maxHeight, boxHeight); + child = childAfter(child); + } + return Size(childWidth, maxHeight); + } + + Size _computeOverallSizeFromChildSize(Size childSize) { + return constraints.constrain(Size(childSize.width * childCount, childSize.height)); + } + + @override + double? computeDryBaseline(covariant BoxConstraints constraints, TextBaseline baseline) { + final Size childSize = _calculateChildSize(constraints); + final BoxConstraints childConstraints = BoxConstraints.tight(childSize); + + BaselineOffset baselineOffset = BaselineOffset.noBaseline; + for (RenderBox? child = firstChild; child != null; child = childAfter(child)) { + baselineOffset = baselineOffset.minOf( + BaselineOffset(child.getDryBaseline(childConstraints, baseline)), + ); + } + return baselineOffset.offset; + } + + @override + Size computeDryLayout(BoxConstraints constraints) { + final Size childSize = _calculateChildSize(constraints); + return _computeOverallSizeFromChildSize(childSize); + } + + @override + void performLayout() { + final BoxConstraints constraints = this.constraints; + final Size childSize = _calculateChildSize(constraints); + + final BoxConstraints childConstraints = BoxConstraints.tightFor( + width: childSize.width, + height: childSize.height, + ); + + RenderBox? child = firstChild; + while (child != null) { + child.layout(childConstraints, parentUsesSize: true); + child = childAfter(child); + } + + switch (textDirection) { + case TextDirection.rtl: + _layoutRects(childBefore, lastChild, firstChild); + case TextDirection.ltr: + _layoutRects(childAfter, firstChild, lastChild); + } + + size = _computeOverallSizeFromChildSize(childSize); + } + + @override + void paint(PaintingContext context, Offset offset) { + RenderBox? child = firstChild; + int index = 0; + while (child != null) { + _paintChild(context, offset, child, index); + child = childAfter(child); + index += 1; + } + } + + void _paintChild(PaintingContext context, Offset offset, RenderBox child, int childIndex) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + final RRect rect = childParentData.surroundingRect!.shift(offset); + + context.canvas.drawRRect( + rect, + Paint() + ..color = backgroundColors[childIndex] + ..style = PaintingStyle.fill, + ); + + + final isSelected = selectedIndex == childIndex; + final borderPaint = Paint() + ..color = isSelected && selectedItemBorderColor != null + ? selectedItemBorderColor! + : borderColor + ..strokeWidth = 1.0 + ..style = PaintingStyle.stroke; + + context.canvas.drawRRect(rect, borderPaint); + + + context.paintChild(child, childParentData.offset + offset); + } + + @override + bool hitTestChildren(BoxHitTestResult result, {required Offset position}) { + RenderBox? child = lastChild; + while (child != null) { + final _SegmentedControlContainerBoxParentData childParentData = + child.parentData! as _SegmentedControlContainerBoxParentData; + if (childParentData.surroundingRect!.contains(position)) { + return result.addWithPaintOffset( + offset: childParentData.offset, + position: position, + hitTest: (BoxHitTestResult result, Offset localOffset) { + assert(localOffset == position - childParentData.offset); + return child!.hitTest(result, position: localOffset); + }, + ); + } + child = childParentData.previousSibling; + } + return false; + } +} diff --git a/packages/core/lib/presentation/widget/tabs/r_segment.dart b/packages/core/lib/presentation/widget/tabs/r_segment.dart new file mode 100644 index 0000000..bdca712 --- /dev/null +++ b/packages/core/lib/presentation/widget/tabs/r_segment.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +const Duration _kFadeDuration = Duration(milliseconds: 165); + +class RSegment extends StatefulWidget { + const RSegment({ + super.key, + required this.children, + required this.selectedIndex, + required this.onSegmentSelected, + required this.backgroundColor, + required this.selectedBackgroundColor, + required this.borderColor, + required this.selectedBorderColor, + this.padding, + }); + + final List children; + final int selectedIndex; + final Function(int index)? onSegmentSelected; + final EdgeInsetsGeometry? padding; + final Color backgroundColor; + final Color borderColor; + final Color selectedBackgroundColor; + final Color selectedBorderColor; + + @override + State createState() => _RSegmentState(); +} + +class _RSegmentState extends State { + late int selectedIndex; + + @override + void initState() { + super.initState(); + selectedIndex = widget.selectedIndex; + } + + @override + void didUpdateWidget(covariant RSegment oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.selectedIndex != widget.selectedIndex) { + widget.onSegmentSelected?.call(widget.selectedIndex); + } + } + + @override + Widget build(BuildContext context) { + return Row( + children: List.generate( + widget.children.length, + (index) => Expanded( + child: _generateChild( + index: index, + hasNext: widget.children.length > index + 1, + hasPrevious: index > 0, + ), + ), + ), + ); + } + + Widget _generateChild({required int index, required bool hasNext, required bool hasPrevious}) { + final bool isSelected = selectedIndex == index; + + return GestureDetector( + onTap: () { + setState(() { + selectedIndex = index; + }); + widget.onSegmentSelected?.call(index); + }, + child: AnimatedContainer( + duration: _kFadeDuration, + padding: widget.padding??EdgeInsets.symmetric(vertical: 8), + margin: EdgeInsets.zero, + decoration: BoxDecoration( + color: isSelected ? widget.selectedBackgroundColor : widget.backgroundColor, + borderRadius: BorderRadius.only( + topRight: !hasPrevious && hasNext ? Radius.circular(8) : Radius.zero, + bottomRight: !hasPrevious && hasNext ? Radius.circular(8) : Radius.zero, + bottomLeft: hasPrevious && !hasNext ? Radius.circular(8) : Radius.zero, + topLeft: hasPrevious && !hasNext ? Radius.circular(8) : Radius.zero, + ), + border: Border.all( + width: 1, + color: isSelected ? widget.selectedBorderColor : widget.borderColor, + ), + ), + child: Center( + child: Text( + widget.children[index], + textAlign: TextAlign.center, + style: isSelected + ? AppFonts.yekan16Bold.copyWith(color: widget.selectedBorderColor) + : AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkHover), + ), + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/tabs/tab.dart b/packages/core/lib/presentation/widget/tabs/tab.dart new file mode 100644 index 0000000..fc90a70 --- /dev/null +++ b/packages/core/lib/presentation/widget/tabs/tab.dart @@ -0,0 +1,115 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/common/app_fonts.dart'; + +import 'new_tab.dart'; + +class CupertinoSegmentedControlDemo extends StatefulWidget { + const CupertinoSegmentedControlDemo({super.key}); + + @override + State createState() => + _CupertinoSegmentedControlDemoState(); +} + +class _CupertinoSegmentedControlDemoState + extends State { + int _selectedSegment = 0; + + // The data for the segments + final Map _segments = const { + 0: Text('Segment 1'), + 1: Text('Segment 2'), + 2: Text('Segment 3'), + }; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CupertinoSlidingSegmentedControl( + children: _segments, + groupValue: _selectedSegment, + + onValueChanged: (int? value) { + setState(() { + _selectedSegment = value!; + }); + }, + ), + const SizedBox(height: 20), + Text( + 'Selected Segment: ${_selectedSegment + 1}', + style: const TextStyle(fontSize: 24), + ), + ], + ), + ); + } +} + +class CupertinoSegmentedControlDemo2 extends StatefulWidget { + const CupertinoSegmentedControlDemo2({super.key}); + + @override + State createState() => + _CupertinoSegmentedControlDemoState2(); +} + +class _CupertinoSegmentedControlDemoState2 + extends State { + int _selectedSegment = 0; + + // The data for the segments + final Map _segments = { + 0:Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50) + ), + child: Text('لاشه', style: AppFonts.yekan13), + ), + 1: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50) + ), + child: Text('زنده', style: AppFonts.yekan13), + ), + }; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + NewCupertinoSegmentedControl( + padding: EdgeInsetsDirectional.symmetric( + horizontal: 20, + vertical: 10, + ), + children: _segments, + groupValue: _selectedSegment, + selectedColor: AppColor.blueNormal, + unselectedColor: Colors.white, + borderColor: Colors.grey.shade300, + onValueChanged: (int value) { + setState(() { + _selectedSegment = value; + }); + }, + ), + const SizedBox(height: 20), + Text( + 'Selected Segment: ${_selectedSegment + 1}', + style: const TextStyle(fontSize: 24), + ), + ], + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/vec_widget.dart b/packages/core/lib/presentation/widget/vec_widget.dart new file mode 100644 index 0000000..12bcda6 --- /dev/null +++ b/packages/core/lib/presentation/widget/vec_widget.dart @@ -0,0 +1,83 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; +import 'package:vector_graphics/vector_graphics.dart'; + +SvgPicture vecWidget( + String assets, { + double? width, + double? height, + BoxFit? fit, + Color? color, +}) { + return SvgPicture( + AssetBytesLoader(assets), + width: width, + height: height, + fit: fit ?? BoxFit.contain, + colorFilter: + color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null, + ); +} + +Widget vecWidgetWithOnTap({ + required Widget child, + required VoidCallback onTap, + double? width, + double? height, + BoxFit? fit, + Color? color, +}) { + return InkWell( + onTap: onTap, + child: child + ); +} + +SvgPicture svgWidget( + String assets, { + double? width, + double? height, + BoxFit? fit, + Color? color, +}) { + return SvgPicture.asset( + assets, + width: width, + height: height, + fit: fit ?? BoxFit.contain, + colorFilter: + color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null, + ); +} + +Widget vecWidget2( + String assets, { + double? width, + double? height, + BoxFit? fit, + Color? color, +}) { + final resolvedColor = WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } + return color; + }).resolve({}); // You can pass actual states if needed + + return IconTheme( + data: IconThemeData(color: resolvedColor), + child: SvgPicture( + AssetBytesLoader(assets), + width: width, + height: height, + fit: fit ?? BoxFit.contain, + colorFilter: + resolvedColor != null + ? ColorFilter.mode(resolvedColor, BlendMode.srcIn) + : null, + ), + ); +} + diff --git a/packages/core/lib/presentation/widget/widget.dart b/packages/core/lib/presentation/widget/widget.dart new file mode 100644 index 0000000..9a8b1a3 --- /dev/null +++ b/packages/core/lib/presentation/widget/widget.dart @@ -0,0 +1,34 @@ +export 'app_bar/r_app_bar.dart'; +export 'bottom_navigation/r_bottom_navigation.dart'; +export 'bottom_navigation/wave_bottom_navigation.dart'; +export 'bottom_sheet/base_bottom_sheet.dart'; +export 'bottom_sheet/date_picker_bottom_sheet.dart'; +//buttons +export 'buttons/buttons.dart'; +export 'card/card_with_icon_with_border.dart'; +export 'chips/r_chips.dart'; +export 'dialog/dialog.dart'; +export 'draggable_bottom_sheet/bottom_sheet_manger.dart'; +export 'draggable_bottom_sheet/draggable_bottom_sheet.dart'; +export 'draggable_bottom_sheet/draggable_bottom_sheet2.dart'; +export 'draggable_bottom_sheet/draggable_bottom_sheet_controller.dart'; +export 'empty_widget.dart'; +//inputs +export 'inputs/inputs.dart'; +//list_item +export 'list_item/list_item.dart'; +export 'list_item/list_item2.dart'; +export 'list_item/list_item_with_out_number.dart'; +export 'list_row_item.dart'; +export 'list_view/list_view.dart'; +export 'loading_widget.dart'; +export 'overlay_dropdown_widget/view.dart'; +export 'pagination/pagination_from_until.dart'; +export 'pagination/show_more.dart'; +export 'tabs/new_tab.dart'; +export 'tabs/r_segment.dart'; +export 'tabs/tab.dart'; +export 'vec_widget.dart'; + +// other +export 'logo_widget.dart'; diff --git a/packages/core/lib/routing/auth_route_resolver.dart b/packages/core/lib/routing/auth_route_resolver.dart new file mode 100644 index 0000000..b79adac --- /dev/null +++ b/packages/core/lib/routing/auth_route_resolver.dart @@ -0,0 +1,6 @@ +import 'package:rasadyar_core/data/model/local/user_local/user_local_model.dart'; + +abstract class AuthRouteResolver { + String getAuthRouteForModule(Module module); + String getFallbackRoute(); +} \ No newline at end of file diff --git a/packages/core/lib/utils/README.md b/packages/core/lib/utils/README.md new file mode 100644 index 0000000..c3df897 --- /dev/null +++ b/packages/core/lib/utils/README.md @@ -0,0 +1,6 @@ +```markdown +در معماری DDD (Domain-Driven Design)، فایل‌های utils یا همان ابزارهای کمکی (utility/helpers) معمولاً: + +✅ در هیچ لایه‌ی خاصی قرار نمی‌گیرند، +❗ بلکه به‌صورت cross-cutting concerns یا "مسائل متقاطع" در نظر گرفته می‌شن، چون در همه‌ی لایه‌ها ممکنه استفاده بشن. +``` \ No newline at end of file diff --git a/packages/core/lib/utils/apk_updater.dart b/packages/core/lib/utils/apk_updater.dart new file mode 100644 index 0000000..23776db --- /dev/null +++ b/packages/core/lib/utils/apk_updater.dart @@ -0,0 +1,22 @@ +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/services.dart'; +import 'package:path_provider/path_provider.dart'; + +class ApkUpdater { + static const _channel = MethodChannel('apk_installer'); + + static Future downloadAndInstall() async { + final dio = Dio(); + final apkUrl = "https://yourdomain.com/app.apk"; + + final dir = await getExternalStorageDirectory(); + final path = "${dir!.path}/update.apk"; + final file = File(path); + + await dio.download(apkUrl, path); + + await _channel.invokeMethod("installApk", {"path": path}); + } +} diff --git a/packages/core/lib/utils/extension/date_time_utils.dart b/packages/core/lib/utils/extension/date_time_utils.dart new file mode 100644 index 0000000..caa653a --- /dev/null +++ b/packages/core/lib/utils/extension/date_time_utils.dart @@ -0,0 +1,13 @@ +import 'package:intl/intl.dart'; +import 'package:persian_datetime_picker/persian_datetime_picker.dart'; + +extension XDateTime2 on DateTime { + get formattedJalaliDate { + final jalaliDate = Jalali.fromDateTime(this); + return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; + } + + get formattedYHMS { + return DateFormat('yyyy-MM-dd HH:mm:ss').format(this); + } +} diff --git a/packages/core/lib/utils/extension/num_utils.dart b/packages/core/lib/utils/extension/num_utils.dart new file mode 100644 index 0000000..880d901 --- /dev/null +++ b/packages/core/lib/utils/extension/num_utils.dart @@ -0,0 +1,8 @@ +import 'package:intl/intl.dart'; + +extension XNumExtension on num? { + String get separatedByComma { + final formatter = NumberFormat('#,###', 'fa_IR'); + return this == null ? '':formatter.format(this); + } +} diff --git a/packages/core/lib/utils/extension/string_utils.dart b/packages/core/lib/utils/extension/string_utils.dart new file mode 100644 index 0000000..a464443 --- /dev/null +++ b/packages/core/lib/utils/extension/string_utils.dart @@ -0,0 +1,52 @@ +import 'package:intl/intl.dart'; +import 'package:persian_datetime_picker/persian_datetime_picker.dart'; + +extension XString on String { + String get separatedByComma { + final formatter = NumberFormat('#,###'); + final number = num.tryParse(this); + return number != null ? formatter.format(number) : this; + } + + String get clearComma { + return replaceAll(RegExp(r'\D'), ''); + } + + String get addCountEXT { + return '$this قطعه'; + } + + String get addDayEXT { + return '$thisروزه'; + } + + String get addKgEXT { + return '$this کیلوگرم'; + } + + DateTime get toDateTime => DateTime.parse(this); + + String get formattedJalaliDate { + String tmp = contains("/") ? replaceAll("/", "-") : this; + final dateTime = DateTime.parse(tmp); + final jalaliDate = Jalali.fromDateTime(dateTime); + return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; + } + + String get formattedJalaliDateYHMS { + final dateTime = DateTime.parse(this); + final jalaliDate = Jalali.fromDateTime(dateTime); + return "${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')} - ${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; + } + + String get formattedYHMS { + return DateFormat('yyyy-MM-dd HH:mm:ss').format(toDateTime); + } + + Jalali get toJalali { + final dateTime = DateTime.parse(this); + return Jalali.fromDateTime(dateTime); + } + + int get versionNumber => int.parse(replaceAll(".", '')); +} diff --git a/packages/core/lib/utils/local/local_utils.dart b/packages/core/lib/utils/local/local_utils.dart new file mode 100644 index 0000000..04f3e5d --- /dev/null +++ b/packages/core/lib/utils/local/local_utils.dart @@ -0,0 +1,7 @@ +//Auth +const int authUserLocalModelTypeId = 0; +const int authModuleTypeId = 1; + +//chicken +const int chickenWidelyUsedLocalModelTypeId = 2; +const int chickenWidelyUsedLocalItemTypeId = 3; \ No newline at end of file diff --git a/packages/core/lib/utils/logger_utils.dart b/packages/core/lib/utils/logger_utils.dart new file mode 100644 index 0000000..8d83ded --- /dev/null +++ b/packages/core/lib/utils/logger_utils.dart @@ -0,0 +1,43 @@ +import 'package:flutter/foundation.dart'; +import 'package:logger/logger.dart'; +import 'package:rasadyar_core/injection/di.dart'; + +void iLog(dynamic message) { + if(kDebugMode){ + diCore.get().i(message.toString()); + } +} + +void wLog(dynamic message){ + if(kDebugMode){ + diCore.get().w(message.toString()); + } +} + +void eLog(dynamic message) { + if(kDebugMode){ + diCore.get().e(message.toString()); + } +} + + +void dLog(dynamic message) { + if(kDebugMode){ + diCore.get().d(message.toString()); + } +} + + +void fLog(dynamic message){ + if(kDebugMode){ + diCore.get().f(message.toString()); + } +} + + +void tLog(dynamic message) { + if(kDebugMode){ + diCore.get().t(message.toString()); + } +} + diff --git a/packages/core/lib/utils/map_utils.dart b/packages/core/lib/utils/map_utils.dart new file mode 100644 index 0000000..3278207 --- /dev/null +++ b/packages/core/lib/utils/map_utils.dart @@ -0,0 +1,116 @@ +import 'package:rasadyar_core/presentation/utils/data_time_utils.dart'; + +Map buildQueryParams({ + Map? queryParams, + String? search, + String? value, + int? page, + int? pageSize, + DateTime? fromDate, + DateTime? toDate, + String? role, + String? state, +}) { + final params = {}; + if (fromDate != null) { + params['date1'] = fromDate.formattedDashedGregorian; + } + + if (toDate != null) { + params['date2'] = toDate.formattedDashedGregorian; + } + + if (search != null && search.isNotEmpty) { + params['search'] = search; + } + + params['value'] = value ?? ''; + + if (page != null) { + params['page'] = page; + } + + if (pageSize != null) { + params['page_size'] = pageSize; + } + + if (role != null && role.isNotEmpty) { + params['role'] = role; + } + + if (state != null && state.isNotEmpty) { + params['state'] = state; + } + + if (queryParams != null) { + params.addAll(queryParams); + } + + return params; +} + +Map? buildRawQueryParams({ + Map? queryParams, + String? search, + String? value, + int? page, + int? pageSize, + DateTime? fromDate, + DateTime? toDate, + String? role, + String? state, + double? centerLat, + double? centerLng, + double? radius, +}) { + final params = {}; + if (fromDate != null) { + params['date1'] = fromDate.formattedDashedGregorian; + } + + if (toDate != null) { + params['date2'] = toDate.formattedDashedGregorian; + } + + if (search != null && search.isNotEmpty) { + params['search'] = search; + } + + if (value != null) { + params['value'] = value ?? ''; + } + + if (page != null) { + params['page'] = page; + } + + if (pageSize != null) { + params['page_size'] = pageSize; + } + + if (role != null && role.isNotEmpty) { + params['role'] = role; + } + + if (state != null && state.isNotEmpty) { + params['state'] = state; + } + + if (queryParams != null) { + params.addAll(queryParams); + } + + if (centerLat != null) { + params['center_lat'] = centerLat ?? ''; + } + + if (centerLng != null) { + params['center_lon'] = centerLng ?? ''; + } + + if (radius != null) { + params['radius'] = radius ?? ''; + } + + return params.keys.isEmpty ? null : params; +} diff --git a/packages/core/lib/utils/mixins/pagination_controller_mixin.dart b/packages/core/lib/utils/mixins/pagination_controller_mixin.dart new file mode 100644 index 0000000..c84b88e --- /dev/null +++ b/packages/core/lib/utils/mixins/pagination_controller_mixin.dart @@ -0,0 +1,64 @@ +import 'dart:async'; + +import 'package:get/get.dart'; +import 'package:rasadyar_core/utils/network/resource.dart'; + +mixin PaginationControllerMixin on GetxController { + final Rx>> resource = Resource>.initial().obs; + final RxBool isPaginating = false.obs; + final RxBool hasMore = true.obs; + int currentPage = 1; + + Timer? _debounceTimer; + Future Function()? _lastTriedOperation; + + Future> fetchPage(int page); + + void retryLastOperation() => _lastTriedOperation?.call(); + + Future refreshData() async { + _lastTriedOperation = refreshData; + try { + currentPage = 1; + resource.value = const Resource.loading(); + final items = await fetchPage(currentPage); + if (items.isEmpty) { + resource.value = const Resource.empty(); + hasMore.value = false; + } else { + resource.value = Resource.success(items); + hasMore.value = true; + } + } catch (e) { + resource.value = Resource.error(e.toString()); + } + } + + Future loadMoreData() async { + _lastTriedOperation = loadMoreData; + + if (_debounceTimer?.isActive ?? false) return; + + _debounceTimer = Timer(const Duration(milliseconds: 300), () async { + if (isPaginating.value || !hasMore.value) return; + + try { + isPaginating.value = true; + final nextPage = currentPage + 1; + final newItems = await fetchPage(nextPage); + if (newItems.isEmpty) { + hasMore.value = false; + } else { + final currentList = List.from(resource.value.data ?? []); + currentList.addAll(newItems); + resource.value = Resource.success(currentList); + currentPage = nextPage; + } + } catch (_) { + // ignore or optionally handle pagination error + } finally { + isPaginating.value = false; + } + }); + } +} diff --git a/packages/core/lib/utils/network/network.dart b/packages/core/lib/utils/network/network.dart new file mode 100644 index 0000000..ae65c6a --- /dev/null +++ b/packages/core/lib/utils/network/network.dart @@ -0,0 +1,3 @@ +export 'resource.dart'; +export 'safe_call_utils.dart'; +export 'safe_call.dart'; \ No newline at end of file diff --git a/packages/core/lib/utils/network/resource.dart b/packages/core/lib/utils/network/resource.dart new file mode 100644 index 0000000..cd7ed0f --- /dev/null +++ b/packages/core/lib/utils/network/resource.dart @@ -0,0 +1,34 @@ +enum ResourceStatus { initial, loading, success, error, empty } + +class Resource { + final ResourceStatus status; + final T? data; + final String? message; + + const Resource._({required this.status, this.data, this.message}); + + const Resource.initial() : this._(status: ResourceStatus.initial); + + const Resource.loading() : this._(status: ResourceStatus.loading); + + const Resource.success(T data) : this._(status: ResourceStatus.success, data: data); + + const Resource.error(String message) : this._(status: ResourceStatus.error, message: message); + + const Resource.empty() : this._(status: ResourceStatus.empty); + + bool get isInitial => status == ResourceStatus.initial; + + bool get isLoading => status == ResourceStatus.loading; + + bool get isSuccess => status == ResourceStatus.success; + + bool get isError => status == ResourceStatus.error; + + bool get isEmpty => status == ResourceStatus.empty; + + @override + String toString() { + return 'Resource{status: $status, data: $data, message: $message}'; + } +} diff --git a/packages/core/lib/utils/network/safe_call.dart b/packages/core/lib/utils/network/safe_call.dart new file mode 100644 index 0000000..f850990 --- /dev/null +++ b/packages/core/lib/utils/network/safe_call.dart @@ -0,0 +1,27 @@ +import 'package:rasadyar_core/core.dart'; + +Future safeCall({ + required AppAsyncCallback call, + Function(T result)? onSuccess, + ErrorCallback? onError, + VoidCallback? onComplete, + bool showLoading = false, + bool showError = false, + bool showSuccess = false, + bool showToast = false, + bool showSnackBar = false, + Function()? onShowLoading, + Function()? onHideLoading, +}) { + return gSafeCall( + call: call, + onSuccess: onSuccess, + onError: onError, + onComplete: onComplete, + showLoading: showLoading, + showError: showError, + showSuccess: showSuccess, + onShowLoading: onShowLoading, + onHideLoading: onHideLoading, + ); +} \ No newline at end of file diff --git a/packages/core/lib/utils/network/safe_call_utils.dart b/packages/core/lib/utils/network/safe_call_utils.dart new file mode 100644 index 0000000..18588b6 --- /dev/null +++ b/packages/core/lib/utils/network/safe_call_utils.dart @@ -0,0 +1,175 @@ +import 'package:flutter/material.dart'; + +import '../../core.dart'; + +class ApiHandler { + static CancelToken _globalCancelToken = CancelToken(); + + static CancelToken get globalCancelToken => _globalCancelToken; + + static Future reset() async { + _globalCancelToken = CancelToken(); + } + + static void cancelAllRequests(String reason) { + if (!_globalCancelToken.isCancelled) { + _globalCancelToken.cancel(reason); + } + reset(); + } +} + + + +typedef AppAsyncCallback = Future Function(); +typedef ErrorCallback = Function(dynamic error, StackTrace? stackTrace); +typedef VoidCallback = void Function(); + +Future gSafeCall({ + required AppAsyncCallback call, + Function(T result)? onSuccess, + ErrorCallback? onError, + VoidCallback? onComplete, + bool showLoading = false, + bool showError = true, + bool showSuccess = false, + Function()? onShowLoading, + Function()? onHideLoading, + Function(String message)? onShowErrorMessage, + Function(String message)? onShowSuccessMessage, + int maxRetries = 0, + Duration retryDelay = const Duration(seconds: 1), +}) async { + int retryCount = 0; + + while (retryCount <= maxRetries) { + try { + if (showLoading && retryCount == 0) { + (onShowLoading ?? _defaultShowLoading)(); + } + + final result = await call(); + + if (showSuccess) { + (onShowSuccessMessage ?? _defaultShowSuccessMessage)('عملیات با موفقیت انجام شد'); + } + + onSuccess?.call(result); + return result; + + } catch (error, stackTrace) { + retryCount++; + + eLog('Error in gSafeCall: $error, retryCount: $retryCount , stackTrace : $stackTrace '); + + if (error is DioException && error.response?.statusCode == 401) { + if (showError) { + (onShowErrorMessage ?? _defaultShowErrorMessage)('خطا در احراز هویت'); + } + onError?.call(error, stackTrace); + return null; + } + + + if (retryCount > maxRetries || !_isRetryableError(error)) { + if (showError) { + final message = _getErrorMessage(error); + (onShowErrorMessage ?? _defaultShowErrorMessage)(message); + } + onError?.call(error, stackTrace); + return null; + } + + + if (retryCount <= maxRetries) { + await Future.delayed(retryDelay); + } + } finally { + if (showLoading && retryCount > maxRetries) { + (onHideLoading ?? _defaultHideLoading)(); + } + if (retryCount > maxRetries) { + onComplete?.call(); + } + } + } + + return null; +} + +bool _isRetryableError(dynamic error) { + if (error is DioException) { + // خطاهای قابل retry + return error.type == DioExceptionType.connectionTimeout || + error.type == DioExceptionType.receiveTimeout || + error.type == DioExceptionType.sendTimeout || + (error.response?.statusCode != null && + error.response!.statusCode! >= 500); + } + return false; +} + +String _getErrorMessage(dynamic error) { + if (error is DioException) { + final responseData = error.response?.data; + if (responseData is Map && responseData['result'] != null) { + return responseData['result'].toString(); + } + + switch (error.type) { + case DioExceptionType.connectionTimeout: + return 'خطا در اتصال - زمان اتصال تمام شد'; + case DioExceptionType.receiveTimeout: + return 'خطا در دریافت پاسخ'; + case DioExceptionType.sendTimeout: + return 'خطا در ارسال درخواست'; + case DioExceptionType.badCertificate: + return 'خطا در گواهی امنیتی'; + case DioExceptionType.connectionError: + return 'خطا در اتصال به سرور'; + case DioExceptionType.unknown: + return 'خطای نامشخص'; + default: + if (error.response?.statusCode != null) { + return 'خطا: ${error.response!.statusCode}'; + } + return 'خطای نامشخص'; + } + } + return error.toString(); +} + +void _defaultShowLoading() { + // نمایش loading + Get.dialog( + Center(child: CircularProgressIndicator()), + barrierDismissible: false, + ); +} + +void _defaultHideLoading() { + // مخفی کردن loading + if (Get.isDialogOpen == true) { + Get.back(); + } +} + +void _defaultShowSuccessMessage(String message) { + Get.snackbar( + 'موفقیت', + message, + snackPosition: SnackPosition.TOP, + backgroundColor: Colors.green, + colorText: Colors.white, + ); +} + +void _defaultShowErrorMessage(String message) { + Get.snackbar( + 'خطا', + message, + snackPosition: SnackPosition.TOP, + backgroundColor: Colors.red, + colorText: Colors.white, + ); +} diff --git a/packages/core/lib/utils/parser.dart b/packages/core/lib/utils/parser.dart new file mode 100644 index 0000000..319be03 --- /dev/null +++ b/packages/core/lib/utils/parser.dart @@ -0,0 +1,16 @@ +import 'package:flutter/foundation.dart'; + +List _parserList(Map args) { + final list = args['list'] as List; + final T Function(Map) fromJson = + args['fromJson'] as T Function(Map); + + return list.map((e) => fromJson(e as Map)).toList(); +} + +Future> parseListInIsolate( + List list, + T Function(Map) fromJson, +) async { + return compute(_parserList, {'list': list, 'fromJson': fromJson}); +} diff --git a/packages/core/lib/utils/route_utils.dart b/packages/core/lib/utils/route_utils.dart new file mode 100644 index 0000000..64e23d3 --- /dev/null +++ b/packages/core/lib/utils/route_utils.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +GetPageRoute buildRouteFromGetPage(GetPage page) { + return GetPageRoute( + page: page.page, + settings: RouteSettings(name: page.name), + transition: page.transition, + curve: page.curve, + binding: page.binding, + bindings: page.bindings, + routeName: page.name, + title: page.title, + gestureWidth: page.gestureWidth, + alignment: page.alignment, + maintainState: page.maintainState, + customTransition: page.customTransition, + transitionDuration: page.transitionDuration ?? const Duration(milliseconds: 300), + fullscreenDialog: page.fullscreenDialog, + opaque: page.opaque, + popGesture: page.popGesture, + showCupertinoParallax: page.showCupertinoParallax, + ); +} \ No newline at end of file diff --git a/packages/core/lib/utils/separator_input_formatter.dart b/packages/core/lib/utils/separator_input_formatter.dart new file mode 100644 index 0000000..cc87a5f --- /dev/null +++ b/packages/core/lib/utils/separator_input_formatter.dart @@ -0,0 +1,27 @@ +import 'package:flutter/services.dart'; +import 'package:intl/intl.dart'; + +class SeparatorInputFormatter extends TextInputFormatter { + final NumberFormat _formatter; + + SeparatorInputFormatter() : _formatter = NumberFormat('#,###'); + + @override + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { + if (newValue.text.isEmpty) { + return newValue; + } + String tmpText = newValue.text; + String cleanedText = tmpText.replaceAll(RegExp(r'\D'), ''); + int? number = int.tryParse(cleanedText); + if (number == null) { + return oldValue; + } + String formattedText = _formatter.format(number); + int selectionIndex = formattedText.length; + return TextEditingValue( + text: formattedText, + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} diff --git a/packages/core/lib/utils/utils.dart b/packages/core/lib/utils/utils.dart new file mode 100644 index 0000000..ba7f6b2 --- /dev/null +++ b/packages/core/lib/utils/utils.dart @@ -0,0 +1,12 @@ +export 'apk_updater.dart'; +export 'extension/date_time_utils.dart'; +export 'extension/num_utils.dart'; +export 'extension/string_utils.dart'; +export 'local/local_utils.dart'; +export 'logger_utils.dart'; +export 'map_utils.dart'; +export 'mixins/pagination_controller_mixin.dart'; +export 'network/network.dart'; +export 'parser.dart'; +export 'route_utils.dart'; +export 'separator_input_formatter.dart'; diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock new file mode 100644 index 0000000..9eea597 --- /dev/null +++ b/packages/core/pubspec.lock @@ -0,0 +1,1519 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + android_intent_plus: + dependency: "direct main" + description: + name: android_intent_plus + sha256: dfc1fd3a577205ae8f11e990fb4ece8c90cceabbee56fcf48e463ecf0bd6aae3 + url: "https://pub.dev" + source: hosted + version: "5.3.0" + animated_stack_widget: + dependency: transitive + description: + name: animated_stack_widget + sha256: ce4788dd158768c9d4388354b6fb72600b78e041a37afc4c279c63ecafcb9408 + url: "https://pub.dev" + source: hosted + version: "0.0.4" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" + url: "https://pub.dev" + source: hosted + version: "1.6.5" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d + url: "https://pub.dev" + source: hosted + version: "2.6.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 + url: "https://pub.dev" + source: hosted + version: "9.2.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62" + url: "https://pub.dev" + source: hosted + version: "8.11.0" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + color: + dependency: transitive + description: + name: color + sha256: ddcdf1b3badd7008233f5acffaf20ca9f5dc2cd0172b75f68f24526a5f5725cb + url: "https://pub.dev" + source: hosted + version: "3.0.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + 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" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_earcut: + dependency: transitive + description: + name: dart_earcut + sha256: e485001bfc05dcbc437d7bfb666316182e3522d4c3f9668048e004d0eb2ce43b + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + dartx: + dependency: "direct main" + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + device_info_plus: + dependency: "direct main" + description: + name: device_info_plus + sha256: "98f28b42168cc509abc92f88518882fd58061ea372d7999aecc424345c7bff6a" + url: "https://pub.dev" + source: hosted + version: "11.5.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f + url: "https://pub.dev" + source: hosted + version: "7.0.3" + dio: + dependency: "direct main" + description: + name: dio + sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" + url: "https://pub.dev" + source: hosted + version: "5.8.0+1" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + encrypt: + dependency: "direct main" + description: + name: encrypt + sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "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_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: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" + url: "https://pub.dev" + source: hosted + version: "0.9.4+3" + 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" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_gen_core: + dependency: transitive + description: + name: flutter_gen_core + sha256: eda54fdc5de08e7eeea663eb8442aafc8660b5a13fda4e0c9e572c64e50195fb + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_gen_runner: + dependency: "direct main" + description: + name: flutter_gen_runner + sha256: "669bf8b7a9b4acbdcb7fcc5e12bf638aca19acedf43341714cbca3bf3a219521" + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_map: + dependency: "direct main" + description: + name: flutter_map + sha256: "2ecb34619a4be19df6f40c2f8dce1591675b4eff7a6857bd8f533706977385da" + url: "https://pub.dev" + source: hosted + version: "7.0.2" + flutter_map_animations: + dependency: "direct main" + description: + name: flutter_map_animations + sha256: "08233f89919049a3601e785d32e9d1d9e1faac6578190150f1d7495fc1050d36" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + flutter_map_marker_cluster: + dependency: "direct main" + description: + name: flutter_map_marker_cluster + sha256: "2c1fb4d7a2105c4bbeb89be215320507f4b71b2036df4341fab9d2aa677d3ae9" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + flutter_map_marker_popup: + dependency: transitive + description: + name: flutter_map_marker_popup + sha256: a7540538114b5d1627ab67b498273d66bc36090385412ae49ef215af4a2861c5 + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e + url: "https://pub.dev" + source: hosted + version: "2.0.28" + flutter_rating_bar: + dependency: "direct main" + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.dev" + source: hosted + version: "5.9.3" + flutter_secure_storage: + dependency: "direct main" + description: + name: flutter_secure_storage + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + flutter_slidable: + dependency: "direct main" + description: + name: flutter_slidable + sha256: ab7dbb16f783307c9d7762ede2593ce32c220ba2ba0fd540a3db8e9a3acba71a + url: "https://pub.dev" + source: hosted + version: "4.0.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + 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: "direct main" + description: + name: font_awesome_flutter + sha256: d3a89184101baec7f4600d58840a764d2ef760fe1c5a20ef9e6b0e9b24a07a3a + url: "https://pub.dev" + source: hosted + version: "10.8.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c + url: "https://pub.dev" + source: hosted + version: "3.2.0" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + geoclue: + dependency: transitive + description: + name: geoclue + sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f + url: "https://pub.dev" + source: hosted + version: "0.1.1" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516" + url: "https://pub.dev" + source: hosted + version: "14.0.2" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 + url: "https://pub.dev" + source: hosted + version: "2.3.13" + geolocator_linux: + dependency: transitive + description: + name: geolocator_linux + sha256: c4e966f0a7a87e70049eac7a2617f9e16fd4c585a26e4330bdfc3a71e6a721f3 + url: "https://pub.dev" + source: hosted + version: "0.2.3" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" + url: "https://pub.dev" + source: hosted + version: "4.2.6" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172 + url: "https://pub.dev" + source: hosted + version: "4.1.3" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" + url: "https://pub.dev" + source: hosted + version: "0.2.5" + get: + dependency: "direct main" + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.dev" + source: hosted + version: "4.7.2" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" + get_test: + dependency: "direct dev" + description: + name: get_test + sha256: "558c39cb35fb37bd501f337dc143de60a4314d5ef3b75f4b0551d6741634995b" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + gsettings: + dependency: transitive + description: + name: gsettings + sha256: "1b0ce661f5436d2db1e51f3c4295a49849f03d304003a7ba177d01e3a858249c" + url: "https://pub.dev" + source: hosted + version: "0.2.8" + hashcodes: + dependency: transitive + description: + name: hashcodes + sha256: "80f9410a5b3c8e110c4b7604546034749259f5d6dcca63e0d3c17c9258f1a651" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + hive_ce: + dependency: "direct main" + description: + name: hive_ce + sha256: "708bb39050998707c5d422752159f91944d3c81ab42d80e1bd0ee37d8e130658" + url: "https://pub.dev" + source: hosted + version: "2.11.3" + hive_ce_flutter: + dependency: "direct main" + description: + name: hive_ce_flutter + sha256: a0989670652eab097b47544f1e5a4456e861b1b01b050098ea0b80a5fabe9909 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + hive_ce_generator: + dependency: "direct dev" + description: + name: hive_ce_generator + sha256: a169feeff2da9cc2c417ce5ae9bcebf7c8a95d7a700492b276909016ad70a786 + url: "https://pub.dev" + source: hosted + version: "1.9.3" + http: + dependency: transitive + description: + name: http + sha256: "85ab0074f9bf2b24625906d8382bbec84d3d6919d285ba9c106b07b65791fb99" + url: "https://pub.dev" + source: hosted + version: "1.5.0-beta.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "6fae381e6af2bbe0365a5e4ce1db3959462fa0c4d234facf070746024bb80c8d" + url: "https://pub.dev" + source: hosted + version: "0.8.12+24" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + 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" + image_size_getter: + dependency: transitive + description: + name: image_size_getter + sha256: "9a299e3af2ebbcfd1baf21456c3c884037ff524316c97d8e56035ea8fdf35653" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + isolate_channel: + dependency: transitive + description: + name: isolate_channel + sha256: f3d36f783b301e6b312c3450eeb2656b0e7d1db81331af2a151d9083a3f6b18d + url: "https://pub.dev" + source: hosted + version: "0.2.2+1" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: ce2cf974ccdee13be2a510832d7fba0b94b364e0b0395dee42abaa51b855be27 + url: "https://pub.dev" + source: hosted + version: "6.10.0" + latlong2: + dependency: "direct main" + description: + name: latlong2 + sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" + url: "https://pub.dev" + source: hosted + version: "0.9.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + url: "https://pub.dev" + source: hosted + version: "10.0.9" + 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" + lints: + dependency: transitive + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + logger: + dependency: "direct main" + description: + name: logger + sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lottie: + dependency: "direct main" + description: + name: lottie + sha256: c5fa04a80a620066c15cf19cc44773e19e9b38e989ff23ea32e5903ef1015950 + url: "https://pub.dev" + source: hosted + version: "3.3.1" + 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" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: transitive + description: + name: mockito + sha256: "2314cbe9165bcd16106513df9cf3c3224713087f09723b128928dc11a4379f99" + url: "https://pub.dev" + source: hosted + version: "5.5.0" + mocktail: + dependency: "direct dev" + description: + name: mocktail + sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" + url: "https://pub.dev" + source: hosted + version: "8.3.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + 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: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 + url: "https://pub.dev" + source: hosted + version: "2.2.17" + 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" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1 + url: "https://pub.dev" + source: hosted + version: "12.0.1" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6" + url: "https://pub.dev" + source: hosted + version: "13.0.1" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023 + url: "https://pub.dev" + source: hosted + version: "9.4.7" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.dev" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 + url: "https://pub.dev" + source: hosted + version: "4.3.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + persian_datetime_picker: + dependency: "direct main" + description: + name: persian_datetime_picker + sha256: "7ccbfd3a68dc89d405550f624e9fa590c914fed2aa2d48973c4f4400baab2e06" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.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" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.dev" + source: hosted + version: "3.9.1" + polylabel: + dependency: transitive + description: + name: polylabel + sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.dev" + source: hosted + version: "6.0.3" + pretty_dio_logger: + dependency: "direct main" + description: + name: pretty_dio_logger + sha256: "36f2101299786d567869493e2f5731de61ce130faa14679473b26905a92b6407" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + proj4dart: + dependency: transitive + description: + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + url: "https://pub.dev" + source: hosted + version: "2.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" + url: "https://pub.dev" + source: hosted + version: "6.1.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + rxdart: + dependency: "direct main" + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + shamsi_date: + dependency: transitive + description: + name: shamsi_date + sha256: "0383fddc9bce91e9e08de0c909faf93c3ab3a0e532abd271fb0dcf5d0617487b" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + shimmer: + dependency: "direct main" + description: + name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc787b1f89ceac9580c3616f899c9a447413cbdac1df071302127764c023a134 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1" + url: "https://pub.dev" + source: hosted + version: "1.3.6" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + time: + dependency: transitive + description: + name: time + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 + url: "https://pub.dev" + source: hosted + version: "1.1.19" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331" + url: "https://pub.dev" + source: hosted + version: "1.1.17" + 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: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 + url: "https://pub.dev" + source: hosted + version: "15.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + win32: + dependency: transitive + description: + name: win32 + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" + url: "https://pub.dev" + source: hosted + version: "5.14.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + 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" + yaml_writer: + dependency: transitive + description: + name: yaml_writer + sha256: "69651cd7238411179ac32079937d4aa9a2970150d6b2ae2c6fe6de09402a5dc5" + url: "https://pub.dev" + source: hosted + version: "2.1.0" +sdks: + dart: ">=3.8.1 <4.0.0" + flutter: ">=3.29.0" diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml new file mode 100644 index 0000000..f87b92b --- /dev/null +++ b/packages/core/pubspec.yaml @@ -0,0 +1,107 @@ +name: rasadyar_core +description: "A new Flutter project." +publish_to: none +version: 1.2.0+2 + +environment: + sdk: ^3.8.1 + +dependencies: + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter + + #utils + device_info_plus: ^11.5.0 + package_info_plus: ^8.3.0 + + ##image_picker + image_picker: ^1.1.2 + + + #UI + cupertino_icons: ^1.0.8 + flutter_slidable: ^4.0.0 + flutter_rating_bar: ^4.0.1 + lottie: ^3.3.1 + flutter_screenutil: ^5.9.3 + + ##Log + logger: ^2.6.1 + + ## reactive + dartx: ^1.2.0 + rxdart: ^0.28.0 + + ## local storage + hive_ce: ^2.11.3 + hive_ce_flutter: ^2.3.1 + flutter_secure_storage: ^9.2.4 + path_provider: ^2.1.5 + + #SVG + flutter_svg: ^2.2.0 + font_awesome_flutter: ^10.8.0 + + #Shimmer + shimmer: ^3.0.0 + + #Generator + flutter_gen_runner: ^5.11.0 + + ##state manger + get: ^4.7.2 + + ##Di + get_it: ^8.0.3 + + #other + permission_handler: ^12.0.1 + persian_datetime_picker: ^3.1.0 + encrypt: ^5.0.3 + + #L10N tools + intl: ^0.20.2 + + #INITENT + android_intent_plus: ^5.3.0 + + #Map + flutter_map: ^7.0.0 + flutter_map_animations: ^0.8.0 + flutter_map_marker_cluster: ^1.4.0 + #location + latlong2: ^0.9.1 + geolocator: ^14.0.2 + #network + dio: ^5.8.0+1 + + #networkLogger + pretty_dio_logger: ^1.4.0 + + ##code generation + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + ##code generation + build_runner: ^2.6.0 + hive_ce_generator: ^1.9.3 + freezed: ^3.2.0 + json_serializable: ^6.10.0 + + + ##test + mocktail: ^1.0.4 + get_test: ^4.0.1 + + + + +flutter: + uses-material-design: true + + diff --git a/packages/core/test/infrastructure/local/hive_local_storage.dart b/packages/core/test/infrastructure/local/hive_local_storage.dart new file mode 100644 index 0000000..82fcc1b --- /dev/null +++ b/packages/core/test/infrastructure/local/hive_local_storage.dart @@ -0,0 +1,102 @@ +import 'package:flutter/foundation.dart'; +import 'package:rasadyar_core/core.dart'; + +class HiveLocalStorage implements ILocalStorage { + HiveLocalStorage() { + Hive.initFlutter(); + } + + final Map _boxes = {}; + + @override + Future init() async => await Hive.initFlutter(); + + @override + Future openBox( + String boxName, { + HiveCipher? encryptionCipher, + bool crashRecovery = true, + String? path, + Uint8List? bytes, + String? collection, + }) async { + if (!_boxes.containsKey(boxName)) { + final box = await Hive.openBox( + boxName, + encryptionCipher: encryptionCipher, + crashRecovery: crashRecovery, + ); + _boxes[boxName] = box; + } + } + + @override + T? read({required String boxName, required String key}) { + try { + Box? box = getBox(boxName); + return box?.get(key) as T?; + } on Exception catch (e) { + eLog(e); + return null; + } + } + + @override + Future add({required String boxName, required dynamic value}) async { + Box? box = getBox(boxName); + await box?.add(value); + } + + @override + Future addAll({required String boxName, required Iterable values}) async { + Box? box = getBox(boxName); + await box?.addAll(values); + } + + Box? getBox(String boxName) { + final box = _boxes[boxName]; + if (box is Box) { + return box; + } else { + throw Exception('Box $boxName is not of exist'); + } + } + + @override + Future clear(String boxName) async { + await Hive.box(boxName).clear(); + } + + @override + Future close(String boxName) async => await _boxes[boxName]?.close(); + + @override + Future deleteValue({required String boxName, required String key}) async { + Box? box = getBox(boxName); + await box?.delete(key); + } + + @override + Future save({required String boxName, required String key, required value}) async { + Box? box = getBox(boxName); + await box?.put(key, value); + } + + @override + Future saveAll({required String boxName, required Map entries}) async { + Box? box = getBox(boxName); + await box?.putAll(entries); + } + + @override + Future saveAt({required String boxName, required int index, required value}) async { + Box? box = getBox(boxName); + await box?.putAt(index, value); + } + + @override + List? readBox({required String boxName}) { + // TODO: implement readBox + throw UnimplementedError(); + } +} diff --git a/packages/core/test/infrastructure/local/i_local_storage.dart b/packages/core/test/infrastructure/local/i_local_storage.dart new file mode 100644 index 0000000..7cb4f49 --- /dev/null +++ b/packages/core/test/infrastructure/local/i_local_storage.dart @@ -0,0 +1,44 @@ +import 'package:flutter/foundation.dart'; +import 'package:hive_ce/hive.dart'; + +abstract class ILocalStorage { + Future init(); + + Future openBox( + String boxName, { + HiveCipher? encryptionCipher, + bool crashRecovery = true, + String? path, + Uint8List? bytes, + String? collection, + }); + + T? read({required String boxName, required String key}); + + Future deleteValue({required String boxName, required String key}); + + Future add({required String boxName, required E value}); + + Future addAll({required String boxName, required Iterable values}); + + Future clear(String boxName); + + Future close(String boxName); + + Future save({ + required String boxName, + required String key, + required dynamic value, + }); + + Future saveAt({ + required String boxName, + required int index, + required dynamic value, + }); + + Future saveAll({ + required String boxName, + required Map entries, + }); +} diff --git a/packages/core/test/infrastructure/remote/dio_form_data.dart b/packages/core/test/infrastructure/remote/dio_form_data.dart new file mode 100644 index 0000000..8e74832 --- /dev/null +++ b/packages/core/test/infrastructure/remote/dio_form_data.dart @@ -0,0 +1,23 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; + +import 'interfaces/i_form_data.dart'; + +class DioFormData implements IFormData { + final FormData _formData = FormData(); + + @override + void addFile(String field, Uint8List bytes, String filename) { + _formData.files.add(MapEntry( + field, + MultipartFile.fromBytes(bytes, filename: filename), + )); + } + + @override + void addField(String key, String value) { + _formData.fields.add(MapEntry(key, value)); + } + + FormData get raw => _formData; +} diff --git a/packages/core/test/infrastructure/remote/dio_remote_test.dart b/packages/core/test/infrastructure/remote/dio_remote_test.dart new file mode 100644 index 0000000..e69de29 diff --git a/packages/core/test/infrastructure/remote/dio_response.dart b/packages/core/test/infrastructure/remote/dio_response.dart new file mode 100644 index 0000000..30f54eb --- /dev/null +++ b/packages/core/test/infrastructure/remote/dio_response.dart @@ -0,0 +1,20 @@ +import 'interfaces/i_http_response.dart'; +import 'package:dio/dio.dart'; + +class DioResponse implements IHttpResponse { + final Response _response; + + DioResponse(this._response); + + @override + T? get data => _response.data; + + @override + int get statusCode => _response.statusCode ?? 0; + + @override + Map? get headers => _response.headers.map; + + @override + bool get isSuccessful => statusCode >= 200 && statusCode < 300; +} diff --git a/packages/core/test/infrastructure/remote/interfaces/i_form_data.dart b/packages/core/test/infrastructure/remote/interfaces/i_form_data.dart new file mode 100644 index 0000000..ddbda85 --- /dev/null +++ b/packages/core/test/infrastructure/remote/interfaces/i_form_data.dart @@ -0,0 +1,6 @@ +import 'package:flutter/foundation.dart'; + +abstract class IFormData{ + void addFile(String field, Uint8List bytes, String filename); + void addField(String key, String value); +} \ No newline at end of file diff --git a/packages/core/test/infrastructure/remote/interfaces/i_http_client.dart b/packages/core/test/infrastructure/remote/interfaces/i_http_client.dart new file mode 100644 index 0000000..3e6327c --- /dev/null +++ b/packages/core/test/infrastructure/remote/interfaces/i_http_client.dart @@ -0,0 +1,53 @@ + +import 'package:dio/dio.dart'; +import 'i_form_data.dart'; +import 'i_http_response.dart'; + +abstract class IHttpClient { + Future init(); + + Future> get( + String path, { + Map? queryParameters, + Map? headers, + ProgressCallback? onReceiveProgress, + }); + + + Future> post( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }); + + Future> put( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }); + + Future> delete( + String path, { + dynamic data, + Map? queryParameters, + Map? headers, + }); + + Future> download( + String url, { + ProgressCallback? onReceiveProgress, + }); + + Future> upload( + String path, { + required IFormData formData, + Map? headers, + ProgressCallback? onSendProgress, + }); +} diff --git a/packages/core/test/infrastructure/remote/interfaces/i_http_response.dart b/packages/core/test/infrastructure/remote/interfaces/i_http_response.dart new file mode 100644 index 0000000..461146a --- /dev/null +++ b/packages/core/test/infrastructure/remote/interfaces/i_http_response.dart @@ -0,0 +1,6 @@ +abstract class IHttpResponse { + T? get data; + int get statusCode; + Map? get headers; + bool get isSuccessful; +} diff --git a/packages/core/test/infrastructure/remote/interfaces/i_remote.dart b/packages/core/test/infrastructure/remote/interfaces/i_remote.dart new file mode 100644 index 0000000..648883b --- /dev/null +++ b/packages/core/test/infrastructure/remote/interfaces/i_remote.dart @@ -0,0 +1,4 @@ +abstract class IRemote{ + Future init(); +} + diff --git a/packages/core/test/injection/di_test.dart b/packages/core/test/injection/di_test.dart new file mode 100644 index 0000000..369847c --- /dev/null +++ b/packages/core/test/injection/di_test.dart @@ -0,0 +1,18 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:logger/logger.dart'; +import 'package:rasadyar_core/core.dart'; + +void main() { + setUp(() async { + await setupAllCoreProvider(); + }); + + group('di', () { + test('is ready', () { + expect(diCore.isRegistered(), isTrue); + expect(diCore.isRegistered(), isTrue); + expect(diCore.get(), isA()); + expect(diCore.get(), isA()); + }); + }); +} diff --git a/packages/core/test/presentation/common/app_color_test.dart b/packages/core/test/presentation/common/app_color_test.dart new file mode 100644 index 0000000..34a174f --- /dev/null +++ b/packages/core/test/presentation/common/app_color_test.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:rasadyar_core/presentation/common/app_color.dart'; + + +void main() { + group('AppColor', () { + test('blue colors', () { + expect(AppColor.blueLight, const Color(0xFFeaefff)); + expect(AppColor.blueLightHover, const Color(0xFFe0e7ff)); + expect(AppColor.blueLightActive, const Color(0xFFbecdff)); + expect(AppColor.blueNormal, const Color(0xFF2d5fff)); + expect(AppColor.blueNormalHover, const Color(0xFF2956e6)); + expect(AppColor.blueNormalActive, const Color(0xFF244ccc)); + expect(AppColor.blueDark, const Color(0xFF2247bf)); + expect(AppColor.blueDarkHover, const Color(0xFF1b3999)); + expect(AppColor.blueDarkActive, const Color(0xFF142b73)); + expect(AppColor.blueDarker, const Color(0xFF102159)); + }); + + test('green colors', () { + expect(AppColor.greenLight, const Color(0xFFe6faf5)); + expect(AppColor.greenLightHover, const Color(0xFFd9f7f0)); + expect(AppColor.greenLightActive, const Color(0xFFb0efdf)); + expect(AppColor.greenNormal, const Color(0xFF00cc99)); + expect(AppColor.greenNormalHover, const Color(0xFF00b88a)); + expect(AppColor.greenNormalActive, const Color(0xFF00a37a)); + expect(AppColor.greenDark, const Color(0xFF009973)); + expect(AppColor.greenDarkHover, const Color(0xFF007a5c)); + expect(AppColor.greenDarkActive, const Color(0xFF005c45)); + expect(AppColor.greenDarker, const Color(0xFF004736)); + }); + + test('category colors', () { + expect(AppColor.confirm, AppColor.greenNormalActive); + expect(AppColor.warning, AppColor.yellowNormal); + expect(AppColor.error, AppColor.redNormal); + expect(AppColor.info, AppColor.tealNormal); + }); + + + }); +} \ No newline at end of file diff --git a/packages/core/test/presentation/utils/color_utils_test.dart b/packages/core/test/presentation/utils/color_utils_test.dart new file mode 100644 index 0000000..c628757 --- /dev/null +++ b/packages/core/test/presentation/utils/color_utils_test.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; + +void main() { + group('ColorUtils extension', () { + const baseColor = Color(0xFF42A5F5); + + test('disabledColor returns color with alpha 38', () { + Color disabled = baseColor.disabledColor; + expect(disabled.a, 0.14901960784313725); + expect(disabled.r, baseColor.r); + expect(disabled.g, baseColor.g); + expect(disabled.b, baseColor.b); + }); + + test('hoverColor returns color darkened by 0.5', () { + Color hover = baseColor.hoverColor; + final expected = + HSLColor.fromColor( + baseColor, + ).withLightness((HSLColor.fromColor(baseColor).lightness - 0.5).clamp(0.0, 1.0)).toColor(); + expect(hover.g, expected.g); + }); + + test('pressedColor returns color darkened by 0.1', () { + Color pressed = baseColor.pressedColor; + final expected = + HSLColor.fromColor( + baseColor, + ).withLightness((HSLColor.fromColor(baseColor).lightness - 0.1).clamp(0.0, 1.0)).toColor(); + expect(pressed.r, expected.r); + }); + }); +} diff --git a/packages/core/test/presentation/utils/list_extensions_test.dart b/packages/core/test/presentation/utils/list_extensions_test.dart new file mode 100644 index 0000000..d3a3e76 --- /dev/null +++ b/packages/core/test/presentation/utils/list_extensions_test.dart @@ -0,0 +1,53 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:rasadyar_core/presentation/utils/list_extensions.dart'; + +void main(){ + group('toggle test', (){ + + List list = [1, 2, 3]; + + test('should remove item if it exists', () { + list.toggle(2); + expect(list, [1, 3]); + }); + + + test('should add item if it not exists', () { + list.toggle(10); + expect(list, [1, 3 , 10]); + }); + + + + + }); + group('insert to first item' ,(){ + + List list = [1, 2, 3]; + + test('should insert item at start if it does not exist', () { + list.ensureContainsAtStart(0); + expect(list, [0, 1, 2, 3]); + }); + + test('should not insert item at start if it already exists', () { + list.ensureContainsAtStart(2); + expect(list, [0, 1, 2, 3]); + }); + + + + }); + group('clear and add item' ,(){ + + List list = [1, 2, 3]; + + test('must be clear and add item ', () { + list.resetWith(20); + expect(list, [20]); + }); + + + + }); +} diff --git a/packages/inspection/build.yaml b/packages/inspection/build.yaml new file mode 100644 index 0000000..840029b --- /dev/null +++ b/packages/inspection/build.yaml @@ -0,0 +1,6 @@ +targets: + $default: + builders: + json_serializable: + options: + field_rename: snake \ No newline at end of file diff --git a/packages/inspection/lib/data/data_source/remote/auth/auth_remote.dart b/packages/inspection/lib/data/data_source/remote/auth/auth_remote.dart new file mode 100644 index 0000000..eacaeeb --- /dev/null +++ b/packages/inspection/lib/data/data_source/remote/auth/auth_remote.dart @@ -0,0 +1,14 @@ +import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; +import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; + +abstract class AuthRemote { + Future login({required Map authRequest}); + + Future captcha(); + + Future logout(); + + Future hasAuthenticated(); + + Future loginWithRefreshToken({required Map authRequest}); +} diff --git a/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart b/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart new file mode 100644 index 0000000..ff1b37e --- /dev/null +++ b/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart @@ -0,0 +1,72 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; +import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; + +import 'auth_remote.dart'; + +class AuthRemoteImp extends AuthRemote { + final DioRemote _httpClient; + final String _BASE_URL = 'auth/api/v1/'; + + AuthRemoteImp(this._httpClient); + + @override + Future login({required Map authRequest}) async { + var res = await _httpClient.post( + '${_BASE_URL}login/', + data: authRequest, + fromJson: AuthResponseModel.fromJson, + headers: {'Content-Type': 'application/json'}, + ); + return res.data; + } + + @override + Future captcha() async { + var res = await _httpClient.post( + 'captcha/', + fromJson: CaptchaResponseModel.fromJson, + ); + return res.data; + } + + @override + Future loginWithRefreshToken({ + required Map authRequest, + }) async { + var res = await _httpClient.post( + '$_BASE_URL/login/', + data: authRequest, + headers: {'Content-Type': 'application/json'}, + ); + return res.data; + } + + @override + Future logout() { + // TODO: implement logout + throw UnimplementedError(); + } + + @override + Future hasAuthenticated() async { + final response = await _httpClient.get( + '$_BASE_URL/login/', + headers: {'Content-Type': 'application/json'}, + ); + + return response.data ?? false; + } + +/* @override + Future getUserInfo(String phoneNumber) async { + var res = await _httpClient.post( + 'https://userbackend.rasadyaar.ir/api/send_otp/', + data: {"mobile": phoneNumber, "state": ""}, + fromJson: UserProfileModel.fromJson, + headers: {'Content-Type': 'application/json'}, + ); + return res.data; + }*/ +} diff --git a/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart new file mode 100644 index 0000000..467ea0c --- /dev/null +++ b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart @@ -0,0 +1,28 @@ +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; + +abstract class InspectionRemoteDataSource { + /// Fetches the inspection data for a given [inspectionId]. + /// + /// Returns a `Future` that resolves to a `Map` containing + /// the inspection data. + Future> fetchInspectionData(String inspectionId); + + /// Fetches the list of inspections for a given [userId]. + /// + /// Returns a `Future` that resolves to a `List>` + /// containing the list of inspections. + Future>> fetchInspections(String userId); + + Future?> getNearbyLocation({ + double? centerLat, + double? centerLng, + double? radius, + String? value, + }); + + Future?> getHatchingDetails({ + String? code, + bool? active, + }); +} diff --git a/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart new file mode 100644 index 0000000..ec636b2 --- /dev/null +++ b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart @@ -0,0 +1,62 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/data_source/remote/inspection/inspection_remote.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; + +class InspectionRemoteDataSourceImp implements InspectionRemoteDataSource { + final DioRemote _httpClient; + final String _BASE_URL = 'auth/api/v1/'; + + InspectionRemoteDataSourceImp(this._httpClient); + + @override + Future> fetchInspectionData(String inspectionId) { + // TODO: implement fetchInspectionData + throw UnimplementedError(); + } + + @override + Future>> fetchInspections(String userId) { + // TODO: implement fetchInspections + throw UnimplementedError(); + } + + @override + Future?> getNearbyLocation({ + double? centerLat, + double? centerLng, + double? radius, + String? value, + }) async { + DioRemote dioRemote = DioRemote(baseUrl: 'https://habackend.rasadyaar.ir/'); + await dioRemote.init(); + + var res = await dioRemote.get>( + 'poultry-loc/', + queryParameters: buildRawQueryParams( + centerLat: centerLat, + centerLng: centerLng, + radius: radius, + value: value, + ), + headers: {'Content-Type': 'application/json'}, + fromJsonListAsync: (json) async => + parseListInIsolate(json, (json) => PoultryLocationModel.fromJson(json)), + ); + + return res.data; + } + + @override + Future?> getHatchingDetails({String? code, bool? active}) async { + DioRemote dioRemote = DioRemote(baseUrl: 'https://habackend.rasadyaar.ir/'); + await dioRemote.init(); + var res = await dioRemote.get( + "get_hatching_for_bazrasi/", + queryParameters: buildRawQueryParams(queryParams: {'code': code, 'active': active}), + headers: {'Content-Type': 'application/json'}, + fromJsonList: (json) => json.map((e) => HatchingDetails.fromJson(e)).toList(), + ); + return res.data; + } +} diff --git a/packages/inspection/lib/data/data_source/remote/user/user_data_source.dart b/packages/inspection/lib/data/data_source/remote/user/user_data_source.dart new file mode 100644 index 0000000..7d013a7 --- /dev/null +++ b/packages/inspection/lib/data/data_source/remote/user/user_data_source.dart @@ -0,0 +1,8 @@ + +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; + +abstract class UserRemoteDataSource { + + Future getProfile({required String token}); + +} \ No newline at end of file diff --git a/packages/inspection/lib/data/data_source/remote/user/user_data_source_imp.dart b/packages/inspection/lib/data/data_source/remote/user/user_data_source_imp.dart new file mode 100644 index 0000000..da0a32f --- /dev/null +++ b/packages/inspection/lib/data/data_source/remote/user/user_data_source_imp.dart @@ -0,0 +1,25 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/data_source/remote/user/user_data_source.dart'; +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; + +class UserRemoteDataSourceImp extends UserRemoteDataSource { + final DioRemote _httpClient; + final String _BASE_URL = 'auth/api/v1/'; + + UserRemoteDataSourceImp(this._httpClient); + + @override + Future getProfile({required String token}) async { + var res = await _httpClient.get( + '${_BASE_URL}user/profile/', + fromJson: UserProfileModel.fromJson, + headers: {'Content-Type': 'application/json', 'Authorization': 'Bearer $token'}, + ); + + if (res.data == null) { + throw Exception('Failed to load user profile'); + } + + return res.data!; + } +} diff --git a/packages/inspection/lib/data/model/request/login_request/login_request_model.dart b/packages/inspection/lib/data/model/request/login_request/login_request_model.dart new file mode 100644 index 0000000..0e76bc2 --- /dev/null +++ b/packages/inspection/lib/data/model/request/login_request/login_request_model.dart @@ -0,0 +1,34 @@ +import 'package:rasadyar_core/core.dart'; + +part 'login_request_model.freezed.dart'; +part 'login_request_model.g.dart'; + +@freezed +abstract class LoginRequestModel with _$LoginRequestModel { + const factory LoginRequestModel({ + String? username, + String? password, + String? captchaCode, + String? captchaKey, + }) = _LoginRequestModel; + + factory LoginRequestModel.createWithCaptcha({ + required String username, + required String password, + required String captchaCode, + required String captchaKey, + }) { + return LoginRequestModel( + username: username, + password: password, + captchaCode: captchaCode, + captchaKey: 'rest_captcha_$captchaKey.0', + ); + } + + factory LoginRequestModel.fromJson(Map json) => + _$LoginRequestModelFromJson(json); + + const LoginRequestModel._(); + +} diff --git a/packages/inspection/lib/data/model/request/login_request/login_request_model.freezed.dart b/packages/inspection/lib/data/model/request/login_request/login_request_model.freezed.dart new file mode 100644 index 0000000..9b91ad6 --- /dev/null +++ b/packages/inspection/lib/data/model/request/login_request/login_request_model.freezed.dart @@ -0,0 +1,286 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'login_request_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$LoginRequestModel { + + String? get username; String? get password; String? get captchaCode; String? get captchaKey; +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LoginRequestModelCopyWith get copyWith => _$LoginRequestModelCopyWithImpl(this as LoginRequestModel, _$identity); + + /// Serializes this LoginRequestModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LoginRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.captchaCode, captchaCode) || other.captchaCode == captchaCode)&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,username,password,captchaCode,captchaKey); + +@override +String toString() { + return 'LoginRequestModel(username: $username, password: $password, captchaCode: $captchaCode, captchaKey: $captchaKey)'; +} + + +} + +/// @nodoc +abstract mixin class $LoginRequestModelCopyWith<$Res> { + factory $LoginRequestModelCopyWith(LoginRequestModel value, $Res Function(LoginRequestModel) _then) = _$LoginRequestModelCopyWithImpl; +@useResult +$Res call({ + String? username, String? password, String? captchaCode, String? captchaKey +}); + + + + +} +/// @nodoc +class _$LoginRequestModelCopyWithImpl<$Res> + implements $LoginRequestModelCopyWith<$Res> { + _$LoginRequestModelCopyWithImpl(this._self, this._then); + + final LoginRequestModel _self; + final $Res Function(LoginRequestModel) _then; + +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,Object? captchaCode = freezed,Object? captchaKey = freezed,}) { + return _then(_self.copyWith( +username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?,captchaCode: freezed == captchaCode ? _self.captchaCode : captchaCode // ignore: cast_nullable_to_non_nullable +as String?,captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [LoginRequestModel]. +extension LoginRequestModelPatterns on LoginRequestModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LoginRequestModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LoginRequestModel value) $default,){ +final _that = this; +switch (_that) { +case _LoginRequestModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LoginRequestModel value)? $default,){ +final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? username, String? password, String? captchaCode, String? captchaKey)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? username, String? password, String? captchaCode, String? captchaKey) $default,) {final _that = this; +switch (_that) { +case _LoginRequestModel(): +return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? username, String? password, String? captchaCode, String? captchaKey)? $default,) {final _that = this; +switch (_that) { +case _LoginRequestModel() when $default != null: +return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _LoginRequestModel extends LoginRequestModel { + const _LoginRequestModel({this.username, this.password, this.captchaCode, this.captchaKey}): super._(); + factory _LoginRequestModel.fromJson(Map json) => _$LoginRequestModelFromJson(json); + +@override final String? username; +@override final String? password; +@override final String? captchaCode; +@override final String? captchaKey; + +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LoginRequestModelCopyWith<_LoginRequestModel> get copyWith => __$LoginRequestModelCopyWithImpl<_LoginRequestModel>(this, _$identity); + +@override +Map toJson() { + return _$LoginRequestModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoginRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.captchaCode, captchaCode) || other.captchaCode == captchaCode)&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,username,password,captchaCode,captchaKey); + +@override +String toString() { + return 'LoginRequestModel(username: $username, password: $password, captchaCode: $captchaCode, captchaKey: $captchaKey)'; +} + + +} + +/// @nodoc +abstract mixin class _$LoginRequestModelCopyWith<$Res> implements $LoginRequestModelCopyWith<$Res> { + factory _$LoginRequestModelCopyWith(_LoginRequestModel value, $Res Function(_LoginRequestModel) _then) = __$LoginRequestModelCopyWithImpl; +@override @useResult +$Res call({ + String? username, String? password, String? captchaCode, String? captchaKey +}); + + + + +} +/// @nodoc +class __$LoginRequestModelCopyWithImpl<$Res> + implements _$LoginRequestModelCopyWith<$Res> { + __$LoginRequestModelCopyWithImpl(this._self, this._then); + + final _LoginRequestModel _self; + final $Res Function(_LoginRequestModel) _then; + +/// Create a copy of LoginRequestModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,Object? captchaCode = freezed,Object? captchaKey = freezed,}) { + return _then(_LoginRequestModel( +username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String?,captchaCode: freezed == captchaCode ? _self.captchaCode : captchaCode // ignore: cast_nullable_to_non_nullable +as String?,captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/inspection/lib/data/model/request/login_request/login_request_model.g.dart b/packages/inspection/lib/data/model/request/login_request/login_request_model.g.dart new file mode 100644 index 0000000..4504142 --- /dev/null +++ b/packages/inspection/lib/data/model/request/login_request/login_request_model.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'login_request_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_LoginRequestModel _$LoginRequestModelFromJson(Map json) => + _LoginRequestModel( + username: json['username'] as String?, + password: json['password'] as String?, + captchaCode: json['captcha_code'] as String?, + captchaKey: json['captcha_key'] as String?, + ); + +Map _$LoginRequestModelToJson(_LoginRequestModel instance) => + { + 'username': instance.username, + 'password': instance.password, + 'captcha_code': instance.captchaCode, + 'captcha_key': instance.captchaKey, + }; diff --git a/packages/inspection/lib/data/model/response/auth/auth_response_model.dart b/packages/inspection/lib/data/model/response/auth/auth_response_model.dart new file mode 100644 index 0000000..1f5faba --- /dev/null +++ b/packages/inspection/lib/data/model/response/auth/auth_response_model.dart @@ -0,0 +1,20 @@ + + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'auth_response_model.freezed.dart'; +part 'auth_response_model.g.dart'; + +@freezed +abstract class AuthResponseModel with _$AuthResponseModel { + const factory AuthResponseModel({ + String? refresh, + String? access, + bool? otpStatus, + }) = _AuthResponseModel; + + factory AuthResponseModel.fromJson(Map json) => + _$AuthResponseModelFromJson(json); + +} + diff --git a/packages/inspection/lib/data/model/response/auth/auth_response_model.freezed.dart b/packages/inspection/lib/data/model/response/auth/auth_response_model.freezed.dart new file mode 100644 index 0000000..fdca0fc --- /dev/null +++ b/packages/inspection/lib/data/model/response/auth/auth_response_model.freezed.dart @@ -0,0 +1,283 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'auth_response_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$AuthResponseModel { + + String? get refresh; String? get access; bool? get otpStatus; +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AuthResponseModelCopyWith get copyWith => _$AuthResponseModelCopyWithImpl(this as AuthResponseModel, _$identity); + + /// Serializes this AuthResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthResponseModel&&(identical(other.refresh, refresh) || other.refresh == refresh)&&(identical(other.access, access) || other.access == access)&&(identical(other.otpStatus, otpStatus) || other.otpStatus == otpStatus)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,refresh,access,otpStatus); + +@override +String toString() { + return 'AuthResponseModel(refresh: $refresh, access: $access, otpStatus: $otpStatus)'; +} + + +} + +/// @nodoc +abstract mixin class $AuthResponseModelCopyWith<$Res> { + factory $AuthResponseModelCopyWith(AuthResponseModel value, $Res Function(AuthResponseModel) _then) = _$AuthResponseModelCopyWithImpl; +@useResult +$Res call({ + String? refresh, String? access, bool? otpStatus +}); + + + + +} +/// @nodoc +class _$AuthResponseModelCopyWithImpl<$Res> + implements $AuthResponseModelCopyWith<$Res> { + _$AuthResponseModelCopyWithImpl(this._self, this._then); + + final AuthResponseModel _self; + final $Res Function(AuthResponseModel) _then; + +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? refresh = freezed,Object? access = freezed,Object? otpStatus = freezed,}) { + return _then(_self.copyWith( +refresh: freezed == refresh ? _self.refresh : refresh // ignore: cast_nullable_to_non_nullable +as String?,access: freezed == access ? _self.access : access // ignore: cast_nullable_to_non_nullable +as String?,otpStatus: freezed == otpStatus ? _self.otpStatus : otpStatus // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AuthResponseModel]. +extension AuthResponseModelPatterns on AuthResponseModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AuthResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AuthResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _AuthResponseModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AuthResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? refresh, String? access, bool? otpStatus)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that.refresh,_that.access,_that.otpStatus);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? refresh, String? access, bool? otpStatus) $default,) {final _that = this; +switch (_that) { +case _AuthResponseModel(): +return $default(_that.refresh,_that.access,_that.otpStatus);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? refresh, String? access, bool? otpStatus)? $default,) {final _that = this; +switch (_that) { +case _AuthResponseModel() when $default != null: +return $default(_that.refresh,_that.access,_that.otpStatus);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _AuthResponseModel implements AuthResponseModel { + const _AuthResponseModel({this.refresh, this.access, this.otpStatus}); + factory _AuthResponseModel.fromJson(Map json) => _$AuthResponseModelFromJson(json); + +@override final String? refresh; +@override final String? access; +@override final bool? otpStatus; + +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AuthResponseModelCopyWith<_AuthResponseModel> get copyWith => __$AuthResponseModelCopyWithImpl<_AuthResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$AuthResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthResponseModel&&(identical(other.refresh, refresh) || other.refresh == refresh)&&(identical(other.access, access) || other.access == access)&&(identical(other.otpStatus, otpStatus) || other.otpStatus == otpStatus)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,refresh,access,otpStatus); + +@override +String toString() { + return 'AuthResponseModel(refresh: $refresh, access: $access, otpStatus: $otpStatus)'; +} + + +} + +/// @nodoc +abstract mixin class _$AuthResponseModelCopyWith<$Res> implements $AuthResponseModelCopyWith<$Res> { + factory _$AuthResponseModelCopyWith(_AuthResponseModel value, $Res Function(_AuthResponseModel) _then) = __$AuthResponseModelCopyWithImpl; +@override @useResult +$Res call({ + String? refresh, String? access, bool? otpStatus +}); + + + + +} +/// @nodoc +class __$AuthResponseModelCopyWithImpl<$Res> + implements _$AuthResponseModelCopyWith<$Res> { + __$AuthResponseModelCopyWithImpl(this._self, this._then); + + final _AuthResponseModel _self; + final $Res Function(_AuthResponseModel) _then; + +/// Create a copy of AuthResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? refresh = freezed,Object? access = freezed,Object? otpStatus = freezed,}) { + return _then(_AuthResponseModel( +refresh: freezed == refresh ? _self.refresh : refresh // ignore: cast_nullable_to_non_nullable +as String?,access: freezed == access ? _self.access : access // ignore: cast_nullable_to_non_nullable +as String?,otpStatus: freezed == otpStatus ? _self.otpStatus : otpStatus // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/inspection/lib/data/model/response/auth/auth_response_model.g.dart b/packages/inspection/lib/data/model/response/auth/auth_response_model.g.dart new file mode 100644 index 0000000..dc5d66d --- /dev/null +++ b/packages/inspection/lib/data/model/response/auth/auth_response_model.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_response_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_AuthResponseModel _$AuthResponseModelFromJson(Map json) => + _AuthResponseModel( + refresh: json['refresh'] as String?, + access: json['access'] as String?, + otpStatus: json['otp_status'] as bool?, + ); + +Map _$AuthResponseModelToJson(_AuthResponseModel instance) => + { + 'refresh': instance.refresh, + 'access': instance.access, + 'otp_status': instance.otpStatus, + }; diff --git a/packages/inspection/lib/data/model/response/captcha/captcha_response_model.dart b/packages/inspection/lib/data/model/response/captcha/captcha_response_model.dart new file mode 100644 index 0000000..2b2f986 --- /dev/null +++ b/packages/inspection/lib/data/model/response/captcha/captcha_response_model.dart @@ -0,0 +1,17 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'captcha_response_model.freezed.dart'; +part 'captcha_response_model.g.dart'; + +@freezed +abstract class CaptchaResponseModel with _$CaptchaResponseModel { + const factory CaptchaResponseModel({ + String? captchaKey, + String? captchaImage, + String? imageType, + String? imageDecode, + }) = _CaptchaResponseModel; + + factory CaptchaResponseModel.fromJson(Map json) => + _$CaptchaResponseModelFromJson(json); +} diff --git a/packages/inspection/lib/data/model/response/captcha/captcha_response_model.freezed.dart b/packages/inspection/lib/data/model/response/captcha/captcha_response_model.freezed.dart new file mode 100644 index 0000000..33d0167 --- /dev/null +++ b/packages/inspection/lib/data/model/response/captcha/captcha_response_model.freezed.dart @@ -0,0 +1,286 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'captcha_response_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$CaptchaResponseModel { + + String? get captchaKey; String? get captchaImage; String? get imageType; String? get imageDecode; +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CaptchaResponseModelCopyWith get copyWith => _$CaptchaResponseModelCopyWithImpl(this as CaptchaResponseModel, _$identity); + + /// Serializes this CaptchaResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CaptchaResponseModel&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)&&(identical(other.captchaImage, captchaImage) || other.captchaImage == captchaImage)&&(identical(other.imageType, imageType) || other.imageType == imageType)&&(identical(other.imageDecode, imageDecode) || other.imageDecode == imageDecode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,captchaKey,captchaImage,imageType,imageDecode); + +@override +String toString() { + return 'CaptchaResponseModel(captchaKey: $captchaKey, captchaImage: $captchaImage, imageType: $imageType, imageDecode: $imageDecode)'; +} + + +} + +/// @nodoc +abstract mixin class $CaptchaResponseModelCopyWith<$Res> { + factory $CaptchaResponseModelCopyWith(CaptchaResponseModel value, $Res Function(CaptchaResponseModel) _then) = _$CaptchaResponseModelCopyWithImpl; +@useResult +$Res call({ + String? captchaKey, String? captchaImage, String? imageType, String? imageDecode +}); + + + + +} +/// @nodoc +class _$CaptchaResponseModelCopyWithImpl<$Res> + implements $CaptchaResponseModelCopyWith<$Res> { + _$CaptchaResponseModelCopyWithImpl(this._self, this._then); + + final CaptchaResponseModel _self; + final $Res Function(CaptchaResponseModel) _then; + +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? captchaKey = freezed,Object? captchaImage = freezed,Object? imageType = freezed,Object? imageDecode = freezed,}) { + return _then(_self.copyWith( +captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?,captchaImage: freezed == captchaImage ? _self.captchaImage : captchaImage // ignore: cast_nullable_to_non_nullable +as String?,imageType: freezed == imageType ? _self.imageType : imageType // ignore: cast_nullable_to_non_nullable +as String?,imageDecode: freezed == imageDecode ? _self.imageDecode : imageDecode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CaptchaResponseModel]. +extension CaptchaResponseModelPatterns on CaptchaResponseModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CaptchaResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CaptchaResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _CaptchaResponseModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CaptchaResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode) $default,) {final _that = this; +switch (_that) { +case _CaptchaResponseModel(): +return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode)? $default,) {final _that = this; +switch (_that) { +case _CaptchaResponseModel() when $default != null: +return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CaptchaResponseModel implements CaptchaResponseModel { + const _CaptchaResponseModel({this.captchaKey, this.captchaImage, this.imageType, this.imageDecode}); + factory _CaptchaResponseModel.fromJson(Map json) => _$CaptchaResponseModelFromJson(json); + +@override final String? captchaKey; +@override final String? captchaImage; +@override final String? imageType; +@override final String? imageDecode; + +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CaptchaResponseModelCopyWith<_CaptchaResponseModel> get copyWith => __$CaptchaResponseModelCopyWithImpl<_CaptchaResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$CaptchaResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CaptchaResponseModel&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)&&(identical(other.captchaImage, captchaImage) || other.captchaImage == captchaImage)&&(identical(other.imageType, imageType) || other.imageType == imageType)&&(identical(other.imageDecode, imageDecode) || other.imageDecode == imageDecode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,captchaKey,captchaImage,imageType,imageDecode); + +@override +String toString() { + return 'CaptchaResponseModel(captchaKey: $captchaKey, captchaImage: $captchaImage, imageType: $imageType, imageDecode: $imageDecode)'; +} + + +} + +/// @nodoc +abstract mixin class _$CaptchaResponseModelCopyWith<$Res> implements $CaptchaResponseModelCopyWith<$Res> { + factory _$CaptchaResponseModelCopyWith(_CaptchaResponseModel value, $Res Function(_CaptchaResponseModel) _then) = __$CaptchaResponseModelCopyWithImpl; +@override @useResult +$Res call({ + String? captchaKey, String? captchaImage, String? imageType, String? imageDecode +}); + + + + +} +/// @nodoc +class __$CaptchaResponseModelCopyWithImpl<$Res> + implements _$CaptchaResponseModelCopyWith<$Res> { + __$CaptchaResponseModelCopyWithImpl(this._self, this._then); + + final _CaptchaResponseModel _self; + final $Res Function(_CaptchaResponseModel) _then; + +/// Create a copy of CaptchaResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? captchaKey = freezed,Object? captchaImage = freezed,Object? imageType = freezed,Object? imageDecode = freezed,}) { + return _then(_CaptchaResponseModel( +captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable +as String?,captchaImage: freezed == captchaImage ? _self.captchaImage : captchaImage // ignore: cast_nullable_to_non_nullable +as String?,imageType: freezed == imageType ? _self.imageType : imageType // ignore: cast_nullable_to_non_nullable +as String?,imageDecode: freezed == imageDecode ? _self.imageDecode : imageDecode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/inspection/lib/data/model/response/captcha/captcha_response_model.g.dart b/packages/inspection/lib/data/model/response/captcha/captcha_response_model.g.dart new file mode 100644 index 0000000..8d69248 --- /dev/null +++ b/packages/inspection/lib/data/model/response/captcha/captcha_response_model.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'captcha_response_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_CaptchaResponseModel _$CaptchaResponseModelFromJson( + Map json, +) => _CaptchaResponseModel( + captchaKey: json['captcha_key'] as String?, + captchaImage: json['captcha_image'] as String?, + imageType: json['image_type'] as String?, + imageDecode: json['image_decode'] as String?, +); + +Map _$CaptchaResponseModelToJson( + _CaptchaResponseModel instance, +) => { + 'captcha_key': instance.captchaKey, + 'captcha_image': instance.captchaImage, + 'image_type': instance.imageType, + 'image_decode': instance.imageDecode, +}; diff --git a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart new file mode 100644 index 0000000..de8e28a --- /dev/null +++ b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart @@ -0,0 +1,210 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'hatching_details.freezed.dart'; +part 'hatching_details.g.dart'; + +@freezed +abstract class HatchingDetails with _$HatchingDetails { + const factory HatchingDetails({ + int? id, + String? chainCompany, + int? age, + dynamic inspectionLosses, + VetFarm? vetFarm, + ActiveKill? activeKill, + KillingInfo? killingInfo, + FreeGovernmentalInfo? freeGovernmentalInfo, + String? key, + DateTime? createDate, + DateTime? modifyDate, + bool? trash, + bool? hasChainCompany, + dynamic poultryIdForeignKey, + dynamic poultryHatchingIdKey, + int? quantity, + int? losses, + int? leftOver, + int? killedQuantity, + int? extraKilledQuantity, + double? governmentalKilledQuantity, + double? governmentalQuantity, + double? freeKilledQuantity, + double? freeQuantity, + double? chainKilledQuantity, + double? chainKilledWeight, + double? outProvinceKilledWeight, + double? outProvinceKilledQuantity, + double? exportKilledWeight, + double? exportKilledQuantity, + double? totalCommitment, + String? commitmentType, + double? totalCommitmentQuantity, + double? totalFreeCommitmentQuantity, + double? totalFreeCommitmentWeight, + double? totalKilledWeight, + double? totalAverageKilledWeight, + int? requestLeftOver, + int? hall, + DateTime? date, + DateTime? predicateDate, + String? chickenBreed, + int? period, + String? allowHatching, + String? state, + bool? archive, + bool? violation, + dynamic message, + dynamic registrar, + List? breed, + int? cityNumber, + String? cityName, + int? provinceNumber, + String? provinceName, + LastChange? lastChange, + int? chickenAge, + int? nowAge, + LatestHatchingChange? latestHatchingChange, + dynamic violationReport, + String? violationMessage, + dynamic violationImage, + dynamic violationReporter, + dynamic violationReportDate, + dynamic violationReportEditor, + dynamic violationReportEditDate, + int? totalLosses, + int? directLosses, + dynamic directLossesInputer, + dynamic directLossesDate, + dynamic directLossesEditor, + dynamic directLossesLastEditDate, + dynamic endPeriodLossesInputer, + dynamic endPeriodLossesDate, + dynamic endPeriodLossesEditor, + dynamic endPeriodLossesLastEditDate, + String? breedingUniqueId, + String? licenceNumber, + bool? temporaryTrash, + bool? temporaryDeleted, + dynamic firstDateInputArchive, + dynamic secondDateInputArchive, + dynamic inputArchiver, + dynamic outputArchiveDate, + dynamic outputArchiver, + double? barDifferenceRequestWeight, + double? barDifferenceRequestQuantity, + dynamic healthCertificate, + int? samasatDischargePercentage, + String? personTypeName, + String? interactTypeName, + String? unionTypeName, + String? certId, + int? increaseQuantity, + dynamic tenantFullname, + dynamic tenantNationalCode, + dynamic tenantMobile, + dynamic tenantCity, + bool? hasTenant, + dynamic createdBy, + dynamic modifiedBy, + int? poultry, + }) = _HatchingDetails; + + factory HatchingDetails.fromJson(Map json) => + _$HatchingDetailsFromJson(json); +} + +@freezed +abstract class VetFarm with _$VetFarm { + const factory VetFarm({ + String? vetFarmFullName, + String? vetFarmMobile, + }) = _VetFarm; + + factory VetFarm.fromJson(Map json) => + _$VetFarmFromJson(json); +} + +@freezed +abstract class ActiveKill with _$ActiveKill { + const factory ActiveKill({ + bool? activeKill, + int? countOfRequest, + }) = _ActiveKill; + + factory ActiveKill.fromJson(Map json) => + _$ActiveKillFromJson(json); +} + +@freezed +abstract class KillingInfo with _$KillingInfo { + const factory KillingInfo({ + String? violationMessage, + int? provinceKillRequests, + int? provinceKillRequestsQuantity, + double? provinceKillRequestsWeight, + int? killHouseRequests, + int? killHouseRequestsFirstQuantity, + double? killHouseRequestsFirstWeight, + int? barCompleteWithKillHouse, + int? acceptedRealQuantityFinal, + double? acceptedRealWightFinal, + int? wareHouseBars, + int? wareHouseBarsQuantity, + double? wareHouseBarsWeight, + double? wareHouseBarsWeightLose, + }) = _KillingInfo; + + factory KillingInfo.fromJson(Map json) => + _$KillingInfoFromJson(json); +} + +@freezed +abstract class FreeGovernmentalInfo with _$FreeGovernmentalInfo { + const factory FreeGovernmentalInfo({ + int? governmentalAllocatedQuantity, + double? totalCommitmentQuantity, + int? freeAllocatedQuantity, + double? totalFreeCommitmentQuantity, + int? leftTotalFreeCommitmentQuantity, + }) = _FreeGovernmentalInfo; + + factory FreeGovernmentalInfo.fromJson(Map json) => + _$FreeGovernmentalInfoFromJson(json); +} + +@freezed +abstract class Breed with _$Breed { + const factory Breed({ + String? breed, + int? mainQuantity, + int? remainQuantity, + }) = _Breed; + + factory Breed.fromJson(Map json) => + _$BreedFromJson(json); +} + +@freezed +abstract class LastChange with _$LastChange { + const factory LastChange({ + DateTime? date, + String? role, + String? type, + String? fullName, + }) = _LastChange; + + factory LastChange.fromJson(Map json) => + _$LastChangeFromJson(json); +} + +@freezed +abstract class LatestHatchingChange with _$LatestHatchingChange { + const factory LatestHatchingChange({ + DateTime? date, + String? role, + String? fullName, + }) = _LatestHatchingChange; + + factory LatestHatchingChange.fromJson(Map json) => + _$LatestHatchingChangeFromJson(json); +} diff --git a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart new file mode 100644 index 0000000..2bbf91e --- /dev/null +++ b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart @@ -0,0 +1,2648 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'hatching_details.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$HatchingDetails { + + int? get id; String? get chainCompany; int? get age; dynamic get inspectionLosses; VetFarm? get vetFarm; ActiveKill? get activeKill; KillingInfo? get killingInfo; FreeGovernmentalInfo? get freeGovernmentalInfo; String? get key; DateTime? get createDate; DateTime? get modifyDate; bool? get trash; bool? get hasChainCompany; dynamic get poultryIdForeignKey; dynamic get poultryHatchingIdKey; int? get quantity; int? get losses; int? get leftOver; int? get killedQuantity; int? get extraKilledQuantity; double? get governmentalKilledQuantity; double? get governmentalQuantity; double? get freeKilledQuantity; double? get freeQuantity; double? get chainKilledQuantity; double? get chainKilledWeight; double? get outProvinceKilledWeight; double? get outProvinceKilledQuantity; double? get exportKilledWeight; double? get exportKilledQuantity; double? get totalCommitment; String? get commitmentType; double? get totalCommitmentQuantity; double? get totalFreeCommitmentQuantity; double? get totalFreeCommitmentWeight; double? get totalKilledWeight; double? get totalAverageKilledWeight; int? get requestLeftOver; int? get hall; DateTime? get date; DateTime? get predicateDate; String? get chickenBreed; int? get period; String? get allowHatching; String? get state; bool? get archive; bool? get violation; dynamic get message; dynamic get registrar; List? get breed; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; LastChange? get lastChange; int? get chickenAge; int? get nowAge; LatestHatchingChange? get latestHatchingChange; dynamic get violationReport; String? get violationMessage; dynamic get violationImage; dynamic get violationReporter; dynamic get violationReportDate; dynamic get violationReportEditor; dynamic get violationReportEditDate; int? get totalLosses; int? get directLosses; dynamic get directLossesInputer; dynamic get directLossesDate; dynamic get directLossesEditor; dynamic get directLossesLastEditDate; dynamic get endPeriodLossesInputer; dynamic get endPeriodLossesDate; dynamic get endPeriodLossesEditor; dynamic get endPeriodLossesLastEditDate; String? get breedingUniqueId; String? get licenceNumber; bool? get temporaryTrash; bool? get temporaryDeleted; dynamic get firstDateInputArchive; dynamic get secondDateInputArchive; dynamic get inputArchiver; dynamic get outputArchiveDate; dynamic get outputArchiver; double? get barDifferenceRequestWeight; double? get barDifferenceRequestQuantity; dynamic get healthCertificate; int? get samasatDischargePercentage; String? get personTypeName; String? get interactTypeName; String? get unionTypeName; String? get certId; int? get increaseQuantity; dynamic get tenantFullname; dynamic get tenantNationalCode; dynamic get tenantMobile; dynamic get tenantCity; bool? get hasTenant; dynamic get createdBy; dynamic get modifiedBy; int? get poultry; +/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$HatchingDetailsCopyWith get copyWith => _$HatchingDetailsCopyWithImpl(this as HatchingDetails, _$identity); + + /// Serializes this HatchingDetails to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is HatchingDetails&&(identical(other.id, id) || other.id == id)&&(identical(other.chainCompany, chainCompany) || other.chainCompany == chainCompany)&&(identical(other.age, age) || other.age == age)&&const DeepCollectionEquality().equals(other.inspectionLosses, inspectionLosses)&&(identical(other.vetFarm, vetFarm) || other.vetFarm == vetFarm)&&(identical(other.activeKill, activeKill) || other.activeKill == activeKill)&&(identical(other.killingInfo, killingInfo) || other.killingInfo == killingInfo)&&(identical(other.freeGovernmentalInfo, freeGovernmentalInfo) || other.freeGovernmentalInfo == freeGovernmentalInfo)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.hasChainCompany, hasChainCompany) || other.hasChainCompany == hasChainCompany)&&const DeepCollectionEquality().equals(other.poultryIdForeignKey, poultryIdForeignKey)&&const DeepCollectionEquality().equals(other.poultryHatchingIdKey, poultryHatchingIdKey)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.losses, losses) || other.losses == losses)&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.killedQuantity, killedQuantity) || other.killedQuantity == killedQuantity)&&(identical(other.extraKilledQuantity, extraKilledQuantity) || other.extraKilledQuantity == extraKilledQuantity)&&(identical(other.governmentalKilledQuantity, governmentalKilledQuantity) || other.governmentalKilledQuantity == governmentalKilledQuantity)&&(identical(other.governmentalQuantity, governmentalQuantity) || other.governmentalQuantity == governmentalQuantity)&&(identical(other.freeKilledQuantity, freeKilledQuantity) || other.freeKilledQuantity == freeKilledQuantity)&&(identical(other.freeQuantity, freeQuantity) || other.freeQuantity == freeQuantity)&&(identical(other.chainKilledQuantity, chainKilledQuantity) || other.chainKilledQuantity == chainKilledQuantity)&&(identical(other.chainKilledWeight, chainKilledWeight) || other.chainKilledWeight == chainKilledWeight)&&(identical(other.outProvinceKilledWeight, outProvinceKilledWeight) || other.outProvinceKilledWeight == outProvinceKilledWeight)&&(identical(other.outProvinceKilledQuantity, outProvinceKilledQuantity) || other.outProvinceKilledQuantity == outProvinceKilledQuantity)&&(identical(other.exportKilledWeight, exportKilledWeight) || other.exportKilledWeight == exportKilledWeight)&&(identical(other.exportKilledQuantity, exportKilledQuantity) || other.exportKilledQuantity == exportKilledQuantity)&&(identical(other.totalCommitment, totalCommitment) || other.totalCommitment == totalCommitment)&&(identical(other.commitmentType, commitmentType) || other.commitmentType == commitmentType)&&(identical(other.totalCommitmentQuantity, totalCommitmentQuantity) || other.totalCommitmentQuantity == totalCommitmentQuantity)&&(identical(other.totalFreeCommitmentQuantity, totalFreeCommitmentQuantity) || other.totalFreeCommitmentQuantity == totalFreeCommitmentQuantity)&&(identical(other.totalFreeCommitmentWeight, totalFreeCommitmentWeight) || other.totalFreeCommitmentWeight == totalFreeCommitmentWeight)&&(identical(other.totalKilledWeight, totalKilledWeight) || other.totalKilledWeight == totalKilledWeight)&&(identical(other.totalAverageKilledWeight, totalAverageKilledWeight) || other.totalAverageKilledWeight == totalAverageKilledWeight)&&(identical(other.requestLeftOver, requestLeftOver) || other.requestLeftOver == requestLeftOver)&&(identical(other.hall, hall) || other.hall == hall)&&(identical(other.date, date) || other.date == date)&&(identical(other.predicateDate, predicateDate) || other.predicateDate == predicateDate)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.period, period) || other.period == period)&&(identical(other.allowHatching, allowHatching) || other.allowHatching == allowHatching)&&(identical(other.state, state) || other.state == state)&&(identical(other.archive, archive) || other.archive == archive)&&(identical(other.violation, violation) || other.violation == violation)&&const DeepCollectionEquality().equals(other.message, message)&&const DeepCollectionEquality().equals(other.registrar, registrar)&&const DeepCollectionEquality().equals(other.breed, breed)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.lastChange, lastChange) || other.lastChange == lastChange)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.nowAge, nowAge) || other.nowAge == nowAge)&&(identical(other.latestHatchingChange, latestHatchingChange) || other.latestHatchingChange == latestHatchingChange)&&const DeepCollectionEquality().equals(other.violationReport, violationReport)&&(identical(other.violationMessage, violationMessage) || other.violationMessage == violationMessage)&&const DeepCollectionEquality().equals(other.violationImage, violationImage)&&const DeepCollectionEquality().equals(other.violationReporter, violationReporter)&&const DeepCollectionEquality().equals(other.violationReportDate, violationReportDate)&&const DeepCollectionEquality().equals(other.violationReportEditor, violationReportEditor)&&const DeepCollectionEquality().equals(other.violationReportEditDate, violationReportEditDate)&&(identical(other.totalLosses, totalLosses) || other.totalLosses == totalLosses)&&(identical(other.directLosses, directLosses) || other.directLosses == directLosses)&&const DeepCollectionEquality().equals(other.directLossesInputer, directLossesInputer)&&const DeepCollectionEquality().equals(other.directLossesDate, directLossesDate)&&const DeepCollectionEquality().equals(other.directLossesEditor, directLossesEditor)&&const DeepCollectionEquality().equals(other.directLossesLastEditDate, directLossesLastEditDate)&&const DeepCollectionEquality().equals(other.endPeriodLossesInputer, endPeriodLossesInputer)&&const DeepCollectionEquality().equals(other.endPeriodLossesDate, endPeriodLossesDate)&&const DeepCollectionEquality().equals(other.endPeriodLossesEditor, endPeriodLossesEditor)&&const DeepCollectionEquality().equals(other.endPeriodLossesLastEditDate, endPeriodLossesLastEditDate)&&(identical(other.breedingUniqueId, breedingUniqueId) || other.breedingUniqueId == breedingUniqueId)&&(identical(other.licenceNumber, licenceNumber) || other.licenceNumber == licenceNumber)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.firstDateInputArchive, firstDateInputArchive)&&const DeepCollectionEquality().equals(other.secondDateInputArchive, secondDateInputArchive)&&const DeepCollectionEquality().equals(other.inputArchiver, inputArchiver)&&const DeepCollectionEquality().equals(other.outputArchiveDate, outputArchiveDate)&&const DeepCollectionEquality().equals(other.outputArchiver, outputArchiver)&&(identical(other.barDifferenceRequestWeight, barDifferenceRequestWeight) || other.barDifferenceRequestWeight == barDifferenceRequestWeight)&&(identical(other.barDifferenceRequestQuantity, barDifferenceRequestQuantity) || other.barDifferenceRequestQuantity == barDifferenceRequestQuantity)&&const DeepCollectionEquality().equals(other.healthCertificate, healthCertificate)&&(identical(other.samasatDischargePercentage, samasatDischargePercentage) || other.samasatDischargePercentage == samasatDischargePercentage)&&(identical(other.personTypeName, personTypeName) || other.personTypeName == personTypeName)&&(identical(other.interactTypeName, interactTypeName) || other.interactTypeName == interactTypeName)&&(identical(other.unionTypeName, unionTypeName) || other.unionTypeName == unionTypeName)&&(identical(other.certId, certId) || other.certId == certId)&&(identical(other.increaseQuantity, increaseQuantity) || other.increaseQuantity == increaseQuantity)&&const DeepCollectionEquality().equals(other.tenantFullname, tenantFullname)&&const DeepCollectionEquality().equals(other.tenantNationalCode, tenantNationalCode)&&const DeepCollectionEquality().equals(other.tenantMobile, tenantMobile)&&const DeepCollectionEquality().equals(other.tenantCity, tenantCity)&&(identical(other.hasTenant, hasTenant) || other.hasTenant == hasTenant)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.poultry, poultry) || other.poultry == poultry)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,chainCompany,age,const DeepCollectionEquality().hash(inspectionLosses),vetFarm,activeKill,killingInfo,freeGovernmentalInfo,key,createDate,modifyDate,trash,hasChainCompany,const DeepCollectionEquality().hash(poultryIdForeignKey),const DeepCollectionEquality().hash(poultryHatchingIdKey),quantity,losses,leftOver,killedQuantity,extraKilledQuantity,governmentalKilledQuantity,governmentalQuantity,freeKilledQuantity,freeQuantity,chainKilledQuantity,chainKilledWeight,outProvinceKilledWeight,outProvinceKilledQuantity,exportKilledWeight,exportKilledQuantity,totalCommitment,commitmentType,totalCommitmentQuantity,totalFreeCommitmentQuantity,totalFreeCommitmentWeight,totalKilledWeight,totalAverageKilledWeight,requestLeftOver,hall,date,predicateDate,chickenBreed,period,allowHatching,state,archive,violation,const DeepCollectionEquality().hash(message),const DeepCollectionEquality().hash(registrar),const DeepCollectionEquality().hash(breed),cityNumber,cityName,provinceNumber,provinceName,lastChange,chickenAge,nowAge,latestHatchingChange,const DeepCollectionEquality().hash(violationReport),violationMessage,const DeepCollectionEquality().hash(violationImage),const DeepCollectionEquality().hash(violationReporter),const DeepCollectionEquality().hash(violationReportDate),const DeepCollectionEquality().hash(violationReportEditor),const DeepCollectionEquality().hash(violationReportEditDate),totalLosses,directLosses,const DeepCollectionEquality().hash(directLossesInputer),const DeepCollectionEquality().hash(directLossesDate),const DeepCollectionEquality().hash(directLossesEditor),const DeepCollectionEquality().hash(directLossesLastEditDate),const DeepCollectionEquality().hash(endPeriodLossesInputer),const DeepCollectionEquality().hash(endPeriodLossesDate),const DeepCollectionEquality().hash(endPeriodLossesEditor),const DeepCollectionEquality().hash(endPeriodLossesLastEditDate),breedingUniqueId,licenceNumber,temporaryTrash,temporaryDeleted,const DeepCollectionEquality().hash(firstDateInputArchive),const DeepCollectionEquality().hash(secondDateInputArchive),const DeepCollectionEquality().hash(inputArchiver),const DeepCollectionEquality().hash(outputArchiveDate),const DeepCollectionEquality().hash(outputArchiver),barDifferenceRequestWeight,barDifferenceRequestQuantity,const DeepCollectionEquality().hash(healthCertificate),samasatDischargePercentage,personTypeName,interactTypeName,unionTypeName,certId,increaseQuantity,const DeepCollectionEquality().hash(tenantFullname),const DeepCollectionEquality().hash(tenantNationalCode),const DeepCollectionEquality().hash(tenantMobile),const DeepCollectionEquality().hash(tenantCity),hasTenant,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),poultry]); + +@override +String toString() { + return 'HatchingDetails(id: $id, chainCompany: $chainCompany, age: $age, inspectionLosses: $inspectionLosses, vetFarm: $vetFarm, activeKill: $activeKill, killingInfo: $killingInfo, freeGovernmentalInfo: $freeGovernmentalInfo, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, hasChainCompany: $hasChainCompany, poultryIdForeignKey: $poultryIdForeignKey, poultryHatchingIdKey: $poultryHatchingIdKey, quantity: $quantity, losses: $losses, leftOver: $leftOver, killedQuantity: $killedQuantity, extraKilledQuantity: $extraKilledQuantity, governmentalKilledQuantity: $governmentalKilledQuantity, governmentalQuantity: $governmentalQuantity, freeKilledQuantity: $freeKilledQuantity, freeQuantity: $freeQuantity, chainKilledQuantity: $chainKilledQuantity, chainKilledWeight: $chainKilledWeight, outProvinceKilledWeight: $outProvinceKilledWeight, outProvinceKilledQuantity: $outProvinceKilledQuantity, exportKilledWeight: $exportKilledWeight, exportKilledQuantity: $exportKilledQuantity, totalCommitment: $totalCommitment, commitmentType: $commitmentType, totalCommitmentQuantity: $totalCommitmentQuantity, totalFreeCommitmentQuantity: $totalFreeCommitmentQuantity, totalFreeCommitmentWeight: $totalFreeCommitmentWeight, totalKilledWeight: $totalKilledWeight, totalAverageKilledWeight: $totalAverageKilledWeight, requestLeftOver: $requestLeftOver, hall: $hall, date: $date, predicateDate: $predicateDate, chickenBreed: $chickenBreed, period: $period, allowHatching: $allowHatching, state: $state, archive: $archive, violation: $violation, message: $message, registrar: $registrar, breed: $breed, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, lastChange: $lastChange, chickenAge: $chickenAge, nowAge: $nowAge, latestHatchingChange: $latestHatchingChange, violationReport: $violationReport, violationMessage: $violationMessage, violationImage: $violationImage, violationReporter: $violationReporter, violationReportDate: $violationReportDate, violationReportEditor: $violationReportEditor, violationReportEditDate: $violationReportEditDate, totalLosses: $totalLosses, directLosses: $directLosses, directLossesInputer: $directLossesInputer, directLossesDate: $directLossesDate, directLossesEditor: $directLossesEditor, directLossesLastEditDate: $directLossesLastEditDate, endPeriodLossesInputer: $endPeriodLossesInputer, endPeriodLossesDate: $endPeriodLossesDate, endPeriodLossesEditor: $endPeriodLossesEditor, endPeriodLossesLastEditDate: $endPeriodLossesLastEditDate, breedingUniqueId: $breedingUniqueId, licenceNumber: $licenceNumber, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, firstDateInputArchive: $firstDateInputArchive, secondDateInputArchive: $secondDateInputArchive, inputArchiver: $inputArchiver, outputArchiveDate: $outputArchiveDate, outputArchiver: $outputArchiver, barDifferenceRequestWeight: $barDifferenceRequestWeight, barDifferenceRequestQuantity: $barDifferenceRequestQuantity, healthCertificate: $healthCertificate, samasatDischargePercentage: $samasatDischargePercentage, personTypeName: $personTypeName, interactTypeName: $interactTypeName, unionTypeName: $unionTypeName, certId: $certId, increaseQuantity: $increaseQuantity, tenantFullname: $tenantFullname, tenantNationalCode: $tenantNationalCode, tenantMobile: $tenantMobile, tenantCity: $tenantCity, hasTenant: $hasTenant, createdBy: $createdBy, modifiedBy: $modifiedBy, poultry: $poultry)'; +} + + +} + +/// @nodoc +abstract mixin class $HatchingDetailsCopyWith<$Res> { + factory $HatchingDetailsCopyWith(HatchingDetails value, $Res Function(HatchingDetails) _then) = _$HatchingDetailsCopyWithImpl; +@useResult +$Res call({ + int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry +}); + + +$VetFarmCopyWith<$Res>? get vetFarm;$ActiveKillCopyWith<$Res>? get activeKill;$KillingInfoCopyWith<$Res>? get killingInfo;$FreeGovernmentalInfoCopyWith<$Res>? get freeGovernmentalInfo;$LastChangeCopyWith<$Res>? get lastChange;$LatestHatchingChangeCopyWith<$Res>? get latestHatchingChange; + +} +/// @nodoc +class _$HatchingDetailsCopyWithImpl<$Res> + implements $HatchingDetailsCopyWith<$Res> { + _$HatchingDetailsCopyWithImpl(this._self, this._then); + + final HatchingDetails _self; + final $Res Function(HatchingDetails) _then; + +/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? chainCompany = freezed,Object? age = freezed,Object? inspectionLosses = freezed,Object? vetFarm = freezed,Object? activeKill = freezed,Object? killingInfo = freezed,Object? freeGovernmentalInfo = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? hasChainCompany = freezed,Object? poultryIdForeignKey = freezed,Object? poultryHatchingIdKey = freezed,Object? quantity = freezed,Object? losses = freezed,Object? leftOver = freezed,Object? killedQuantity = freezed,Object? extraKilledQuantity = freezed,Object? governmentalKilledQuantity = freezed,Object? governmentalQuantity = freezed,Object? freeKilledQuantity = freezed,Object? freeQuantity = freezed,Object? chainKilledQuantity = freezed,Object? chainKilledWeight = freezed,Object? outProvinceKilledWeight = freezed,Object? outProvinceKilledQuantity = freezed,Object? exportKilledWeight = freezed,Object? exportKilledQuantity = freezed,Object? totalCommitment = freezed,Object? commitmentType = freezed,Object? totalCommitmentQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? totalFreeCommitmentWeight = freezed,Object? totalKilledWeight = freezed,Object? totalAverageKilledWeight = freezed,Object? requestLeftOver = freezed,Object? hall = freezed,Object? date = freezed,Object? predicateDate = freezed,Object? chickenBreed = freezed,Object? period = freezed,Object? allowHatching = freezed,Object? state = freezed,Object? archive = freezed,Object? violation = freezed,Object? message = freezed,Object? registrar = freezed,Object? breed = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? lastChange = freezed,Object? chickenAge = freezed,Object? nowAge = freezed,Object? latestHatchingChange = freezed,Object? violationReport = freezed,Object? violationMessage = freezed,Object? violationImage = freezed,Object? violationReporter = freezed,Object? violationReportDate = freezed,Object? violationReportEditor = freezed,Object? violationReportEditDate = freezed,Object? totalLosses = freezed,Object? directLosses = freezed,Object? directLossesInputer = freezed,Object? directLossesDate = freezed,Object? directLossesEditor = freezed,Object? directLossesLastEditDate = freezed,Object? endPeriodLossesInputer = freezed,Object? endPeriodLossesDate = freezed,Object? endPeriodLossesEditor = freezed,Object? endPeriodLossesLastEditDate = freezed,Object? breedingUniqueId = freezed,Object? licenceNumber = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? firstDateInputArchive = freezed,Object? secondDateInputArchive = freezed,Object? inputArchiver = freezed,Object? outputArchiveDate = freezed,Object? outputArchiver = freezed,Object? barDifferenceRequestWeight = freezed,Object? barDifferenceRequestQuantity = freezed,Object? healthCertificate = freezed,Object? samasatDischargePercentage = freezed,Object? personTypeName = freezed,Object? interactTypeName = freezed,Object? unionTypeName = freezed,Object? certId = freezed,Object? increaseQuantity = freezed,Object? tenantFullname = freezed,Object? tenantNationalCode = freezed,Object? tenantMobile = freezed,Object? tenantCity = freezed,Object? hasTenant = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? poultry = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,chainCompany: freezed == chainCompany ? _self.chainCompany : chainCompany // ignore: cast_nullable_to_non_nullable +as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int?,inspectionLosses: freezed == inspectionLosses ? _self.inspectionLosses : inspectionLosses // ignore: cast_nullable_to_non_nullable +as dynamic,vetFarm: freezed == vetFarm ? _self.vetFarm : vetFarm // ignore: cast_nullable_to_non_nullable +as VetFarm?,activeKill: freezed == activeKill ? _self.activeKill : activeKill // ignore: cast_nullable_to_non_nullable +as ActiveKill?,killingInfo: freezed == killingInfo ? _self.killingInfo : killingInfo // ignore: cast_nullable_to_non_nullable +as KillingInfo?,freeGovernmentalInfo: freezed == freeGovernmentalInfo ? _self.freeGovernmentalInfo : freeGovernmentalInfo // ignore: cast_nullable_to_non_nullable +as FreeGovernmentalInfo?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as DateTime?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as DateTime?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,hasChainCompany: freezed == hasChainCompany ? _self.hasChainCompany : hasChainCompany // ignore: cast_nullable_to_non_nullable +as bool?,poultryIdForeignKey: freezed == poultryIdForeignKey ? _self.poultryIdForeignKey : poultryIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,poultryHatchingIdKey: freezed == poultryHatchingIdKey ? _self.poultryHatchingIdKey : poultryHatchingIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable +as int?,losses: freezed == losses ? _self.losses : losses // ignore: cast_nullable_to_non_nullable +as int?,leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable +as int?,killedQuantity: freezed == killedQuantity ? _self.killedQuantity : killedQuantity // ignore: cast_nullable_to_non_nullable +as int?,extraKilledQuantity: freezed == extraKilledQuantity ? _self.extraKilledQuantity : extraKilledQuantity // ignore: cast_nullable_to_non_nullable +as int?,governmentalKilledQuantity: freezed == governmentalKilledQuantity ? _self.governmentalKilledQuantity : governmentalKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,governmentalQuantity: freezed == governmentalQuantity ? _self.governmentalQuantity : governmentalQuantity // ignore: cast_nullable_to_non_nullable +as double?,freeKilledQuantity: freezed == freeKilledQuantity ? _self.freeKilledQuantity : freeKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,freeQuantity: freezed == freeQuantity ? _self.freeQuantity : freeQuantity // ignore: cast_nullable_to_non_nullable +as double?,chainKilledQuantity: freezed == chainKilledQuantity ? _self.chainKilledQuantity : chainKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,chainKilledWeight: freezed == chainKilledWeight ? _self.chainKilledWeight : chainKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,outProvinceKilledWeight: freezed == outProvinceKilledWeight ? _self.outProvinceKilledWeight : outProvinceKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,outProvinceKilledQuantity: freezed == outProvinceKilledQuantity ? _self.outProvinceKilledQuantity : outProvinceKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,exportKilledWeight: freezed == exportKilledWeight ? _self.exportKilledWeight : exportKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,exportKilledQuantity: freezed == exportKilledQuantity ? _self.exportKilledQuantity : exportKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalCommitment: freezed == totalCommitment ? _self.totalCommitment : totalCommitment // ignore: cast_nullable_to_non_nullable +as double?,commitmentType: freezed == commitmentType ? _self.commitmentType : commitmentType // ignore: cast_nullable_to_non_nullable +as String?,totalCommitmentQuantity: freezed == totalCommitmentQuantity ? _self.totalCommitmentQuantity : totalCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalFreeCommitmentQuantity: freezed == totalFreeCommitmentQuantity ? _self.totalFreeCommitmentQuantity : totalFreeCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalFreeCommitmentWeight: freezed == totalFreeCommitmentWeight ? _self.totalFreeCommitmentWeight : totalFreeCommitmentWeight // ignore: cast_nullable_to_non_nullable +as double?,totalKilledWeight: freezed == totalKilledWeight ? _self.totalKilledWeight : totalKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,totalAverageKilledWeight: freezed == totalAverageKilledWeight ? _self.totalAverageKilledWeight : totalAverageKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,requestLeftOver: freezed == requestLeftOver ? _self.requestLeftOver : requestLeftOver // ignore: cast_nullable_to_non_nullable +as int?,hall: freezed == hall ? _self.hall : hall // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,predicateDate: freezed == predicateDate ? _self.predicateDate : predicateDate // ignore: cast_nullable_to_non_nullable +as DateTime?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable +as String?,period: freezed == period ? _self.period : period // ignore: cast_nullable_to_non_nullable +as int?,allowHatching: freezed == allowHatching ? _self.allowHatching : allowHatching // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,archive: freezed == archive ? _self.archive : archive // ignore: cast_nullable_to_non_nullable +as bool?,violation: freezed == violation ? _self.violation : violation // ignore: cast_nullable_to_non_nullable +as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as dynamic,registrar: freezed == registrar ? _self.registrar : registrar // ignore: cast_nullable_to_non_nullable +as dynamic,breed: freezed == breed ? _self.breed : breed // ignore: cast_nullable_to_non_nullable +as List?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,lastChange: freezed == lastChange ? _self.lastChange : lastChange // ignore: cast_nullable_to_non_nullable +as LastChange?,chickenAge: freezed == chickenAge ? _self.chickenAge : chickenAge // ignore: cast_nullable_to_non_nullable +as int?,nowAge: freezed == nowAge ? _self.nowAge : nowAge // ignore: cast_nullable_to_non_nullable +as int?,latestHatchingChange: freezed == latestHatchingChange ? _self.latestHatchingChange : latestHatchingChange // ignore: cast_nullable_to_non_nullable +as LatestHatchingChange?,violationReport: freezed == violationReport ? _self.violationReport : violationReport // ignore: cast_nullable_to_non_nullable +as dynamic,violationMessage: freezed == violationMessage ? _self.violationMessage : violationMessage // ignore: cast_nullable_to_non_nullable +as String?,violationImage: freezed == violationImage ? _self.violationImage : violationImage // ignore: cast_nullable_to_non_nullable +as dynamic,violationReporter: freezed == violationReporter ? _self.violationReporter : violationReporter // ignore: cast_nullable_to_non_nullable +as dynamic,violationReportDate: freezed == violationReportDate ? _self.violationReportDate : violationReportDate // ignore: cast_nullable_to_non_nullable +as dynamic,violationReportEditor: freezed == violationReportEditor ? _self.violationReportEditor : violationReportEditor // ignore: cast_nullable_to_non_nullable +as dynamic,violationReportEditDate: freezed == violationReportEditDate ? _self.violationReportEditDate : violationReportEditDate // ignore: cast_nullable_to_non_nullable +as dynamic,totalLosses: freezed == totalLosses ? _self.totalLosses : totalLosses // ignore: cast_nullable_to_non_nullable +as int?,directLosses: freezed == directLosses ? _self.directLosses : directLosses // ignore: cast_nullable_to_non_nullable +as int?,directLossesInputer: freezed == directLossesInputer ? _self.directLossesInputer : directLossesInputer // ignore: cast_nullable_to_non_nullable +as dynamic,directLossesDate: freezed == directLossesDate ? _self.directLossesDate : directLossesDate // ignore: cast_nullable_to_non_nullable +as dynamic,directLossesEditor: freezed == directLossesEditor ? _self.directLossesEditor : directLossesEditor // ignore: cast_nullable_to_non_nullable +as dynamic,directLossesLastEditDate: freezed == directLossesLastEditDate ? _self.directLossesLastEditDate : directLossesLastEditDate // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesInputer: freezed == endPeriodLossesInputer ? _self.endPeriodLossesInputer : endPeriodLossesInputer // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesDate: freezed == endPeriodLossesDate ? _self.endPeriodLossesDate : endPeriodLossesDate // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesEditor: freezed == endPeriodLossesEditor ? _self.endPeriodLossesEditor : endPeriodLossesEditor // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesLastEditDate: freezed == endPeriodLossesLastEditDate ? _self.endPeriodLossesLastEditDate : endPeriodLossesLastEditDate // ignore: cast_nullable_to_non_nullable +as dynamic,breedingUniqueId: freezed == breedingUniqueId ? _self.breedingUniqueId : breedingUniqueId // ignore: cast_nullable_to_non_nullable +as String?,licenceNumber: freezed == licenceNumber ? _self.licenceNumber : licenceNumber // ignore: cast_nullable_to_non_nullable +as String?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,firstDateInputArchive: freezed == firstDateInputArchive ? _self.firstDateInputArchive : firstDateInputArchive // ignore: cast_nullable_to_non_nullable +as dynamic,secondDateInputArchive: freezed == secondDateInputArchive ? _self.secondDateInputArchive : secondDateInputArchive // ignore: cast_nullable_to_non_nullable +as dynamic,inputArchiver: freezed == inputArchiver ? _self.inputArchiver : inputArchiver // ignore: cast_nullable_to_non_nullable +as dynamic,outputArchiveDate: freezed == outputArchiveDate ? _self.outputArchiveDate : outputArchiveDate // ignore: cast_nullable_to_non_nullable +as dynamic,outputArchiver: freezed == outputArchiver ? _self.outputArchiver : outputArchiver // ignore: cast_nullable_to_non_nullable +as dynamic,barDifferenceRequestWeight: freezed == barDifferenceRequestWeight ? _self.barDifferenceRequestWeight : barDifferenceRequestWeight // ignore: cast_nullable_to_non_nullable +as double?,barDifferenceRequestQuantity: freezed == barDifferenceRequestQuantity ? _self.barDifferenceRequestQuantity : barDifferenceRequestQuantity // ignore: cast_nullable_to_non_nullable +as double?,healthCertificate: freezed == healthCertificate ? _self.healthCertificate : healthCertificate // ignore: cast_nullable_to_non_nullable +as dynamic,samasatDischargePercentage: freezed == samasatDischargePercentage ? _self.samasatDischargePercentage : samasatDischargePercentage // ignore: cast_nullable_to_non_nullable +as int?,personTypeName: freezed == personTypeName ? _self.personTypeName : personTypeName // ignore: cast_nullable_to_non_nullable +as String?,interactTypeName: freezed == interactTypeName ? _self.interactTypeName : interactTypeName // ignore: cast_nullable_to_non_nullable +as String?,unionTypeName: freezed == unionTypeName ? _self.unionTypeName : unionTypeName // ignore: cast_nullable_to_non_nullable +as String?,certId: freezed == certId ? _self.certId : certId // ignore: cast_nullable_to_non_nullable +as String?,increaseQuantity: freezed == increaseQuantity ? _self.increaseQuantity : increaseQuantity // ignore: cast_nullable_to_non_nullable +as int?,tenantFullname: freezed == tenantFullname ? _self.tenantFullname : tenantFullname // ignore: cast_nullable_to_non_nullable +as dynamic,tenantNationalCode: freezed == tenantNationalCode ? _self.tenantNationalCode : tenantNationalCode // ignore: cast_nullable_to_non_nullable +as dynamic,tenantMobile: freezed == tenantMobile ? _self.tenantMobile : tenantMobile // ignore: cast_nullable_to_non_nullable +as dynamic,tenantCity: freezed == tenantCity ? _self.tenantCity : tenantCity // ignore: cast_nullable_to_non_nullable +as dynamic,hasTenant: freezed == hasTenant ? _self.hasTenant : hasTenant // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,poultry: freezed == poultry ? _self.poultry : poultry // ignore: cast_nullable_to_non_nullable +as int?, + )); +} +/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$VetFarmCopyWith<$Res>? get vetFarm { + if (_self.vetFarm == null) { + return null; + } + + return $VetFarmCopyWith<$Res>(_self.vetFarm!, (value) { + return _then(_self.copyWith(vetFarm: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActiveKillCopyWith<$Res>? get activeKill { + if (_self.activeKill == null) { + return null; + } + + return $ActiveKillCopyWith<$Res>(_self.activeKill!, (value) { + return _then(_self.copyWith(activeKill: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillingInfoCopyWith<$Res>? get killingInfo { + if (_self.killingInfo == null) { + return null; + } + + return $KillingInfoCopyWith<$Res>(_self.killingInfo!, (value) { + return _then(_self.copyWith(killingInfo: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FreeGovernmentalInfoCopyWith<$Res>? get freeGovernmentalInfo { + if (_self.freeGovernmentalInfo == null) { + return null; + } + + return $FreeGovernmentalInfoCopyWith<$Res>(_self.freeGovernmentalInfo!, (value) { + return _then(_self.copyWith(freeGovernmentalInfo: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LastChangeCopyWith<$Res>? get lastChange { + if (_self.lastChange == null) { + return null; + } + + return $LastChangeCopyWith<$Res>(_self.lastChange!, (value) { + return _then(_self.copyWith(lastChange: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LatestHatchingChangeCopyWith<$Res>? get latestHatchingChange { + if (_self.latestHatchingChange == null) { + return null; + } + + return $LatestHatchingChangeCopyWith<$Res>(_self.latestHatchingChange!, (value) { + return _then(_self.copyWith(latestHatchingChange: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [HatchingDetails]. +extension HatchingDetailsPatterns on HatchingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _HatchingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _HatchingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _HatchingDetails value) $default,){ +final _that = this; +switch (_that) { +case _HatchingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _HatchingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _HatchingDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _HatchingDetails() when $default != null: +return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_that.vetFarm,_that.activeKill,_that.killingInfo,_that.freeGovernmentalInfo,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.hasChainCompany,_that.poultryIdForeignKey,_that.poultryHatchingIdKey,_that.quantity,_that.losses,_that.leftOver,_that.killedQuantity,_that.extraKilledQuantity,_that.governmentalKilledQuantity,_that.governmentalQuantity,_that.freeKilledQuantity,_that.freeQuantity,_that.chainKilledQuantity,_that.chainKilledWeight,_that.outProvinceKilledWeight,_that.outProvinceKilledQuantity,_that.exportKilledWeight,_that.exportKilledQuantity,_that.totalCommitment,_that.commitmentType,_that.totalCommitmentQuantity,_that.totalFreeCommitmentQuantity,_that.totalFreeCommitmentWeight,_that.totalKilledWeight,_that.totalAverageKilledWeight,_that.requestLeftOver,_that.hall,_that.date,_that.predicateDate,_that.chickenBreed,_that.period,_that.allowHatching,_that.state,_that.archive,_that.violation,_that.message,_that.registrar,_that.breed,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.lastChange,_that.chickenAge,_that.nowAge,_that.latestHatchingChange,_that.violationReport,_that.violationMessage,_that.violationImage,_that.violationReporter,_that.violationReportDate,_that.violationReportEditor,_that.violationReportEditDate,_that.totalLosses,_that.directLosses,_that.directLossesInputer,_that.directLossesDate,_that.directLossesEditor,_that.directLossesLastEditDate,_that.endPeriodLossesInputer,_that.endPeriodLossesDate,_that.endPeriodLossesEditor,_that.endPeriodLossesLastEditDate,_that.breedingUniqueId,_that.licenceNumber,_that.temporaryTrash,_that.temporaryDeleted,_that.firstDateInputArchive,_that.secondDateInputArchive,_that.inputArchiver,_that.outputArchiveDate,_that.outputArchiver,_that.barDifferenceRequestWeight,_that.barDifferenceRequestQuantity,_that.healthCertificate,_that.samasatDischargePercentage,_that.personTypeName,_that.interactTypeName,_that.unionTypeName,_that.certId,_that.increaseQuantity,_that.tenantFullname,_that.tenantNationalCode,_that.tenantMobile,_that.tenantCity,_that.hasTenant,_that.createdBy,_that.modifiedBy,_that.poultry);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry) $default,) {final _that = this; +switch (_that) { +case _HatchingDetails(): +return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_that.vetFarm,_that.activeKill,_that.killingInfo,_that.freeGovernmentalInfo,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.hasChainCompany,_that.poultryIdForeignKey,_that.poultryHatchingIdKey,_that.quantity,_that.losses,_that.leftOver,_that.killedQuantity,_that.extraKilledQuantity,_that.governmentalKilledQuantity,_that.governmentalQuantity,_that.freeKilledQuantity,_that.freeQuantity,_that.chainKilledQuantity,_that.chainKilledWeight,_that.outProvinceKilledWeight,_that.outProvinceKilledQuantity,_that.exportKilledWeight,_that.exportKilledQuantity,_that.totalCommitment,_that.commitmentType,_that.totalCommitmentQuantity,_that.totalFreeCommitmentQuantity,_that.totalFreeCommitmentWeight,_that.totalKilledWeight,_that.totalAverageKilledWeight,_that.requestLeftOver,_that.hall,_that.date,_that.predicateDate,_that.chickenBreed,_that.period,_that.allowHatching,_that.state,_that.archive,_that.violation,_that.message,_that.registrar,_that.breed,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.lastChange,_that.chickenAge,_that.nowAge,_that.latestHatchingChange,_that.violationReport,_that.violationMessage,_that.violationImage,_that.violationReporter,_that.violationReportDate,_that.violationReportEditor,_that.violationReportEditDate,_that.totalLosses,_that.directLosses,_that.directLossesInputer,_that.directLossesDate,_that.directLossesEditor,_that.directLossesLastEditDate,_that.endPeriodLossesInputer,_that.endPeriodLossesDate,_that.endPeriodLossesEditor,_that.endPeriodLossesLastEditDate,_that.breedingUniqueId,_that.licenceNumber,_that.temporaryTrash,_that.temporaryDeleted,_that.firstDateInputArchive,_that.secondDateInputArchive,_that.inputArchiver,_that.outputArchiveDate,_that.outputArchiver,_that.barDifferenceRequestWeight,_that.barDifferenceRequestQuantity,_that.healthCertificate,_that.samasatDischargePercentage,_that.personTypeName,_that.interactTypeName,_that.unionTypeName,_that.certId,_that.increaseQuantity,_that.tenantFullname,_that.tenantNationalCode,_that.tenantMobile,_that.tenantCity,_that.hasTenant,_that.createdBy,_that.modifiedBy,_that.poultry);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry)? $default,) {final _that = this; +switch (_that) { +case _HatchingDetails() when $default != null: +return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_that.vetFarm,_that.activeKill,_that.killingInfo,_that.freeGovernmentalInfo,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.hasChainCompany,_that.poultryIdForeignKey,_that.poultryHatchingIdKey,_that.quantity,_that.losses,_that.leftOver,_that.killedQuantity,_that.extraKilledQuantity,_that.governmentalKilledQuantity,_that.governmentalQuantity,_that.freeKilledQuantity,_that.freeQuantity,_that.chainKilledQuantity,_that.chainKilledWeight,_that.outProvinceKilledWeight,_that.outProvinceKilledQuantity,_that.exportKilledWeight,_that.exportKilledQuantity,_that.totalCommitment,_that.commitmentType,_that.totalCommitmentQuantity,_that.totalFreeCommitmentQuantity,_that.totalFreeCommitmentWeight,_that.totalKilledWeight,_that.totalAverageKilledWeight,_that.requestLeftOver,_that.hall,_that.date,_that.predicateDate,_that.chickenBreed,_that.period,_that.allowHatching,_that.state,_that.archive,_that.violation,_that.message,_that.registrar,_that.breed,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.lastChange,_that.chickenAge,_that.nowAge,_that.latestHatchingChange,_that.violationReport,_that.violationMessage,_that.violationImage,_that.violationReporter,_that.violationReportDate,_that.violationReportEditor,_that.violationReportEditDate,_that.totalLosses,_that.directLosses,_that.directLossesInputer,_that.directLossesDate,_that.directLossesEditor,_that.directLossesLastEditDate,_that.endPeriodLossesInputer,_that.endPeriodLossesDate,_that.endPeriodLossesEditor,_that.endPeriodLossesLastEditDate,_that.breedingUniqueId,_that.licenceNumber,_that.temporaryTrash,_that.temporaryDeleted,_that.firstDateInputArchive,_that.secondDateInputArchive,_that.inputArchiver,_that.outputArchiveDate,_that.outputArchiver,_that.barDifferenceRequestWeight,_that.barDifferenceRequestQuantity,_that.healthCertificate,_that.samasatDischargePercentage,_that.personTypeName,_that.interactTypeName,_that.unionTypeName,_that.certId,_that.increaseQuantity,_that.tenantFullname,_that.tenantNationalCode,_that.tenantMobile,_that.tenantCity,_that.hasTenant,_that.createdBy,_that.modifiedBy,_that.poultry);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _HatchingDetails implements HatchingDetails { + const _HatchingDetails({this.id, this.chainCompany, this.age, this.inspectionLosses, this.vetFarm, this.activeKill, this.killingInfo, this.freeGovernmentalInfo, this.key, this.createDate, this.modifyDate, this.trash, this.hasChainCompany, this.poultryIdForeignKey, this.poultryHatchingIdKey, this.quantity, this.losses, this.leftOver, this.killedQuantity, this.extraKilledQuantity, this.governmentalKilledQuantity, this.governmentalQuantity, this.freeKilledQuantity, this.freeQuantity, this.chainKilledQuantity, this.chainKilledWeight, this.outProvinceKilledWeight, this.outProvinceKilledQuantity, this.exportKilledWeight, this.exportKilledQuantity, this.totalCommitment, this.commitmentType, this.totalCommitmentQuantity, this.totalFreeCommitmentQuantity, this.totalFreeCommitmentWeight, this.totalKilledWeight, this.totalAverageKilledWeight, this.requestLeftOver, this.hall, this.date, this.predicateDate, this.chickenBreed, this.period, this.allowHatching, this.state, this.archive, this.violation, this.message, this.registrar, final List? breed, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.lastChange, this.chickenAge, this.nowAge, this.latestHatchingChange, this.violationReport, this.violationMessage, this.violationImage, this.violationReporter, this.violationReportDate, this.violationReportEditor, this.violationReportEditDate, this.totalLosses, this.directLosses, this.directLossesInputer, this.directLossesDate, this.directLossesEditor, this.directLossesLastEditDate, this.endPeriodLossesInputer, this.endPeriodLossesDate, this.endPeriodLossesEditor, this.endPeriodLossesLastEditDate, this.breedingUniqueId, this.licenceNumber, this.temporaryTrash, this.temporaryDeleted, this.firstDateInputArchive, this.secondDateInputArchive, this.inputArchiver, this.outputArchiveDate, this.outputArchiver, this.barDifferenceRequestWeight, this.barDifferenceRequestQuantity, this.healthCertificate, this.samasatDischargePercentage, this.personTypeName, this.interactTypeName, this.unionTypeName, this.certId, this.increaseQuantity, this.tenantFullname, this.tenantNationalCode, this.tenantMobile, this.tenantCity, this.hasTenant, this.createdBy, this.modifiedBy, this.poultry}): _breed = breed; + factory _HatchingDetails.fromJson(Map json) => _$HatchingDetailsFromJson(json); + +@override final int? id; +@override final String? chainCompany; +@override final int? age; +@override final dynamic inspectionLosses; +@override final VetFarm? vetFarm; +@override final ActiveKill? activeKill; +@override final KillingInfo? killingInfo; +@override final FreeGovernmentalInfo? freeGovernmentalInfo; +@override final String? key; +@override final DateTime? createDate; +@override final DateTime? modifyDate; +@override final bool? trash; +@override final bool? hasChainCompany; +@override final dynamic poultryIdForeignKey; +@override final dynamic poultryHatchingIdKey; +@override final int? quantity; +@override final int? losses; +@override final int? leftOver; +@override final int? killedQuantity; +@override final int? extraKilledQuantity; +@override final double? governmentalKilledQuantity; +@override final double? governmentalQuantity; +@override final double? freeKilledQuantity; +@override final double? freeQuantity; +@override final double? chainKilledQuantity; +@override final double? chainKilledWeight; +@override final double? outProvinceKilledWeight; +@override final double? outProvinceKilledQuantity; +@override final double? exportKilledWeight; +@override final double? exportKilledQuantity; +@override final double? totalCommitment; +@override final String? commitmentType; +@override final double? totalCommitmentQuantity; +@override final double? totalFreeCommitmentQuantity; +@override final double? totalFreeCommitmentWeight; +@override final double? totalKilledWeight; +@override final double? totalAverageKilledWeight; +@override final int? requestLeftOver; +@override final int? hall; +@override final DateTime? date; +@override final DateTime? predicateDate; +@override final String? chickenBreed; +@override final int? period; +@override final String? allowHatching; +@override final String? state; +@override final bool? archive; +@override final bool? violation; +@override final dynamic message; +@override final dynamic registrar; + final List? _breed; +@override List? get breed { + final value = _breed; + if (value == null) return null; + if (_breed is EqualUnmodifiableListView) return _breed; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final int? cityNumber; +@override final String? cityName; +@override final int? provinceNumber; +@override final String? provinceName; +@override final LastChange? lastChange; +@override final int? chickenAge; +@override final int? nowAge; +@override final LatestHatchingChange? latestHatchingChange; +@override final dynamic violationReport; +@override final String? violationMessage; +@override final dynamic violationImage; +@override final dynamic violationReporter; +@override final dynamic violationReportDate; +@override final dynamic violationReportEditor; +@override final dynamic violationReportEditDate; +@override final int? totalLosses; +@override final int? directLosses; +@override final dynamic directLossesInputer; +@override final dynamic directLossesDate; +@override final dynamic directLossesEditor; +@override final dynamic directLossesLastEditDate; +@override final dynamic endPeriodLossesInputer; +@override final dynamic endPeriodLossesDate; +@override final dynamic endPeriodLossesEditor; +@override final dynamic endPeriodLossesLastEditDate; +@override final String? breedingUniqueId; +@override final String? licenceNumber; +@override final bool? temporaryTrash; +@override final bool? temporaryDeleted; +@override final dynamic firstDateInputArchive; +@override final dynamic secondDateInputArchive; +@override final dynamic inputArchiver; +@override final dynamic outputArchiveDate; +@override final dynamic outputArchiver; +@override final double? barDifferenceRequestWeight; +@override final double? barDifferenceRequestQuantity; +@override final dynamic healthCertificate; +@override final int? samasatDischargePercentage; +@override final String? personTypeName; +@override final String? interactTypeName; +@override final String? unionTypeName; +@override final String? certId; +@override final int? increaseQuantity; +@override final dynamic tenantFullname; +@override final dynamic tenantNationalCode; +@override final dynamic tenantMobile; +@override final dynamic tenantCity; +@override final bool? hasTenant; +@override final dynamic createdBy; +@override final dynamic modifiedBy; +@override final int? poultry; + +/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$HatchingDetailsCopyWith<_HatchingDetails> get copyWith => __$HatchingDetailsCopyWithImpl<_HatchingDetails>(this, _$identity); + +@override +Map toJson() { + return _$HatchingDetailsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _HatchingDetails&&(identical(other.id, id) || other.id == id)&&(identical(other.chainCompany, chainCompany) || other.chainCompany == chainCompany)&&(identical(other.age, age) || other.age == age)&&const DeepCollectionEquality().equals(other.inspectionLosses, inspectionLosses)&&(identical(other.vetFarm, vetFarm) || other.vetFarm == vetFarm)&&(identical(other.activeKill, activeKill) || other.activeKill == activeKill)&&(identical(other.killingInfo, killingInfo) || other.killingInfo == killingInfo)&&(identical(other.freeGovernmentalInfo, freeGovernmentalInfo) || other.freeGovernmentalInfo == freeGovernmentalInfo)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.hasChainCompany, hasChainCompany) || other.hasChainCompany == hasChainCompany)&&const DeepCollectionEquality().equals(other.poultryIdForeignKey, poultryIdForeignKey)&&const DeepCollectionEquality().equals(other.poultryHatchingIdKey, poultryHatchingIdKey)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.losses, losses) || other.losses == losses)&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.killedQuantity, killedQuantity) || other.killedQuantity == killedQuantity)&&(identical(other.extraKilledQuantity, extraKilledQuantity) || other.extraKilledQuantity == extraKilledQuantity)&&(identical(other.governmentalKilledQuantity, governmentalKilledQuantity) || other.governmentalKilledQuantity == governmentalKilledQuantity)&&(identical(other.governmentalQuantity, governmentalQuantity) || other.governmentalQuantity == governmentalQuantity)&&(identical(other.freeKilledQuantity, freeKilledQuantity) || other.freeKilledQuantity == freeKilledQuantity)&&(identical(other.freeQuantity, freeQuantity) || other.freeQuantity == freeQuantity)&&(identical(other.chainKilledQuantity, chainKilledQuantity) || other.chainKilledQuantity == chainKilledQuantity)&&(identical(other.chainKilledWeight, chainKilledWeight) || other.chainKilledWeight == chainKilledWeight)&&(identical(other.outProvinceKilledWeight, outProvinceKilledWeight) || other.outProvinceKilledWeight == outProvinceKilledWeight)&&(identical(other.outProvinceKilledQuantity, outProvinceKilledQuantity) || other.outProvinceKilledQuantity == outProvinceKilledQuantity)&&(identical(other.exportKilledWeight, exportKilledWeight) || other.exportKilledWeight == exportKilledWeight)&&(identical(other.exportKilledQuantity, exportKilledQuantity) || other.exportKilledQuantity == exportKilledQuantity)&&(identical(other.totalCommitment, totalCommitment) || other.totalCommitment == totalCommitment)&&(identical(other.commitmentType, commitmentType) || other.commitmentType == commitmentType)&&(identical(other.totalCommitmentQuantity, totalCommitmentQuantity) || other.totalCommitmentQuantity == totalCommitmentQuantity)&&(identical(other.totalFreeCommitmentQuantity, totalFreeCommitmentQuantity) || other.totalFreeCommitmentQuantity == totalFreeCommitmentQuantity)&&(identical(other.totalFreeCommitmentWeight, totalFreeCommitmentWeight) || other.totalFreeCommitmentWeight == totalFreeCommitmentWeight)&&(identical(other.totalKilledWeight, totalKilledWeight) || other.totalKilledWeight == totalKilledWeight)&&(identical(other.totalAverageKilledWeight, totalAverageKilledWeight) || other.totalAverageKilledWeight == totalAverageKilledWeight)&&(identical(other.requestLeftOver, requestLeftOver) || other.requestLeftOver == requestLeftOver)&&(identical(other.hall, hall) || other.hall == hall)&&(identical(other.date, date) || other.date == date)&&(identical(other.predicateDate, predicateDate) || other.predicateDate == predicateDate)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.period, period) || other.period == period)&&(identical(other.allowHatching, allowHatching) || other.allowHatching == allowHatching)&&(identical(other.state, state) || other.state == state)&&(identical(other.archive, archive) || other.archive == archive)&&(identical(other.violation, violation) || other.violation == violation)&&const DeepCollectionEquality().equals(other.message, message)&&const DeepCollectionEquality().equals(other.registrar, registrar)&&const DeepCollectionEquality().equals(other._breed, _breed)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.lastChange, lastChange) || other.lastChange == lastChange)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.nowAge, nowAge) || other.nowAge == nowAge)&&(identical(other.latestHatchingChange, latestHatchingChange) || other.latestHatchingChange == latestHatchingChange)&&const DeepCollectionEquality().equals(other.violationReport, violationReport)&&(identical(other.violationMessage, violationMessage) || other.violationMessage == violationMessage)&&const DeepCollectionEquality().equals(other.violationImage, violationImage)&&const DeepCollectionEquality().equals(other.violationReporter, violationReporter)&&const DeepCollectionEquality().equals(other.violationReportDate, violationReportDate)&&const DeepCollectionEquality().equals(other.violationReportEditor, violationReportEditor)&&const DeepCollectionEquality().equals(other.violationReportEditDate, violationReportEditDate)&&(identical(other.totalLosses, totalLosses) || other.totalLosses == totalLosses)&&(identical(other.directLosses, directLosses) || other.directLosses == directLosses)&&const DeepCollectionEquality().equals(other.directLossesInputer, directLossesInputer)&&const DeepCollectionEquality().equals(other.directLossesDate, directLossesDate)&&const DeepCollectionEquality().equals(other.directLossesEditor, directLossesEditor)&&const DeepCollectionEquality().equals(other.directLossesLastEditDate, directLossesLastEditDate)&&const DeepCollectionEquality().equals(other.endPeriodLossesInputer, endPeriodLossesInputer)&&const DeepCollectionEquality().equals(other.endPeriodLossesDate, endPeriodLossesDate)&&const DeepCollectionEquality().equals(other.endPeriodLossesEditor, endPeriodLossesEditor)&&const DeepCollectionEquality().equals(other.endPeriodLossesLastEditDate, endPeriodLossesLastEditDate)&&(identical(other.breedingUniqueId, breedingUniqueId) || other.breedingUniqueId == breedingUniqueId)&&(identical(other.licenceNumber, licenceNumber) || other.licenceNumber == licenceNumber)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.firstDateInputArchive, firstDateInputArchive)&&const DeepCollectionEquality().equals(other.secondDateInputArchive, secondDateInputArchive)&&const DeepCollectionEquality().equals(other.inputArchiver, inputArchiver)&&const DeepCollectionEquality().equals(other.outputArchiveDate, outputArchiveDate)&&const DeepCollectionEquality().equals(other.outputArchiver, outputArchiver)&&(identical(other.barDifferenceRequestWeight, barDifferenceRequestWeight) || other.barDifferenceRequestWeight == barDifferenceRequestWeight)&&(identical(other.barDifferenceRequestQuantity, barDifferenceRequestQuantity) || other.barDifferenceRequestQuantity == barDifferenceRequestQuantity)&&const DeepCollectionEquality().equals(other.healthCertificate, healthCertificate)&&(identical(other.samasatDischargePercentage, samasatDischargePercentage) || other.samasatDischargePercentage == samasatDischargePercentage)&&(identical(other.personTypeName, personTypeName) || other.personTypeName == personTypeName)&&(identical(other.interactTypeName, interactTypeName) || other.interactTypeName == interactTypeName)&&(identical(other.unionTypeName, unionTypeName) || other.unionTypeName == unionTypeName)&&(identical(other.certId, certId) || other.certId == certId)&&(identical(other.increaseQuantity, increaseQuantity) || other.increaseQuantity == increaseQuantity)&&const DeepCollectionEquality().equals(other.tenantFullname, tenantFullname)&&const DeepCollectionEquality().equals(other.tenantNationalCode, tenantNationalCode)&&const DeepCollectionEquality().equals(other.tenantMobile, tenantMobile)&&const DeepCollectionEquality().equals(other.tenantCity, tenantCity)&&(identical(other.hasTenant, hasTenant) || other.hasTenant == hasTenant)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.poultry, poultry) || other.poultry == poultry)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,chainCompany,age,const DeepCollectionEquality().hash(inspectionLosses),vetFarm,activeKill,killingInfo,freeGovernmentalInfo,key,createDate,modifyDate,trash,hasChainCompany,const DeepCollectionEquality().hash(poultryIdForeignKey),const DeepCollectionEquality().hash(poultryHatchingIdKey),quantity,losses,leftOver,killedQuantity,extraKilledQuantity,governmentalKilledQuantity,governmentalQuantity,freeKilledQuantity,freeQuantity,chainKilledQuantity,chainKilledWeight,outProvinceKilledWeight,outProvinceKilledQuantity,exportKilledWeight,exportKilledQuantity,totalCommitment,commitmentType,totalCommitmentQuantity,totalFreeCommitmentQuantity,totalFreeCommitmentWeight,totalKilledWeight,totalAverageKilledWeight,requestLeftOver,hall,date,predicateDate,chickenBreed,period,allowHatching,state,archive,violation,const DeepCollectionEquality().hash(message),const DeepCollectionEquality().hash(registrar),const DeepCollectionEquality().hash(_breed),cityNumber,cityName,provinceNumber,provinceName,lastChange,chickenAge,nowAge,latestHatchingChange,const DeepCollectionEquality().hash(violationReport),violationMessage,const DeepCollectionEquality().hash(violationImage),const DeepCollectionEquality().hash(violationReporter),const DeepCollectionEquality().hash(violationReportDate),const DeepCollectionEquality().hash(violationReportEditor),const DeepCollectionEquality().hash(violationReportEditDate),totalLosses,directLosses,const DeepCollectionEquality().hash(directLossesInputer),const DeepCollectionEquality().hash(directLossesDate),const DeepCollectionEquality().hash(directLossesEditor),const DeepCollectionEquality().hash(directLossesLastEditDate),const DeepCollectionEquality().hash(endPeriodLossesInputer),const DeepCollectionEquality().hash(endPeriodLossesDate),const DeepCollectionEquality().hash(endPeriodLossesEditor),const DeepCollectionEquality().hash(endPeriodLossesLastEditDate),breedingUniqueId,licenceNumber,temporaryTrash,temporaryDeleted,const DeepCollectionEquality().hash(firstDateInputArchive),const DeepCollectionEquality().hash(secondDateInputArchive),const DeepCollectionEquality().hash(inputArchiver),const DeepCollectionEquality().hash(outputArchiveDate),const DeepCollectionEquality().hash(outputArchiver),barDifferenceRequestWeight,barDifferenceRequestQuantity,const DeepCollectionEquality().hash(healthCertificate),samasatDischargePercentage,personTypeName,interactTypeName,unionTypeName,certId,increaseQuantity,const DeepCollectionEquality().hash(tenantFullname),const DeepCollectionEquality().hash(tenantNationalCode),const DeepCollectionEquality().hash(tenantMobile),const DeepCollectionEquality().hash(tenantCity),hasTenant,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),poultry]); + +@override +String toString() { + return 'HatchingDetails(id: $id, chainCompany: $chainCompany, age: $age, inspectionLosses: $inspectionLosses, vetFarm: $vetFarm, activeKill: $activeKill, killingInfo: $killingInfo, freeGovernmentalInfo: $freeGovernmentalInfo, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, hasChainCompany: $hasChainCompany, poultryIdForeignKey: $poultryIdForeignKey, poultryHatchingIdKey: $poultryHatchingIdKey, quantity: $quantity, losses: $losses, leftOver: $leftOver, killedQuantity: $killedQuantity, extraKilledQuantity: $extraKilledQuantity, governmentalKilledQuantity: $governmentalKilledQuantity, governmentalQuantity: $governmentalQuantity, freeKilledQuantity: $freeKilledQuantity, freeQuantity: $freeQuantity, chainKilledQuantity: $chainKilledQuantity, chainKilledWeight: $chainKilledWeight, outProvinceKilledWeight: $outProvinceKilledWeight, outProvinceKilledQuantity: $outProvinceKilledQuantity, exportKilledWeight: $exportKilledWeight, exportKilledQuantity: $exportKilledQuantity, totalCommitment: $totalCommitment, commitmentType: $commitmentType, totalCommitmentQuantity: $totalCommitmentQuantity, totalFreeCommitmentQuantity: $totalFreeCommitmentQuantity, totalFreeCommitmentWeight: $totalFreeCommitmentWeight, totalKilledWeight: $totalKilledWeight, totalAverageKilledWeight: $totalAverageKilledWeight, requestLeftOver: $requestLeftOver, hall: $hall, date: $date, predicateDate: $predicateDate, chickenBreed: $chickenBreed, period: $period, allowHatching: $allowHatching, state: $state, archive: $archive, violation: $violation, message: $message, registrar: $registrar, breed: $breed, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, lastChange: $lastChange, chickenAge: $chickenAge, nowAge: $nowAge, latestHatchingChange: $latestHatchingChange, violationReport: $violationReport, violationMessage: $violationMessage, violationImage: $violationImage, violationReporter: $violationReporter, violationReportDate: $violationReportDate, violationReportEditor: $violationReportEditor, violationReportEditDate: $violationReportEditDate, totalLosses: $totalLosses, directLosses: $directLosses, directLossesInputer: $directLossesInputer, directLossesDate: $directLossesDate, directLossesEditor: $directLossesEditor, directLossesLastEditDate: $directLossesLastEditDate, endPeriodLossesInputer: $endPeriodLossesInputer, endPeriodLossesDate: $endPeriodLossesDate, endPeriodLossesEditor: $endPeriodLossesEditor, endPeriodLossesLastEditDate: $endPeriodLossesLastEditDate, breedingUniqueId: $breedingUniqueId, licenceNumber: $licenceNumber, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, firstDateInputArchive: $firstDateInputArchive, secondDateInputArchive: $secondDateInputArchive, inputArchiver: $inputArchiver, outputArchiveDate: $outputArchiveDate, outputArchiver: $outputArchiver, barDifferenceRequestWeight: $barDifferenceRequestWeight, barDifferenceRequestQuantity: $barDifferenceRequestQuantity, healthCertificate: $healthCertificate, samasatDischargePercentage: $samasatDischargePercentage, personTypeName: $personTypeName, interactTypeName: $interactTypeName, unionTypeName: $unionTypeName, certId: $certId, increaseQuantity: $increaseQuantity, tenantFullname: $tenantFullname, tenantNationalCode: $tenantNationalCode, tenantMobile: $tenantMobile, tenantCity: $tenantCity, hasTenant: $hasTenant, createdBy: $createdBy, modifiedBy: $modifiedBy, poultry: $poultry)'; +} + + +} + +/// @nodoc +abstract mixin class _$HatchingDetailsCopyWith<$Res> implements $HatchingDetailsCopyWith<$Res> { + factory _$HatchingDetailsCopyWith(_HatchingDetails value, $Res Function(_HatchingDetails) _then) = __$HatchingDetailsCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry +}); + + +@override $VetFarmCopyWith<$Res>? get vetFarm;@override $ActiveKillCopyWith<$Res>? get activeKill;@override $KillingInfoCopyWith<$Res>? get killingInfo;@override $FreeGovernmentalInfoCopyWith<$Res>? get freeGovernmentalInfo;@override $LastChangeCopyWith<$Res>? get lastChange;@override $LatestHatchingChangeCopyWith<$Res>? get latestHatchingChange; + +} +/// @nodoc +class __$HatchingDetailsCopyWithImpl<$Res> + implements _$HatchingDetailsCopyWith<$Res> { + __$HatchingDetailsCopyWithImpl(this._self, this._then); + + final _HatchingDetails _self; + final $Res Function(_HatchingDetails) _then; + +/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? chainCompany = freezed,Object? age = freezed,Object? inspectionLosses = freezed,Object? vetFarm = freezed,Object? activeKill = freezed,Object? killingInfo = freezed,Object? freeGovernmentalInfo = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? hasChainCompany = freezed,Object? poultryIdForeignKey = freezed,Object? poultryHatchingIdKey = freezed,Object? quantity = freezed,Object? losses = freezed,Object? leftOver = freezed,Object? killedQuantity = freezed,Object? extraKilledQuantity = freezed,Object? governmentalKilledQuantity = freezed,Object? governmentalQuantity = freezed,Object? freeKilledQuantity = freezed,Object? freeQuantity = freezed,Object? chainKilledQuantity = freezed,Object? chainKilledWeight = freezed,Object? outProvinceKilledWeight = freezed,Object? outProvinceKilledQuantity = freezed,Object? exportKilledWeight = freezed,Object? exportKilledQuantity = freezed,Object? totalCommitment = freezed,Object? commitmentType = freezed,Object? totalCommitmentQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? totalFreeCommitmentWeight = freezed,Object? totalKilledWeight = freezed,Object? totalAverageKilledWeight = freezed,Object? requestLeftOver = freezed,Object? hall = freezed,Object? date = freezed,Object? predicateDate = freezed,Object? chickenBreed = freezed,Object? period = freezed,Object? allowHatching = freezed,Object? state = freezed,Object? archive = freezed,Object? violation = freezed,Object? message = freezed,Object? registrar = freezed,Object? breed = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? lastChange = freezed,Object? chickenAge = freezed,Object? nowAge = freezed,Object? latestHatchingChange = freezed,Object? violationReport = freezed,Object? violationMessage = freezed,Object? violationImage = freezed,Object? violationReporter = freezed,Object? violationReportDate = freezed,Object? violationReportEditor = freezed,Object? violationReportEditDate = freezed,Object? totalLosses = freezed,Object? directLosses = freezed,Object? directLossesInputer = freezed,Object? directLossesDate = freezed,Object? directLossesEditor = freezed,Object? directLossesLastEditDate = freezed,Object? endPeriodLossesInputer = freezed,Object? endPeriodLossesDate = freezed,Object? endPeriodLossesEditor = freezed,Object? endPeriodLossesLastEditDate = freezed,Object? breedingUniqueId = freezed,Object? licenceNumber = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? firstDateInputArchive = freezed,Object? secondDateInputArchive = freezed,Object? inputArchiver = freezed,Object? outputArchiveDate = freezed,Object? outputArchiver = freezed,Object? barDifferenceRequestWeight = freezed,Object? barDifferenceRequestQuantity = freezed,Object? healthCertificate = freezed,Object? samasatDischargePercentage = freezed,Object? personTypeName = freezed,Object? interactTypeName = freezed,Object? unionTypeName = freezed,Object? certId = freezed,Object? increaseQuantity = freezed,Object? tenantFullname = freezed,Object? tenantNationalCode = freezed,Object? tenantMobile = freezed,Object? tenantCity = freezed,Object? hasTenant = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? poultry = freezed,}) { + return _then(_HatchingDetails( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,chainCompany: freezed == chainCompany ? _self.chainCompany : chainCompany // ignore: cast_nullable_to_non_nullable +as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int?,inspectionLosses: freezed == inspectionLosses ? _self.inspectionLosses : inspectionLosses // ignore: cast_nullable_to_non_nullable +as dynamic,vetFarm: freezed == vetFarm ? _self.vetFarm : vetFarm // ignore: cast_nullable_to_non_nullable +as VetFarm?,activeKill: freezed == activeKill ? _self.activeKill : activeKill // ignore: cast_nullable_to_non_nullable +as ActiveKill?,killingInfo: freezed == killingInfo ? _self.killingInfo : killingInfo // ignore: cast_nullable_to_non_nullable +as KillingInfo?,freeGovernmentalInfo: freezed == freeGovernmentalInfo ? _self.freeGovernmentalInfo : freeGovernmentalInfo // ignore: cast_nullable_to_non_nullable +as FreeGovernmentalInfo?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable +as DateTime?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable +as DateTime?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable +as bool?,hasChainCompany: freezed == hasChainCompany ? _self.hasChainCompany : hasChainCompany // ignore: cast_nullable_to_non_nullable +as bool?,poultryIdForeignKey: freezed == poultryIdForeignKey ? _self.poultryIdForeignKey : poultryIdForeignKey // ignore: cast_nullable_to_non_nullable +as dynamic,poultryHatchingIdKey: freezed == poultryHatchingIdKey ? _self.poultryHatchingIdKey : poultryHatchingIdKey // ignore: cast_nullable_to_non_nullable +as dynamic,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable +as int?,losses: freezed == losses ? _self.losses : losses // ignore: cast_nullable_to_non_nullable +as int?,leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable +as int?,killedQuantity: freezed == killedQuantity ? _self.killedQuantity : killedQuantity // ignore: cast_nullable_to_non_nullable +as int?,extraKilledQuantity: freezed == extraKilledQuantity ? _self.extraKilledQuantity : extraKilledQuantity // ignore: cast_nullable_to_non_nullable +as int?,governmentalKilledQuantity: freezed == governmentalKilledQuantity ? _self.governmentalKilledQuantity : governmentalKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,governmentalQuantity: freezed == governmentalQuantity ? _self.governmentalQuantity : governmentalQuantity // ignore: cast_nullable_to_non_nullable +as double?,freeKilledQuantity: freezed == freeKilledQuantity ? _self.freeKilledQuantity : freeKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,freeQuantity: freezed == freeQuantity ? _self.freeQuantity : freeQuantity // ignore: cast_nullable_to_non_nullable +as double?,chainKilledQuantity: freezed == chainKilledQuantity ? _self.chainKilledQuantity : chainKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,chainKilledWeight: freezed == chainKilledWeight ? _self.chainKilledWeight : chainKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,outProvinceKilledWeight: freezed == outProvinceKilledWeight ? _self.outProvinceKilledWeight : outProvinceKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,outProvinceKilledQuantity: freezed == outProvinceKilledQuantity ? _self.outProvinceKilledQuantity : outProvinceKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,exportKilledWeight: freezed == exportKilledWeight ? _self.exportKilledWeight : exportKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,exportKilledQuantity: freezed == exportKilledQuantity ? _self.exportKilledQuantity : exportKilledQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalCommitment: freezed == totalCommitment ? _self.totalCommitment : totalCommitment // ignore: cast_nullable_to_non_nullable +as double?,commitmentType: freezed == commitmentType ? _self.commitmentType : commitmentType // ignore: cast_nullable_to_non_nullable +as String?,totalCommitmentQuantity: freezed == totalCommitmentQuantity ? _self.totalCommitmentQuantity : totalCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalFreeCommitmentQuantity: freezed == totalFreeCommitmentQuantity ? _self.totalFreeCommitmentQuantity : totalFreeCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,totalFreeCommitmentWeight: freezed == totalFreeCommitmentWeight ? _self.totalFreeCommitmentWeight : totalFreeCommitmentWeight // ignore: cast_nullable_to_non_nullable +as double?,totalKilledWeight: freezed == totalKilledWeight ? _self.totalKilledWeight : totalKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,totalAverageKilledWeight: freezed == totalAverageKilledWeight ? _self.totalAverageKilledWeight : totalAverageKilledWeight // ignore: cast_nullable_to_non_nullable +as double?,requestLeftOver: freezed == requestLeftOver ? _self.requestLeftOver : requestLeftOver // ignore: cast_nullable_to_non_nullable +as int?,hall: freezed == hall ? _self.hall : hall // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,predicateDate: freezed == predicateDate ? _self.predicateDate : predicateDate // ignore: cast_nullable_to_non_nullable +as DateTime?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable +as String?,period: freezed == period ? _self.period : period // ignore: cast_nullable_to_non_nullable +as int?,allowHatching: freezed == allowHatching ? _self.allowHatching : allowHatching // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,archive: freezed == archive ? _self.archive : archive // ignore: cast_nullable_to_non_nullable +as bool?,violation: freezed == violation ? _self.violation : violation // ignore: cast_nullable_to_non_nullable +as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as dynamic,registrar: freezed == registrar ? _self.registrar : registrar // ignore: cast_nullable_to_non_nullable +as dynamic,breed: freezed == breed ? _self._breed : breed // ignore: cast_nullable_to_non_nullable +as List?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable +as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable +as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?,lastChange: freezed == lastChange ? _self.lastChange : lastChange // ignore: cast_nullable_to_non_nullable +as LastChange?,chickenAge: freezed == chickenAge ? _self.chickenAge : chickenAge // ignore: cast_nullable_to_non_nullable +as int?,nowAge: freezed == nowAge ? _self.nowAge : nowAge // ignore: cast_nullable_to_non_nullable +as int?,latestHatchingChange: freezed == latestHatchingChange ? _self.latestHatchingChange : latestHatchingChange // ignore: cast_nullable_to_non_nullable +as LatestHatchingChange?,violationReport: freezed == violationReport ? _self.violationReport : violationReport // ignore: cast_nullable_to_non_nullable +as dynamic,violationMessage: freezed == violationMessage ? _self.violationMessage : violationMessage // ignore: cast_nullable_to_non_nullable +as String?,violationImage: freezed == violationImage ? _self.violationImage : violationImage // ignore: cast_nullable_to_non_nullable +as dynamic,violationReporter: freezed == violationReporter ? _self.violationReporter : violationReporter // ignore: cast_nullable_to_non_nullable +as dynamic,violationReportDate: freezed == violationReportDate ? _self.violationReportDate : violationReportDate // ignore: cast_nullable_to_non_nullable +as dynamic,violationReportEditor: freezed == violationReportEditor ? _self.violationReportEditor : violationReportEditor // ignore: cast_nullable_to_non_nullable +as dynamic,violationReportEditDate: freezed == violationReportEditDate ? _self.violationReportEditDate : violationReportEditDate // ignore: cast_nullable_to_non_nullable +as dynamic,totalLosses: freezed == totalLosses ? _self.totalLosses : totalLosses // ignore: cast_nullable_to_non_nullable +as int?,directLosses: freezed == directLosses ? _self.directLosses : directLosses // ignore: cast_nullable_to_non_nullable +as int?,directLossesInputer: freezed == directLossesInputer ? _self.directLossesInputer : directLossesInputer // ignore: cast_nullable_to_non_nullable +as dynamic,directLossesDate: freezed == directLossesDate ? _self.directLossesDate : directLossesDate // ignore: cast_nullable_to_non_nullable +as dynamic,directLossesEditor: freezed == directLossesEditor ? _self.directLossesEditor : directLossesEditor // ignore: cast_nullable_to_non_nullable +as dynamic,directLossesLastEditDate: freezed == directLossesLastEditDate ? _self.directLossesLastEditDate : directLossesLastEditDate // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesInputer: freezed == endPeriodLossesInputer ? _self.endPeriodLossesInputer : endPeriodLossesInputer // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesDate: freezed == endPeriodLossesDate ? _self.endPeriodLossesDate : endPeriodLossesDate // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesEditor: freezed == endPeriodLossesEditor ? _self.endPeriodLossesEditor : endPeriodLossesEditor // ignore: cast_nullable_to_non_nullable +as dynamic,endPeriodLossesLastEditDate: freezed == endPeriodLossesLastEditDate ? _self.endPeriodLossesLastEditDate : endPeriodLossesLastEditDate // ignore: cast_nullable_to_non_nullable +as dynamic,breedingUniqueId: freezed == breedingUniqueId ? _self.breedingUniqueId : breedingUniqueId // ignore: cast_nullable_to_non_nullable +as String?,licenceNumber: freezed == licenceNumber ? _self.licenceNumber : licenceNumber // ignore: cast_nullable_to_non_nullable +as String?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable +as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable +as bool?,firstDateInputArchive: freezed == firstDateInputArchive ? _self.firstDateInputArchive : firstDateInputArchive // ignore: cast_nullable_to_non_nullable +as dynamic,secondDateInputArchive: freezed == secondDateInputArchive ? _self.secondDateInputArchive : secondDateInputArchive // ignore: cast_nullable_to_non_nullable +as dynamic,inputArchiver: freezed == inputArchiver ? _self.inputArchiver : inputArchiver // ignore: cast_nullable_to_non_nullable +as dynamic,outputArchiveDate: freezed == outputArchiveDate ? _self.outputArchiveDate : outputArchiveDate // ignore: cast_nullable_to_non_nullable +as dynamic,outputArchiver: freezed == outputArchiver ? _self.outputArchiver : outputArchiver // ignore: cast_nullable_to_non_nullable +as dynamic,barDifferenceRequestWeight: freezed == barDifferenceRequestWeight ? _self.barDifferenceRequestWeight : barDifferenceRequestWeight // ignore: cast_nullable_to_non_nullable +as double?,barDifferenceRequestQuantity: freezed == barDifferenceRequestQuantity ? _self.barDifferenceRequestQuantity : barDifferenceRequestQuantity // ignore: cast_nullable_to_non_nullable +as double?,healthCertificate: freezed == healthCertificate ? _self.healthCertificate : healthCertificate // ignore: cast_nullable_to_non_nullable +as dynamic,samasatDischargePercentage: freezed == samasatDischargePercentage ? _self.samasatDischargePercentage : samasatDischargePercentage // ignore: cast_nullable_to_non_nullable +as int?,personTypeName: freezed == personTypeName ? _self.personTypeName : personTypeName // ignore: cast_nullable_to_non_nullable +as String?,interactTypeName: freezed == interactTypeName ? _self.interactTypeName : interactTypeName // ignore: cast_nullable_to_non_nullable +as String?,unionTypeName: freezed == unionTypeName ? _self.unionTypeName : unionTypeName // ignore: cast_nullable_to_non_nullable +as String?,certId: freezed == certId ? _self.certId : certId // ignore: cast_nullable_to_non_nullable +as String?,increaseQuantity: freezed == increaseQuantity ? _self.increaseQuantity : increaseQuantity // ignore: cast_nullable_to_non_nullable +as int?,tenantFullname: freezed == tenantFullname ? _self.tenantFullname : tenantFullname // ignore: cast_nullable_to_non_nullable +as dynamic,tenantNationalCode: freezed == tenantNationalCode ? _self.tenantNationalCode : tenantNationalCode // ignore: cast_nullable_to_non_nullable +as dynamic,tenantMobile: freezed == tenantMobile ? _self.tenantMobile : tenantMobile // ignore: cast_nullable_to_non_nullable +as dynamic,tenantCity: freezed == tenantCity ? _self.tenantCity : tenantCity // ignore: cast_nullable_to_non_nullable +as dynamic,hasTenant: freezed == hasTenant ? _self.hasTenant : hasTenant // ignore: cast_nullable_to_non_nullable +as bool?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable +as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as dynamic,poultry: freezed == poultry ? _self.poultry : poultry // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$VetFarmCopyWith<$Res>? get vetFarm { + if (_self.vetFarm == null) { + return null; + } + + return $VetFarmCopyWith<$Res>(_self.vetFarm!, (value) { + return _then(_self.copyWith(vetFarm: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ActiveKillCopyWith<$Res>? get activeKill { + if (_self.activeKill == null) { + return null; + } + + return $ActiveKillCopyWith<$Res>(_self.activeKill!, (value) { + return _then(_self.copyWith(activeKill: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillingInfoCopyWith<$Res>? get killingInfo { + if (_self.killingInfo == null) { + return null; + } + + return $KillingInfoCopyWith<$Res>(_self.killingInfo!, (value) { + return _then(_self.copyWith(killingInfo: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FreeGovernmentalInfoCopyWith<$Res>? get freeGovernmentalInfo { + if (_self.freeGovernmentalInfo == null) { + return null; + } + + return $FreeGovernmentalInfoCopyWith<$Res>(_self.freeGovernmentalInfo!, (value) { + return _then(_self.copyWith(freeGovernmentalInfo: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LastChangeCopyWith<$Res>? get lastChange { + if (_self.lastChange == null) { + return null; + } + + return $LastChangeCopyWith<$Res>(_self.lastChange!, (value) { + return _then(_self.copyWith(lastChange: value)); + }); +}/// Create a copy of HatchingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LatestHatchingChangeCopyWith<$Res>? get latestHatchingChange { + if (_self.latestHatchingChange == null) { + return null; + } + + return $LatestHatchingChangeCopyWith<$Res>(_self.latestHatchingChange!, (value) { + return _then(_self.copyWith(latestHatchingChange: value)); + }); +} +} + + +/// @nodoc +mixin _$VetFarm { + + String? get vetFarmFullName; String? get vetFarmMobile; +/// Create a copy of VetFarm +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$VetFarmCopyWith get copyWith => _$VetFarmCopyWithImpl(this as VetFarm, _$identity); + + /// Serializes this VetFarm to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is VetFarm&&(identical(other.vetFarmFullName, vetFarmFullName) || other.vetFarmFullName == vetFarmFullName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,vetFarmFullName,vetFarmMobile); + +@override +String toString() { + return 'VetFarm(vetFarmFullName: $vetFarmFullName, vetFarmMobile: $vetFarmMobile)'; +} + + +} + +/// @nodoc +abstract mixin class $VetFarmCopyWith<$Res> { + factory $VetFarmCopyWith(VetFarm value, $Res Function(VetFarm) _then) = _$VetFarmCopyWithImpl; +@useResult +$Res call({ + String? vetFarmFullName, String? vetFarmMobile +}); + + + + +} +/// @nodoc +class _$VetFarmCopyWithImpl<$Res> + implements $VetFarmCopyWith<$Res> { + _$VetFarmCopyWithImpl(this._self, this._then); + + final VetFarm _self; + final $Res Function(VetFarm) _then; + +/// Create a copy of VetFarm +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? vetFarmFullName = freezed,Object? vetFarmMobile = freezed,}) { + return _then(_self.copyWith( +vetFarmFullName: freezed == vetFarmFullName ? _self.vetFarmFullName : vetFarmFullName // ignore: cast_nullable_to_non_nullable +as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [VetFarm]. +extension VetFarmPatterns on VetFarm { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _VetFarm value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _VetFarm() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _VetFarm value) $default,){ +final _that = this; +switch (_that) { +case _VetFarm(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _VetFarm value)? $default,){ +final _that = this; +switch (_that) { +case _VetFarm() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? vetFarmFullName, String? vetFarmMobile)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _VetFarm() when $default != null: +return $default(_that.vetFarmFullName,_that.vetFarmMobile);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? vetFarmFullName, String? vetFarmMobile) $default,) {final _that = this; +switch (_that) { +case _VetFarm(): +return $default(_that.vetFarmFullName,_that.vetFarmMobile);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? vetFarmFullName, String? vetFarmMobile)? $default,) {final _that = this; +switch (_that) { +case _VetFarm() when $default != null: +return $default(_that.vetFarmFullName,_that.vetFarmMobile);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _VetFarm implements VetFarm { + const _VetFarm({this.vetFarmFullName, this.vetFarmMobile}); + factory _VetFarm.fromJson(Map json) => _$VetFarmFromJson(json); + +@override final String? vetFarmFullName; +@override final String? vetFarmMobile; + +/// Create a copy of VetFarm +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$VetFarmCopyWith<_VetFarm> get copyWith => __$VetFarmCopyWithImpl<_VetFarm>(this, _$identity); + +@override +Map toJson() { + return _$VetFarmToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _VetFarm&&(identical(other.vetFarmFullName, vetFarmFullName) || other.vetFarmFullName == vetFarmFullName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,vetFarmFullName,vetFarmMobile); + +@override +String toString() { + return 'VetFarm(vetFarmFullName: $vetFarmFullName, vetFarmMobile: $vetFarmMobile)'; +} + + +} + +/// @nodoc +abstract mixin class _$VetFarmCopyWith<$Res> implements $VetFarmCopyWith<$Res> { + factory _$VetFarmCopyWith(_VetFarm value, $Res Function(_VetFarm) _then) = __$VetFarmCopyWithImpl; +@override @useResult +$Res call({ + String? vetFarmFullName, String? vetFarmMobile +}); + + + + +} +/// @nodoc +class __$VetFarmCopyWithImpl<$Res> + implements _$VetFarmCopyWith<$Res> { + __$VetFarmCopyWithImpl(this._self, this._then); + + final _VetFarm _self; + final $Res Function(_VetFarm) _then; + +/// Create a copy of VetFarm +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? vetFarmFullName = freezed,Object? vetFarmMobile = freezed,}) { + return _then(_VetFarm( +vetFarmFullName: freezed == vetFarmFullName ? _self.vetFarmFullName : vetFarmFullName // ignore: cast_nullable_to_non_nullable +as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$ActiveKill { + + bool? get activeKill; int? get countOfRequest; +/// Create a copy of ActiveKill +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ActiveKillCopyWith get copyWith => _$ActiveKillCopyWithImpl(this as ActiveKill, _$identity); + + /// Serializes this ActiveKill to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ActiveKill&&(identical(other.activeKill, activeKill) || other.activeKill == activeKill)&&(identical(other.countOfRequest, countOfRequest) || other.countOfRequest == countOfRequest)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,activeKill,countOfRequest); + +@override +String toString() { + return 'ActiveKill(activeKill: $activeKill, countOfRequest: $countOfRequest)'; +} + + +} + +/// @nodoc +abstract mixin class $ActiveKillCopyWith<$Res> { + factory $ActiveKillCopyWith(ActiveKill value, $Res Function(ActiveKill) _then) = _$ActiveKillCopyWithImpl; +@useResult +$Res call({ + bool? activeKill, int? countOfRequest +}); + + + + +} +/// @nodoc +class _$ActiveKillCopyWithImpl<$Res> + implements $ActiveKillCopyWith<$Res> { + _$ActiveKillCopyWithImpl(this._self, this._then); + + final ActiveKill _self; + final $Res Function(ActiveKill) _then; + +/// Create a copy of ActiveKill +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? activeKill = freezed,Object? countOfRequest = freezed,}) { + return _then(_self.copyWith( +activeKill: freezed == activeKill ? _self.activeKill : activeKill // ignore: cast_nullable_to_non_nullable +as bool?,countOfRequest: freezed == countOfRequest ? _self.countOfRequest : countOfRequest // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ActiveKill]. +extension ActiveKillPatterns on ActiveKill { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ActiveKill value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ActiveKill() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ActiveKill value) $default,){ +final _that = this; +switch (_that) { +case _ActiveKill(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ActiveKill value)? $default,){ +final _that = this; +switch (_that) { +case _ActiveKill() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? activeKill, int? countOfRequest)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ActiveKill() when $default != null: +return $default(_that.activeKill,_that.countOfRequest);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? activeKill, int? countOfRequest) $default,) {final _that = this; +switch (_that) { +case _ActiveKill(): +return $default(_that.activeKill,_that.countOfRequest);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? activeKill, int? countOfRequest)? $default,) {final _that = this; +switch (_that) { +case _ActiveKill() when $default != null: +return $default(_that.activeKill,_that.countOfRequest);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ActiveKill implements ActiveKill { + const _ActiveKill({this.activeKill, this.countOfRequest}); + factory _ActiveKill.fromJson(Map json) => _$ActiveKillFromJson(json); + +@override final bool? activeKill; +@override final int? countOfRequest; + +/// Create a copy of ActiveKill +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ActiveKillCopyWith<_ActiveKill> get copyWith => __$ActiveKillCopyWithImpl<_ActiveKill>(this, _$identity); + +@override +Map toJson() { + return _$ActiveKillToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ActiveKill&&(identical(other.activeKill, activeKill) || other.activeKill == activeKill)&&(identical(other.countOfRequest, countOfRequest) || other.countOfRequest == countOfRequest)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,activeKill,countOfRequest); + +@override +String toString() { + return 'ActiveKill(activeKill: $activeKill, countOfRequest: $countOfRequest)'; +} + + +} + +/// @nodoc +abstract mixin class _$ActiveKillCopyWith<$Res> implements $ActiveKillCopyWith<$Res> { + factory _$ActiveKillCopyWith(_ActiveKill value, $Res Function(_ActiveKill) _then) = __$ActiveKillCopyWithImpl; +@override @useResult +$Res call({ + bool? activeKill, int? countOfRequest +}); + + + + +} +/// @nodoc +class __$ActiveKillCopyWithImpl<$Res> + implements _$ActiveKillCopyWith<$Res> { + __$ActiveKillCopyWithImpl(this._self, this._then); + + final _ActiveKill _self; + final $Res Function(_ActiveKill) _then; + +/// Create a copy of ActiveKill +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? activeKill = freezed,Object? countOfRequest = freezed,}) { + return _then(_ActiveKill( +activeKill: freezed == activeKill ? _self.activeKill : activeKill // ignore: cast_nullable_to_non_nullable +as bool?,countOfRequest: freezed == countOfRequest ? _self.countOfRequest : countOfRequest // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$KillingInfo { + + String? get violationMessage; int? get provinceKillRequests; int? get provinceKillRequestsQuantity; double? get provinceKillRequestsWeight; int? get killHouseRequests; int? get killHouseRequestsFirstQuantity; double? get killHouseRequestsFirstWeight; int? get barCompleteWithKillHouse; int? get acceptedRealQuantityFinal; double? get acceptedRealWightFinal; int? get wareHouseBars; int? get wareHouseBarsQuantity; double? get wareHouseBarsWeight; double? get wareHouseBarsWeightLose; +/// Create a copy of KillingInfo +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillingInfoCopyWith get copyWith => _$KillingInfoCopyWithImpl(this as KillingInfo, _$identity); + + /// Serializes this KillingInfo to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillingInfo&&(identical(other.violationMessage, violationMessage) || other.violationMessage == violationMessage)&&(identical(other.provinceKillRequests, provinceKillRequests) || other.provinceKillRequests == provinceKillRequests)&&(identical(other.provinceKillRequestsQuantity, provinceKillRequestsQuantity) || other.provinceKillRequestsQuantity == provinceKillRequestsQuantity)&&(identical(other.provinceKillRequestsWeight, provinceKillRequestsWeight) || other.provinceKillRequestsWeight == provinceKillRequestsWeight)&&(identical(other.killHouseRequests, killHouseRequests) || other.killHouseRequests == killHouseRequests)&&(identical(other.killHouseRequestsFirstQuantity, killHouseRequestsFirstQuantity) || other.killHouseRequestsFirstQuantity == killHouseRequestsFirstQuantity)&&(identical(other.killHouseRequestsFirstWeight, killHouseRequestsFirstWeight) || other.killHouseRequestsFirstWeight == killHouseRequestsFirstWeight)&&(identical(other.barCompleteWithKillHouse, barCompleteWithKillHouse) || other.barCompleteWithKillHouse == barCompleteWithKillHouse)&&(identical(other.acceptedRealQuantityFinal, acceptedRealQuantityFinal) || other.acceptedRealQuantityFinal == acceptedRealQuantityFinal)&&(identical(other.acceptedRealWightFinal, acceptedRealWightFinal) || other.acceptedRealWightFinal == acceptedRealWightFinal)&&(identical(other.wareHouseBars, wareHouseBars) || other.wareHouseBars == wareHouseBars)&&(identical(other.wareHouseBarsQuantity, wareHouseBarsQuantity) || other.wareHouseBarsQuantity == wareHouseBarsQuantity)&&(identical(other.wareHouseBarsWeight, wareHouseBarsWeight) || other.wareHouseBarsWeight == wareHouseBarsWeight)&&(identical(other.wareHouseBarsWeightLose, wareHouseBarsWeightLose) || other.wareHouseBarsWeightLose == wareHouseBarsWeightLose)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,violationMessage,provinceKillRequests,provinceKillRequestsQuantity,provinceKillRequestsWeight,killHouseRequests,killHouseRequestsFirstQuantity,killHouseRequestsFirstWeight,barCompleteWithKillHouse,acceptedRealQuantityFinal,acceptedRealWightFinal,wareHouseBars,wareHouseBarsQuantity,wareHouseBarsWeight,wareHouseBarsWeightLose); + +@override +String toString() { + return 'KillingInfo(violationMessage: $violationMessage, provinceKillRequests: $provinceKillRequests, provinceKillRequestsQuantity: $provinceKillRequestsQuantity, provinceKillRequestsWeight: $provinceKillRequestsWeight, killHouseRequests: $killHouseRequests, killHouseRequestsFirstQuantity: $killHouseRequestsFirstQuantity, killHouseRequestsFirstWeight: $killHouseRequestsFirstWeight, barCompleteWithKillHouse: $barCompleteWithKillHouse, acceptedRealQuantityFinal: $acceptedRealQuantityFinal, acceptedRealWightFinal: $acceptedRealWightFinal, wareHouseBars: $wareHouseBars, wareHouseBarsQuantity: $wareHouseBarsQuantity, wareHouseBarsWeight: $wareHouseBarsWeight, wareHouseBarsWeightLose: $wareHouseBarsWeightLose)'; +} + + +} + +/// @nodoc +abstract mixin class $KillingInfoCopyWith<$Res> { + factory $KillingInfoCopyWith(KillingInfo value, $Res Function(KillingInfo) _then) = _$KillingInfoCopyWithImpl; +@useResult +$Res call({ + String? violationMessage, int? provinceKillRequests, int? provinceKillRequestsQuantity, double? provinceKillRequestsWeight, int? killHouseRequests, int? killHouseRequestsFirstQuantity, double? killHouseRequestsFirstWeight, int? barCompleteWithKillHouse, int? acceptedRealQuantityFinal, double? acceptedRealWightFinal, int? wareHouseBars, int? wareHouseBarsQuantity, double? wareHouseBarsWeight, double? wareHouseBarsWeightLose +}); + + + + +} +/// @nodoc +class _$KillingInfoCopyWithImpl<$Res> + implements $KillingInfoCopyWith<$Res> { + _$KillingInfoCopyWithImpl(this._self, this._then); + + final KillingInfo _self; + final $Res Function(KillingInfo) _then; + +/// Create a copy of KillingInfo +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? violationMessage = freezed,Object? provinceKillRequests = freezed,Object? provinceKillRequestsQuantity = freezed,Object? provinceKillRequestsWeight = freezed,Object? killHouseRequests = freezed,Object? killHouseRequestsFirstQuantity = freezed,Object? killHouseRequestsFirstWeight = freezed,Object? barCompleteWithKillHouse = freezed,Object? acceptedRealQuantityFinal = freezed,Object? acceptedRealWightFinal = freezed,Object? wareHouseBars = freezed,Object? wareHouseBarsQuantity = freezed,Object? wareHouseBarsWeight = freezed,Object? wareHouseBarsWeightLose = freezed,}) { + return _then(_self.copyWith( +violationMessage: freezed == violationMessage ? _self.violationMessage : violationMessage // ignore: cast_nullable_to_non_nullable +as String?,provinceKillRequests: freezed == provinceKillRequests ? _self.provinceKillRequests : provinceKillRequests // ignore: cast_nullable_to_non_nullable +as int?,provinceKillRequestsQuantity: freezed == provinceKillRequestsQuantity ? _self.provinceKillRequestsQuantity : provinceKillRequestsQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceKillRequestsWeight: freezed == provinceKillRequestsWeight ? _self.provinceKillRequestsWeight : provinceKillRequestsWeight // ignore: cast_nullable_to_non_nullable +as double?,killHouseRequests: freezed == killHouseRequests ? _self.killHouseRequests : killHouseRequests // ignore: cast_nullable_to_non_nullable +as int?,killHouseRequestsFirstQuantity: freezed == killHouseRequestsFirstQuantity ? _self.killHouseRequestsFirstQuantity : killHouseRequestsFirstQuantity // ignore: cast_nullable_to_non_nullable +as int?,killHouseRequestsFirstWeight: freezed == killHouseRequestsFirstWeight ? _self.killHouseRequestsFirstWeight : killHouseRequestsFirstWeight // ignore: cast_nullable_to_non_nullable +as double?,barCompleteWithKillHouse: freezed == barCompleteWithKillHouse ? _self.barCompleteWithKillHouse : barCompleteWithKillHouse // ignore: cast_nullable_to_non_nullable +as int?,acceptedRealQuantityFinal: freezed == acceptedRealQuantityFinal ? _self.acceptedRealQuantityFinal : acceptedRealQuantityFinal // ignore: cast_nullable_to_non_nullable +as int?,acceptedRealWightFinal: freezed == acceptedRealWightFinal ? _self.acceptedRealWightFinal : acceptedRealWightFinal // ignore: cast_nullable_to_non_nullable +as double?,wareHouseBars: freezed == wareHouseBars ? _self.wareHouseBars : wareHouseBars // ignore: cast_nullable_to_non_nullable +as int?,wareHouseBarsQuantity: freezed == wareHouseBarsQuantity ? _self.wareHouseBarsQuantity : wareHouseBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,wareHouseBarsWeight: freezed == wareHouseBarsWeight ? _self.wareHouseBarsWeight : wareHouseBarsWeight // ignore: cast_nullable_to_non_nullable +as double?,wareHouseBarsWeightLose: freezed == wareHouseBarsWeightLose ? _self.wareHouseBarsWeightLose : wareHouseBarsWeightLose // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [KillingInfo]. +extension KillingInfoPatterns on KillingInfo { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _KillingInfo value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillingInfo() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _KillingInfo value) $default,){ +final _that = this; +switch (_that) { +case _KillingInfo(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _KillingInfo value)? $default,){ +final _that = this; +switch (_that) { +case _KillingInfo() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? violationMessage, int? provinceKillRequests, int? provinceKillRequestsQuantity, double? provinceKillRequestsWeight, int? killHouseRequests, int? killHouseRequestsFirstQuantity, double? killHouseRequestsFirstWeight, int? barCompleteWithKillHouse, int? acceptedRealQuantityFinal, double? acceptedRealWightFinal, int? wareHouseBars, int? wareHouseBarsQuantity, double? wareHouseBarsWeight, double? wareHouseBarsWeightLose)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillingInfo() when $default != null: +return $default(_that.violationMessage,_that.provinceKillRequests,_that.provinceKillRequestsQuantity,_that.provinceKillRequestsWeight,_that.killHouseRequests,_that.killHouseRequestsFirstQuantity,_that.killHouseRequestsFirstWeight,_that.barCompleteWithKillHouse,_that.acceptedRealQuantityFinal,_that.acceptedRealWightFinal,_that.wareHouseBars,_that.wareHouseBarsQuantity,_that.wareHouseBarsWeight,_that.wareHouseBarsWeightLose);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? violationMessage, int? provinceKillRequests, int? provinceKillRequestsQuantity, double? provinceKillRequestsWeight, int? killHouseRequests, int? killHouseRequestsFirstQuantity, double? killHouseRequestsFirstWeight, int? barCompleteWithKillHouse, int? acceptedRealQuantityFinal, double? acceptedRealWightFinal, int? wareHouseBars, int? wareHouseBarsQuantity, double? wareHouseBarsWeight, double? wareHouseBarsWeightLose) $default,) {final _that = this; +switch (_that) { +case _KillingInfo(): +return $default(_that.violationMessage,_that.provinceKillRequests,_that.provinceKillRequestsQuantity,_that.provinceKillRequestsWeight,_that.killHouseRequests,_that.killHouseRequestsFirstQuantity,_that.killHouseRequestsFirstWeight,_that.barCompleteWithKillHouse,_that.acceptedRealQuantityFinal,_that.acceptedRealWightFinal,_that.wareHouseBars,_that.wareHouseBarsQuantity,_that.wareHouseBarsWeight,_that.wareHouseBarsWeightLose);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? violationMessage, int? provinceKillRequests, int? provinceKillRequestsQuantity, double? provinceKillRequestsWeight, int? killHouseRequests, int? killHouseRequestsFirstQuantity, double? killHouseRequestsFirstWeight, int? barCompleteWithKillHouse, int? acceptedRealQuantityFinal, double? acceptedRealWightFinal, int? wareHouseBars, int? wareHouseBarsQuantity, double? wareHouseBarsWeight, double? wareHouseBarsWeightLose)? $default,) {final _that = this; +switch (_that) { +case _KillingInfo() when $default != null: +return $default(_that.violationMessage,_that.provinceKillRequests,_that.provinceKillRequestsQuantity,_that.provinceKillRequestsWeight,_that.killHouseRequests,_that.killHouseRequestsFirstQuantity,_that.killHouseRequestsFirstWeight,_that.barCompleteWithKillHouse,_that.acceptedRealQuantityFinal,_that.acceptedRealWightFinal,_that.wareHouseBars,_that.wareHouseBarsQuantity,_that.wareHouseBarsWeight,_that.wareHouseBarsWeightLose);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillingInfo implements KillingInfo { + const _KillingInfo({this.violationMessage, this.provinceKillRequests, this.provinceKillRequestsQuantity, this.provinceKillRequestsWeight, this.killHouseRequests, this.killHouseRequestsFirstQuantity, this.killHouseRequestsFirstWeight, this.barCompleteWithKillHouse, this.acceptedRealQuantityFinal, this.acceptedRealWightFinal, this.wareHouseBars, this.wareHouseBarsQuantity, this.wareHouseBarsWeight, this.wareHouseBarsWeightLose}); + factory _KillingInfo.fromJson(Map json) => _$KillingInfoFromJson(json); + +@override final String? violationMessage; +@override final int? provinceKillRequests; +@override final int? provinceKillRequestsQuantity; +@override final double? provinceKillRequestsWeight; +@override final int? killHouseRequests; +@override final int? killHouseRequestsFirstQuantity; +@override final double? killHouseRequestsFirstWeight; +@override final int? barCompleteWithKillHouse; +@override final int? acceptedRealQuantityFinal; +@override final double? acceptedRealWightFinal; +@override final int? wareHouseBars; +@override final int? wareHouseBarsQuantity; +@override final double? wareHouseBarsWeight; +@override final double? wareHouseBarsWeightLose; + +/// Create a copy of KillingInfo +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillingInfoCopyWith<_KillingInfo> get copyWith => __$KillingInfoCopyWithImpl<_KillingInfo>(this, _$identity); + +@override +Map toJson() { + return _$KillingInfoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillingInfo&&(identical(other.violationMessage, violationMessage) || other.violationMessage == violationMessage)&&(identical(other.provinceKillRequests, provinceKillRequests) || other.provinceKillRequests == provinceKillRequests)&&(identical(other.provinceKillRequestsQuantity, provinceKillRequestsQuantity) || other.provinceKillRequestsQuantity == provinceKillRequestsQuantity)&&(identical(other.provinceKillRequestsWeight, provinceKillRequestsWeight) || other.provinceKillRequestsWeight == provinceKillRequestsWeight)&&(identical(other.killHouseRequests, killHouseRequests) || other.killHouseRequests == killHouseRequests)&&(identical(other.killHouseRequestsFirstQuantity, killHouseRequestsFirstQuantity) || other.killHouseRequestsFirstQuantity == killHouseRequestsFirstQuantity)&&(identical(other.killHouseRequestsFirstWeight, killHouseRequestsFirstWeight) || other.killHouseRequestsFirstWeight == killHouseRequestsFirstWeight)&&(identical(other.barCompleteWithKillHouse, barCompleteWithKillHouse) || other.barCompleteWithKillHouse == barCompleteWithKillHouse)&&(identical(other.acceptedRealQuantityFinal, acceptedRealQuantityFinal) || other.acceptedRealQuantityFinal == acceptedRealQuantityFinal)&&(identical(other.acceptedRealWightFinal, acceptedRealWightFinal) || other.acceptedRealWightFinal == acceptedRealWightFinal)&&(identical(other.wareHouseBars, wareHouseBars) || other.wareHouseBars == wareHouseBars)&&(identical(other.wareHouseBarsQuantity, wareHouseBarsQuantity) || other.wareHouseBarsQuantity == wareHouseBarsQuantity)&&(identical(other.wareHouseBarsWeight, wareHouseBarsWeight) || other.wareHouseBarsWeight == wareHouseBarsWeight)&&(identical(other.wareHouseBarsWeightLose, wareHouseBarsWeightLose) || other.wareHouseBarsWeightLose == wareHouseBarsWeightLose)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,violationMessage,provinceKillRequests,provinceKillRequestsQuantity,provinceKillRequestsWeight,killHouseRequests,killHouseRequestsFirstQuantity,killHouseRequestsFirstWeight,barCompleteWithKillHouse,acceptedRealQuantityFinal,acceptedRealWightFinal,wareHouseBars,wareHouseBarsQuantity,wareHouseBarsWeight,wareHouseBarsWeightLose); + +@override +String toString() { + return 'KillingInfo(violationMessage: $violationMessage, provinceKillRequests: $provinceKillRequests, provinceKillRequestsQuantity: $provinceKillRequestsQuantity, provinceKillRequestsWeight: $provinceKillRequestsWeight, killHouseRequests: $killHouseRequests, killHouseRequestsFirstQuantity: $killHouseRequestsFirstQuantity, killHouseRequestsFirstWeight: $killHouseRequestsFirstWeight, barCompleteWithKillHouse: $barCompleteWithKillHouse, acceptedRealQuantityFinal: $acceptedRealQuantityFinal, acceptedRealWightFinal: $acceptedRealWightFinal, wareHouseBars: $wareHouseBars, wareHouseBarsQuantity: $wareHouseBarsQuantity, wareHouseBarsWeight: $wareHouseBarsWeight, wareHouseBarsWeightLose: $wareHouseBarsWeightLose)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillingInfoCopyWith<$Res> implements $KillingInfoCopyWith<$Res> { + factory _$KillingInfoCopyWith(_KillingInfo value, $Res Function(_KillingInfo) _then) = __$KillingInfoCopyWithImpl; +@override @useResult +$Res call({ + String? violationMessage, int? provinceKillRequests, int? provinceKillRequestsQuantity, double? provinceKillRequestsWeight, int? killHouseRequests, int? killHouseRequestsFirstQuantity, double? killHouseRequestsFirstWeight, int? barCompleteWithKillHouse, int? acceptedRealQuantityFinal, double? acceptedRealWightFinal, int? wareHouseBars, int? wareHouseBarsQuantity, double? wareHouseBarsWeight, double? wareHouseBarsWeightLose +}); + + + + +} +/// @nodoc +class __$KillingInfoCopyWithImpl<$Res> + implements _$KillingInfoCopyWith<$Res> { + __$KillingInfoCopyWithImpl(this._self, this._then); + + final _KillingInfo _self; + final $Res Function(_KillingInfo) _then; + +/// Create a copy of KillingInfo +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? violationMessage = freezed,Object? provinceKillRequests = freezed,Object? provinceKillRequestsQuantity = freezed,Object? provinceKillRequestsWeight = freezed,Object? killHouseRequests = freezed,Object? killHouseRequestsFirstQuantity = freezed,Object? killHouseRequestsFirstWeight = freezed,Object? barCompleteWithKillHouse = freezed,Object? acceptedRealQuantityFinal = freezed,Object? acceptedRealWightFinal = freezed,Object? wareHouseBars = freezed,Object? wareHouseBarsQuantity = freezed,Object? wareHouseBarsWeight = freezed,Object? wareHouseBarsWeightLose = freezed,}) { + return _then(_KillingInfo( +violationMessage: freezed == violationMessage ? _self.violationMessage : violationMessage // ignore: cast_nullable_to_non_nullable +as String?,provinceKillRequests: freezed == provinceKillRequests ? _self.provinceKillRequests : provinceKillRequests // ignore: cast_nullable_to_non_nullable +as int?,provinceKillRequestsQuantity: freezed == provinceKillRequestsQuantity ? _self.provinceKillRequestsQuantity : provinceKillRequestsQuantity // ignore: cast_nullable_to_non_nullable +as int?,provinceKillRequestsWeight: freezed == provinceKillRequestsWeight ? _self.provinceKillRequestsWeight : provinceKillRequestsWeight // ignore: cast_nullable_to_non_nullable +as double?,killHouseRequests: freezed == killHouseRequests ? _self.killHouseRequests : killHouseRequests // ignore: cast_nullable_to_non_nullable +as int?,killHouseRequestsFirstQuantity: freezed == killHouseRequestsFirstQuantity ? _self.killHouseRequestsFirstQuantity : killHouseRequestsFirstQuantity // ignore: cast_nullable_to_non_nullable +as int?,killHouseRequestsFirstWeight: freezed == killHouseRequestsFirstWeight ? _self.killHouseRequestsFirstWeight : killHouseRequestsFirstWeight // ignore: cast_nullable_to_non_nullable +as double?,barCompleteWithKillHouse: freezed == barCompleteWithKillHouse ? _self.barCompleteWithKillHouse : barCompleteWithKillHouse // ignore: cast_nullable_to_non_nullable +as int?,acceptedRealQuantityFinal: freezed == acceptedRealQuantityFinal ? _self.acceptedRealQuantityFinal : acceptedRealQuantityFinal // ignore: cast_nullable_to_non_nullable +as int?,acceptedRealWightFinal: freezed == acceptedRealWightFinal ? _self.acceptedRealWightFinal : acceptedRealWightFinal // ignore: cast_nullable_to_non_nullable +as double?,wareHouseBars: freezed == wareHouseBars ? _self.wareHouseBars : wareHouseBars // ignore: cast_nullable_to_non_nullable +as int?,wareHouseBarsQuantity: freezed == wareHouseBarsQuantity ? _self.wareHouseBarsQuantity : wareHouseBarsQuantity // ignore: cast_nullable_to_non_nullable +as int?,wareHouseBarsWeight: freezed == wareHouseBarsWeight ? _self.wareHouseBarsWeight : wareHouseBarsWeight // ignore: cast_nullable_to_non_nullable +as double?,wareHouseBarsWeightLose: freezed == wareHouseBarsWeightLose ? _self.wareHouseBarsWeightLose : wareHouseBarsWeightLose // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + + +/// @nodoc +mixin _$FreeGovernmentalInfo { + + int? get governmentalAllocatedQuantity; double? get totalCommitmentQuantity; int? get freeAllocatedQuantity; double? get totalFreeCommitmentQuantity; int? get leftTotalFreeCommitmentQuantity; +/// Create a copy of FreeGovernmentalInfo +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FreeGovernmentalInfoCopyWith get copyWith => _$FreeGovernmentalInfoCopyWithImpl(this as FreeGovernmentalInfo, _$identity); + + /// Serializes this FreeGovernmentalInfo to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FreeGovernmentalInfo&&(identical(other.governmentalAllocatedQuantity, governmentalAllocatedQuantity) || other.governmentalAllocatedQuantity == governmentalAllocatedQuantity)&&(identical(other.totalCommitmentQuantity, totalCommitmentQuantity) || other.totalCommitmentQuantity == totalCommitmentQuantity)&&(identical(other.freeAllocatedQuantity, freeAllocatedQuantity) || other.freeAllocatedQuantity == freeAllocatedQuantity)&&(identical(other.totalFreeCommitmentQuantity, totalFreeCommitmentQuantity) || other.totalFreeCommitmentQuantity == totalFreeCommitmentQuantity)&&(identical(other.leftTotalFreeCommitmentQuantity, leftTotalFreeCommitmentQuantity) || other.leftTotalFreeCommitmentQuantity == leftTotalFreeCommitmentQuantity)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,governmentalAllocatedQuantity,totalCommitmentQuantity,freeAllocatedQuantity,totalFreeCommitmentQuantity,leftTotalFreeCommitmentQuantity); + +@override +String toString() { + return 'FreeGovernmentalInfo(governmentalAllocatedQuantity: $governmentalAllocatedQuantity, totalCommitmentQuantity: $totalCommitmentQuantity, freeAllocatedQuantity: $freeAllocatedQuantity, totalFreeCommitmentQuantity: $totalFreeCommitmentQuantity, leftTotalFreeCommitmentQuantity: $leftTotalFreeCommitmentQuantity)'; +} + + +} + +/// @nodoc +abstract mixin class $FreeGovernmentalInfoCopyWith<$Res> { + factory $FreeGovernmentalInfoCopyWith(FreeGovernmentalInfo value, $Res Function(FreeGovernmentalInfo) _then) = _$FreeGovernmentalInfoCopyWithImpl; +@useResult +$Res call({ + int? governmentalAllocatedQuantity, double? totalCommitmentQuantity, int? freeAllocatedQuantity, double? totalFreeCommitmentQuantity, int? leftTotalFreeCommitmentQuantity +}); + + + + +} +/// @nodoc +class _$FreeGovernmentalInfoCopyWithImpl<$Res> + implements $FreeGovernmentalInfoCopyWith<$Res> { + _$FreeGovernmentalInfoCopyWithImpl(this._self, this._then); + + final FreeGovernmentalInfo _self; + final $Res Function(FreeGovernmentalInfo) _then; + +/// Create a copy of FreeGovernmentalInfo +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? governmentalAllocatedQuantity = freezed,Object? totalCommitmentQuantity = freezed,Object? freeAllocatedQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? leftTotalFreeCommitmentQuantity = freezed,}) { + return _then(_self.copyWith( +governmentalAllocatedQuantity: freezed == governmentalAllocatedQuantity ? _self.governmentalAllocatedQuantity : governmentalAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalCommitmentQuantity: freezed == totalCommitmentQuantity ? _self.totalCommitmentQuantity : totalCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,freeAllocatedQuantity: freezed == freeAllocatedQuantity ? _self.freeAllocatedQuantity : freeAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalFreeCommitmentQuantity: freezed == totalFreeCommitmentQuantity ? _self.totalFreeCommitmentQuantity : totalFreeCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,leftTotalFreeCommitmentQuantity: freezed == leftTotalFreeCommitmentQuantity ? _self.leftTotalFreeCommitmentQuantity : leftTotalFreeCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [FreeGovernmentalInfo]. +extension FreeGovernmentalInfoPatterns on FreeGovernmentalInfo { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FreeGovernmentalInfo value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FreeGovernmentalInfo() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FreeGovernmentalInfo value) $default,){ +final _that = this; +switch (_that) { +case _FreeGovernmentalInfo(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FreeGovernmentalInfo value)? $default,){ +final _that = this; +switch (_that) { +case _FreeGovernmentalInfo() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? governmentalAllocatedQuantity, double? totalCommitmentQuantity, int? freeAllocatedQuantity, double? totalFreeCommitmentQuantity, int? leftTotalFreeCommitmentQuantity)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FreeGovernmentalInfo() when $default != null: +return $default(_that.governmentalAllocatedQuantity,_that.totalCommitmentQuantity,_that.freeAllocatedQuantity,_that.totalFreeCommitmentQuantity,_that.leftTotalFreeCommitmentQuantity);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? governmentalAllocatedQuantity, double? totalCommitmentQuantity, int? freeAllocatedQuantity, double? totalFreeCommitmentQuantity, int? leftTotalFreeCommitmentQuantity) $default,) {final _that = this; +switch (_that) { +case _FreeGovernmentalInfo(): +return $default(_that.governmentalAllocatedQuantity,_that.totalCommitmentQuantity,_that.freeAllocatedQuantity,_that.totalFreeCommitmentQuantity,_that.leftTotalFreeCommitmentQuantity);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? governmentalAllocatedQuantity, double? totalCommitmentQuantity, int? freeAllocatedQuantity, double? totalFreeCommitmentQuantity, int? leftTotalFreeCommitmentQuantity)? $default,) {final _that = this; +switch (_that) { +case _FreeGovernmentalInfo() when $default != null: +return $default(_that.governmentalAllocatedQuantity,_that.totalCommitmentQuantity,_that.freeAllocatedQuantity,_that.totalFreeCommitmentQuantity,_that.leftTotalFreeCommitmentQuantity);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _FreeGovernmentalInfo implements FreeGovernmentalInfo { + const _FreeGovernmentalInfo({this.governmentalAllocatedQuantity, this.totalCommitmentQuantity, this.freeAllocatedQuantity, this.totalFreeCommitmentQuantity, this.leftTotalFreeCommitmentQuantity}); + factory _FreeGovernmentalInfo.fromJson(Map json) => _$FreeGovernmentalInfoFromJson(json); + +@override final int? governmentalAllocatedQuantity; +@override final double? totalCommitmentQuantity; +@override final int? freeAllocatedQuantity; +@override final double? totalFreeCommitmentQuantity; +@override final int? leftTotalFreeCommitmentQuantity; + +/// Create a copy of FreeGovernmentalInfo +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FreeGovernmentalInfoCopyWith<_FreeGovernmentalInfo> get copyWith => __$FreeGovernmentalInfoCopyWithImpl<_FreeGovernmentalInfo>(this, _$identity); + +@override +Map toJson() { + return _$FreeGovernmentalInfoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FreeGovernmentalInfo&&(identical(other.governmentalAllocatedQuantity, governmentalAllocatedQuantity) || other.governmentalAllocatedQuantity == governmentalAllocatedQuantity)&&(identical(other.totalCommitmentQuantity, totalCommitmentQuantity) || other.totalCommitmentQuantity == totalCommitmentQuantity)&&(identical(other.freeAllocatedQuantity, freeAllocatedQuantity) || other.freeAllocatedQuantity == freeAllocatedQuantity)&&(identical(other.totalFreeCommitmentQuantity, totalFreeCommitmentQuantity) || other.totalFreeCommitmentQuantity == totalFreeCommitmentQuantity)&&(identical(other.leftTotalFreeCommitmentQuantity, leftTotalFreeCommitmentQuantity) || other.leftTotalFreeCommitmentQuantity == leftTotalFreeCommitmentQuantity)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,governmentalAllocatedQuantity,totalCommitmentQuantity,freeAllocatedQuantity,totalFreeCommitmentQuantity,leftTotalFreeCommitmentQuantity); + +@override +String toString() { + return 'FreeGovernmentalInfo(governmentalAllocatedQuantity: $governmentalAllocatedQuantity, totalCommitmentQuantity: $totalCommitmentQuantity, freeAllocatedQuantity: $freeAllocatedQuantity, totalFreeCommitmentQuantity: $totalFreeCommitmentQuantity, leftTotalFreeCommitmentQuantity: $leftTotalFreeCommitmentQuantity)'; +} + + +} + +/// @nodoc +abstract mixin class _$FreeGovernmentalInfoCopyWith<$Res> implements $FreeGovernmentalInfoCopyWith<$Res> { + factory _$FreeGovernmentalInfoCopyWith(_FreeGovernmentalInfo value, $Res Function(_FreeGovernmentalInfo) _then) = __$FreeGovernmentalInfoCopyWithImpl; +@override @useResult +$Res call({ + int? governmentalAllocatedQuantity, double? totalCommitmentQuantity, int? freeAllocatedQuantity, double? totalFreeCommitmentQuantity, int? leftTotalFreeCommitmentQuantity +}); + + + + +} +/// @nodoc +class __$FreeGovernmentalInfoCopyWithImpl<$Res> + implements _$FreeGovernmentalInfoCopyWith<$Res> { + __$FreeGovernmentalInfoCopyWithImpl(this._self, this._then); + + final _FreeGovernmentalInfo _self; + final $Res Function(_FreeGovernmentalInfo) _then; + +/// Create a copy of FreeGovernmentalInfo +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? governmentalAllocatedQuantity = freezed,Object? totalCommitmentQuantity = freezed,Object? freeAllocatedQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? leftTotalFreeCommitmentQuantity = freezed,}) { + return _then(_FreeGovernmentalInfo( +governmentalAllocatedQuantity: freezed == governmentalAllocatedQuantity ? _self.governmentalAllocatedQuantity : governmentalAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalCommitmentQuantity: freezed == totalCommitmentQuantity ? _self.totalCommitmentQuantity : totalCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,freeAllocatedQuantity: freezed == freeAllocatedQuantity ? _self.freeAllocatedQuantity : freeAllocatedQuantity // ignore: cast_nullable_to_non_nullable +as int?,totalFreeCommitmentQuantity: freezed == totalFreeCommitmentQuantity ? _self.totalFreeCommitmentQuantity : totalFreeCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as double?,leftTotalFreeCommitmentQuantity: freezed == leftTotalFreeCommitmentQuantity ? _self.leftTotalFreeCommitmentQuantity : leftTotalFreeCommitmentQuantity // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$Breed { + + String? get breed; int? get mainQuantity; int? get remainQuantity; +/// Create a copy of Breed +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BreedCopyWith get copyWith => _$BreedCopyWithImpl(this as Breed, _$identity); + + /// Serializes this Breed to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Breed&&(identical(other.breed, breed) || other.breed == breed)&&(identical(other.mainQuantity, mainQuantity) || other.mainQuantity == mainQuantity)&&(identical(other.remainQuantity, remainQuantity) || other.remainQuantity == remainQuantity)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,breed,mainQuantity,remainQuantity); + +@override +String toString() { + return 'Breed(breed: $breed, mainQuantity: $mainQuantity, remainQuantity: $remainQuantity)'; +} + + +} + +/// @nodoc +abstract mixin class $BreedCopyWith<$Res> { + factory $BreedCopyWith(Breed value, $Res Function(Breed) _then) = _$BreedCopyWithImpl; +@useResult +$Res call({ + String? breed, int? mainQuantity, int? remainQuantity +}); + + + + +} +/// @nodoc +class _$BreedCopyWithImpl<$Res> + implements $BreedCopyWith<$Res> { + _$BreedCopyWithImpl(this._self, this._then); + + final Breed _self; + final $Res Function(Breed) _then; + +/// Create a copy of Breed +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? breed = freezed,Object? mainQuantity = freezed,Object? remainQuantity = freezed,}) { + return _then(_self.copyWith( +breed: freezed == breed ? _self.breed : breed // ignore: cast_nullable_to_non_nullable +as String?,mainQuantity: freezed == mainQuantity ? _self.mainQuantity : mainQuantity // ignore: cast_nullable_to_non_nullable +as int?,remainQuantity: freezed == remainQuantity ? _self.remainQuantity : remainQuantity // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Breed]. +extension BreedPatterns on Breed { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Breed value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Breed() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Breed value) $default,){ +final _that = this; +switch (_that) { +case _Breed(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Breed value)? $default,){ +final _that = this; +switch (_that) { +case _Breed() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? breed, int? mainQuantity, int? remainQuantity)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Breed() when $default != null: +return $default(_that.breed,_that.mainQuantity,_that.remainQuantity);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? breed, int? mainQuantity, int? remainQuantity) $default,) {final _that = this; +switch (_that) { +case _Breed(): +return $default(_that.breed,_that.mainQuantity,_that.remainQuantity);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? breed, int? mainQuantity, int? remainQuantity)? $default,) {final _that = this; +switch (_that) { +case _Breed() when $default != null: +return $default(_that.breed,_that.mainQuantity,_that.remainQuantity);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Breed implements Breed { + const _Breed({this.breed, this.mainQuantity, this.remainQuantity}); + factory _Breed.fromJson(Map json) => _$BreedFromJson(json); + +@override final String? breed; +@override final int? mainQuantity; +@override final int? remainQuantity; + +/// Create a copy of Breed +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BreedCopyWith<_Breed> get copyWith => __$BreedCopyWithImpl<_Breed>(this, _$identity); + +@override +Map toJson() { + return _$BreedToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Breed&&(identical(other.breed, breed) || other.breed == breed)&&(identical(other.mainQuantity, mainQuantity) || other.mainQuantity == mainQuantity)&&(identical(other.remainQuantity, remainQuantity) || other.remainQuantity == remainQuantity)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,breed,mainQuantity,remainQuantity); + +@override +String toString() { + return 'Breed(breed: $breed, mainQuantity: $mainQuantity, remainQuantity: $remainQuantity)'; +} + + +} + +/// @nodoc +abstract mixin class _$BreedCopyWith<$Res> implements $BreedCopyWith<$Res> { + factory _$BreedCopyWith(_Breed value, $Res Function(_Breed) _then) = __$BreedCopyWithImpl; +@override @useResult +$Res call({ + String? breed, int? mainQuantity, int? remainQuantity +}); + + + + +} +/// @nodoc +class __$BreedCopyWithImpl<$Res> + implements _$BreedCopyWith<$Res> { + __$BreedCopyWithImpl(this._self, this._then); + + final _Breed _self; + final $Res Function(_Breed) _then; + +/// Create a copy of Breed +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? breed = freezed,Object? mainQuantity = freezed,Object? remainQuantity = freezed,}) { + return _then(_Breed( +breed: freezed == breed ? _self.breed : breed // ignore: cast_nullable_to_non_nullable +as String?,mainQuantity: freezed == mainQuantity ? _self.mainQuantity : mainQuantity // ignore: cast_nullable_to_non_nullable +as int?,remainQuantity: freezed == remainQuantity ? _self.remainQuantity : remainQuantity // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$LastChange { + + DateTime? get date; String? get role; String? get type; String? get fullName; +/// Create a copy of LastChange +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LastChangeCopyWith get copyWith => _$LastChangeCopyWithImpl(this as LastChange, _$identity); + + /// Serializes this LastChange to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LastChange&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.type, type) || other.type == type)&&(identical(other.fullName, fullName) || other.fullName == fullName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,date,role,type,fullName); + +@override +String toString() { + return 'LastChange(date: $date, role: $role, type: $type, fullName: $fullName)'; +} + + +} + +/// @nodoc +abstract mixin class $LastChangeCopyWith<$Res> { + factory $LastChangeCopyWith(LastChange value, $Res Function(LastChange) _then) = _$LastChangeCopyWithImpl; +@useResult +$Res call({ + DateTime? date, String? role, String? type, String? fullName +}); + + + + +} +/// @nodoc +class _$LastChangeCopyWithImpl<$Res> + implements $LastChangeCopyWith<$Res> { + _$LastChangeCopyWithImpl(this._self, this._then); + + final LastChange _self; + final $Res Function(LastChange) _then; + +/// Create a copy of LastChange +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? date = freezed,Object? role = freezed,Object? type = freezed,Object? fullName = freezed,}) { + return _then(_self.copyWith( +date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [LastChange]. +extension LastChangePatterns on LastChange { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LastChange value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LastChange() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LastChange value) $default,){ +final _that = this; +switch (_that) { +case _LastChange(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LastChange value)? $default,){ +final _that = this; +switch (_that) { +case _LastChange() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( DateTime? date, String? role, String? type, String? fullName)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LastChange() when $default != null: +return $default(_that.date,_that.role,_that.type,_that.fullName);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( DateTime? date, String? role, String? type, String? fullName) $default,) {final _that = this; +switch (_that) { +case _LastChange(): +return $default(_that.date,_that.role,_that.type,_that.fullName);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( DateTime? date, String? role, String? type, String? fullName)? $default,) {final _that = this; +switch (_that) { +case _LastChange() when $default != null: +return $default(_that.date,_that.role,_that.type,_that.fullName);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _LastChange implements LastChange { + const _LastChange({this.date, this.role, this.type, this.fullName}); + factory _LastChange.fromJson(Map json) => _$LastChangeFromJson(json); + +@override final DateTime? date; +@override final String? role; +@override final String? type; +@override final String? fullName; + +/// Create a copy of LastChange +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LastChangeCopyWith<_LastChange> get copyWith => __$LastChangeCopyWithImpl<_LastChange>(this, _$identity); + +@override +Map toJson() { + return _$LastChangeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LastChange&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.type, type) || other.type == type)&&(identical(other.fullName, fullName) || other.fullName == fullName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,date,role,type,fullName); + +@override +String toString() { + return 'LastChange(date: $date, role: $role, type: $type, fullName: $fullName)'; +} + + +} + +/// @nodoc +abstract mixin class _$LastChangeCopyWith<$Res> implements $LastChangeCopyWith<$Res> { + factory _$LastChangeCopyWith(_LastChange value, $Res Function(_LastChange) _then) = __$LastChangeCopyWithImpl; +@override @useResult +$Res call({ + DateTime? date, String? role, String? type, String? fullName +}); + + + + +} +/// @nodoc +class __$LastChangeCopyWithImpl<$Res> + implements _$LastChangeCopyWith<$Res> { + __$LastChangeCopyWithImpl(this._self, this._then); + + final _LastChange _self; + final $Res Function(_LastChange) _then; + +/// Create a copy of LastChange +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? date = freezed,Object? role = freezed,Object? type = freezed,Object? fullName = freezed,}) { + return _then(_LastChange( +date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$LatestHatchingChange { + + DateTime? get date; String? get role; String? get fullName; +/// Create a copy of LatestHatchingChange +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LatestHatchingChangeCopyWith get copyWith => _$LatestHatchingChangeCopyWithImpl(this as LatestHatchingChange, _$identity); + + /// Serializes this LatestHatchingChange to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestHatchingChange&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.fullName, fullName) || other.fullName == fullName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,date,role,fullName); + +@override +String toString() { + return 'LatestHatchingChange(date: $date, role: $role, fullName: $fullName)'; +} + + +} + +/// @nodoc +abstract mixin class $LatestHatchingChangeCopyWith<$Res> { + factory $LatestHatchingChangeCopyWith(LatestHatchingChange value, $Res Function(LatestHatchingChange) _then) = _$LatestHatchingChangeCopyWithImpl; +@useResult +$Res call({ + DateTime? date, String? role, String? fullName +}); + + + + +} +/// @nodoc +class _$LatestHatchingChangeCopyWithImpl<$Res> + implements $LatestHatchingChangeCopyWith<$Res> { + _$LatestHatchingChangeCopyWithImpl(this._self, this._then); + + final LatestHatchingChange _self; + final $Res Function(LatestHatchingChange) _then; + +/// Create a copy of LatestHatchingChange +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? date = freezed,Object? role = freezed,Object? fullName = freezed,}) { + return _then(_self.copyWith( +date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [LatestHatchingChange]. +extension LatestHatchingChangePatterns on LatestHatchingChange { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LatestHatchingChange value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LatestHatchingChange() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LatestHatchingChange value) $default,){ +final _that = this; +switch (_that) { +case _LatestHatchingChange(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LatestHatchingChange value)? $default,){ +final _that = this; +switch (_that) { +case _LatestHatchingChange() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( DateTime? date, String? role, String? fullName)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LatestHatchingChange() when $default != null: +return $default(_that.date,_that.role,_that.fullName);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( DateTime? date, String? role, String? fullName) $default,) {final _that = this; +switch (_that) { +case _LatestHatchingChange(): +return $default(_that.date,_that.role,_that.fullName);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( DateTime? date, String? role, String? fullName)? $default,) {final _that = this; +switch (_that) { +case _LatestHatchingChange() when $default != null: +return $default(_that.date,_that.role,_that.fullName);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _LatestHatchingChange implements LatestHatchingChange { + const _LatestHatchingChange({this.date, this.role, this.fullName}); + factory _LatestHatchingChange.fromJson(Map json) => _$LatestHatchingChangeFromJson(json); + +@override final DateTime? date; +@override final String? role; +@override final String? fullName; + +/// Create a copy of LatestHatchingChange +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LatestHatchingChangeCopyWith<_LatestHatchingChange> get copyWith => __$LatestHatchingChangeCopyWithImpl<_LatestHatchingChange>(this, _$identity); + +@override +Map toJson() { + return _$LatestHatchingChangeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestHatchingChange&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.fullName, fullName) || other.fullName == fullName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,date,role,fullName); + +@override +String toString() { + return 'LatestHatchingChange(date: $date, role: $role, fullName: $fullName)'; +} + + +} + +/// @nodoc +abstract mixin class _$LatestHatchingChangeCopyWith<$Res> implements $LatestHatchingChangeCopyWith<$Res> { + factory _$LatestHatchingChangeCopyWith(_LatestHatchingChange value, $Res Function(_LatestHatchingChange) _then) = __$LatestHatchingChangeCopyWithImpl; +@override @useResult +$Res call({ + DateTime? date, String? role, String? fullName +}); + + + + +} +/// @nodoc +class __$LatestHatchingChangeCopyWithImpl<$Res> + implements _$LatestHatchingChangeCopyWith<$Res> { + __$LatestHatchingChangeCopyWithImpl(this._self, this._then); + + final _LatestHatchingChange _self; + final $Res Function(_LatestHatchingChange) _then; + +/// Create a copy of LatestHatchingChange +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? date = freezed,Object? role = freezed,Object? fullName = freezed,}) { + return _then(_LatestHatchingChange( +date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart new file mode 100644 index 0000000..2522641 --- /dev/null +++ b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart @@ -0,0 +1,385 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'hatching_details.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_HatchingDetails _$HatchingDetailsFromJson( + Map json, +) => _HatchingDetails( + id: (json['id'] as num?)?.toInt(), + chainCompany: json['chain_company'] as String?, + age: (json['age'] as num?)?.toInt(), + inspectionLosses: json['inspection_losses'], + vetFarm: json['vet_farm'] == null + ? null + : VetFarm.fromJson(json['vet_farm'] as Map), + activeKill: json['active_kill'] == null + ? null + : ActiveKill.fromJson(json['active_kill'] as Map), + killingInfo: json['killing_info'] == null + ? null + : KillingInfo.fromJson(json['killing_info'] as Map), + freeGovernmentalInfo: json['free_governmental_info'] == null + ? null + : FreeGovernmentalInfo.fromJson( + json['free_governmental_info'] as Map, + ), + key: json['key'] as String?, + createDate: json['create_date'] == null + ? null + : DateTime.parse(json['create_date'] as String), + modifyDate: json['modify_date'] == null + ? null + : DateTime.parse(json['modify_date'] as String), + trash: json['trash'] as bool?, + hasChainCompany: json['has_chain_company'] as bool?, + poultryIdForeignKey: json['poultry_id_foreign_key'], + poultryHatchingIdKey: json['poultry_hatching_id_key'], + quantity: (json['quantity'] as num?)?.toInt(), + losses: (json['losses'] as num?)?.toInt(), + leftOver: (json['left_over'] as num?)?.toInt(), + killedQuantity: (json['killed_quantity'] as num?)?.toInt(), + extraKilledQuantity: (json['extra_killed_quantity'] as num?)?.toInt(), + governmentalKilledQuantity: (json['governmental_killed_quantity'] as num?) + ?.toDouble(), + governmentalQuantity: (json['governmental_quantity'] as num?)?.toDouble(), + freeKilledQuantity: (json['free_killed_quantity'] as num?)?.toDouble(), + freeQuantity: (json['free_quantity'] as num?)?.toDouble(), + chainKilledQuantity: (json['chain_killed_quantity'] as num?)?.toDouble(), + chainKilledWeight: (json['chain_killed_weight'] as num?)?.toDouble(), + outProvinceKilledWeight: (json['out_province_killed_weight'] as num?) + ?.toDouble(), + outProvinceKilledQuantity: (json['out_province_killed_quantity'] as num?) + ?.toDouble(), + exportKilledWeight: (json['export_killed_weight'] as num?)?.toDouble(), + exportKilledQuantity: (json['export_killed_quantity'] as num?)?.toDouble(), + totalCommitment: (json['total_commitment'] as num?)?.toDouble(), + commitmentType: json['commitment_type'] as String?, + totalCommitmentQuantity: (json['total_commitment_quantity'] as num?) + ?.toDouble(), + totalFreeCommitmentQuantity: (json['total_free_commitment_quantity'] as num?) + ?.toDouble(), + totalFreeCommitmentWeight: (json['total_free_commitment_weight'] as num?) + ?.toDouble(), + totalKilledWeight: (json['total_killed_weight'] as num?)?.toDouble(), + totalAverageKilledWeight: (json['total_average_killed_weight'] as num?) + ?.toDouble(), + requestLeftOver: (json['request_left_over'] as num?)?.toInt(), + hall: (json['hall'] as num?)?.toInt(), + date: json['date'] == null ? null : DateTime.parse(json['date'] as String), + predicateDate: json['predicate_date'] == null + ? null + : DateTime.parse(json['predicate_date'] as String), + chickenBreed: json['chicken_breed'] as String?, + period: (json['period'] as num?)?.toInt(), + allowHatching: json['allow_hatching'] as String?, + state: json['state'] as String?, + archive: json['archive'] as bool?, + violation: json['violation'] as bool?, + message: json['message'], + registrar: json['registrar'], + breed: (json['breed'] as List?) + ?.map((e) => Breed.fromJson(e as Map)) + .toList(), + cityNumber: (json['city_number'] as num?)?.toInt(), + cityName: json['city_name'] as String?, + provinceNumber: (json['province_number'] as num?)?.toInt(), + provinceName: json['province_name'] as String?, + lastChange: json['last_change'] == null + ? null + : LastChange.fromJson(json['last_change'] as Map), + chickenAge: (json['chicken_age'] as num?)?.toInt(), + nowAge: (json['now_age'] as num?)?.toInt(), + latestHatchingChange: json['latest_hatching_change'] == null + ? null + : LatestHatchingChange.fromJson( + json['latest_hatching_change'] as Map, + ), + violationReport: json['violation_report'], + violationMessage: json['violation_message'] as String?, + violationImage: json['violation_image'], + violationReporter: json['violation_reporter'], + violationReportDate: json['violation_report_date'], + violationReportEditor: json['violation_report_editor'], + violationReportEditDate: json['violation_report_edit_date'], + totalLosses: (json['total_losses'] as num?)?.toInt(), + directLosses: (json['direct_losses'] as num?)?.toInt(), + directLossesInputer: json['direct_losses_inputer'], + directLossesDate: json['direct_losses_date'], + directLossesEditor: json['direct_losses_editor'], + directLossesLastEditDate: json['direct_losses_last_edit_date'], + endPeriodLossesInputer: json['end_period_losses_inputer'], + endPeriodLossesDate: json['end_period_losses_date'], + endPeriodLossesEditor: json['end_period_losses_editor'], + endPeriodLossesLastEditDate: json['end_period_losses_last_edit_date'], + breedingUniqueId: json['breeding_unique_id'] as String?, + licenceNumber: json['licence_number'] as String?, + temporaryTrash: json['temporary_trash'] as bool?, + temporaryDeleted: json['temporary_deleted'] as bool?, + firstDateInputArchive: json['first_date_input_archive'], + secondDateInputArchive: json['second_date_input_archive'], + inputArchiver: json['input_archiver'], + outputArchiveDate: json['output_archive_date'], + outputArchiver: json['output_archiver'], + barDifferenceRequestWeight: (json['bar_difference_request_weight'] as num?) + ?.toDouble(), + barDifferenceRequestQuantity: + (json['bar_difference_request_quantity'] as num?)?.toDouble(), + healthCertificate: json['health_certificate'], + samasatDischargePercentage: (json['samasat_discharge_percentage'] as num?) + ?.toInt(), + personTypeName: json['person_type_name'] as String?, + interactTypeName: json['interact_type_name'] as String?, + unionTypeName: json['union_type_name'] as String?, + certId: json['cert_id'] as String?, + increaseQuantity: (json['increase_quantity'] as num?)?.toInt(), + tenantFullname: json['tenant_fullname'], + tenantNationalCode: json['tenant_national_code'], + tenantMobile: json['tenant_mobile'], + tenantCity: json['tenant_city'], + hasTenant: json['has_tenant'] as bool?, + createdBy: json['created_by'], + modifiedBy: json['modified_by'], + poultry: (json['poultry'] as num?)?.toInt(), +); + +Map _$HatchingDetailsToJson(_HatchingDetails instance) => + { + 'id': instance.id, + 'chain_company': instance.chainCompany, + 'age': instance.age, + 'inspection_losses': instance.inspectionLosses, + 'vet_farm': instance.vetFarm, + 'active_kill': instance.activeKill, + 'killing_info': instance.killingInfo, + 'free_governmental_info': instance.freeGovernmentalInfo, + 'key': instance.key, + 'create_date': instance.createDate?.toIso8601String(), + 'modify_date': instance.modifyDate?.toIso8601String(), + 'trash': instance.trash, + 'has_chain_company': instance.hasChainCompany, + 'poultry_id_foreign_key': instance.poultryIdForeignKey, + 'poultry_hatching_id_key': instance.poultryHatchingIdKey, + 'quantity': instance.quantity, + 'losses': instance.losses, + 'left_over': instance.leftOver, + 'killed_quantity': instance.killedQuantity, + 'extra_killed_quantity': instance.extraKilledQuantity, + 'governmental_killed_quantity': instance.governmentalKilledQuantity, + 'governmental_quantity': instance.governmentalQuantity, + 'free_killed_quantity': instance.freeKilledQuantity, + 'free_quantity': instance.freeQuantity, + 'chain_killed_quantity': instance.chainKilledQuantity, + 'chain_killed_weight': instance.chainKilledWeight, + 'out_province_killed_weight': instance.outProvinceKilledWeight, + 'out_province_killed_quantity': instance.outProvinceKilledQuantity, + 'export_killed_weight': instance.exportKilledWeight, + 'export_killed_quantity': instance.exportKilledQuantity, + 'total_commitment': instance.totalCommitment, + 'commitment_type': instance.commitmentType, + 'total_commitment_quantity': instance.totalCommitmentQuantity, + 'total_free_commitment_quantity': instance.totalFreeCommitmentQuantity, + 'total_free_commitment_weight': instance.totalFreeCommitmentWeight, + 'total_killed_weight': instance.totalKilledWeight, + 'total_average_killed_weight': instance.totalAverageKilledWeight, + 'request_left_over': instance.requestLeftOver, + 'hall': instance.hall, + 'date': instance.date?.toIso8601String(), + 'predicate_date': instance.predicateDate?.toIso8601String(), + 'chicken_breed': instance.chickenBreed, + 'period': instance.period, + 'allow_hatching': instance.allowHatching, + 'state': instance.state, + 'archive': instance.archive, + 'violation': instance.violation, + 'message': instance.message, + 'registrar': instance.registrar, + 'breed': instance.breed, + 'city_number': instance.cityNumber, + 'city_name': instance.cityName, + 'province_number': instance.provinceNumber, + 'province_name': instance.provinceName, + 'last_change': instance.lastChange, + 'chicken_age': instance.chickenAge, + 'now_age': instance.nowAge, + 'latest_hatching_change': instance.latestHatchingChange, + 'violation_report': instance.violationReport, + 'violation_message': instance.violationMessage, + 'violation_image': instance.violationImage, + 'violation_reporter': instance.violationReporter, + 'violation_report_date': instance.violationReportDate, + 'violation_report_editor': instance.violationReportEditor, + 'violation_report_edit_date': instance.violationReportEditDate, + 'total_losses': instance.totalLosses, + 'direct_losses': instance.directLosses, + 'direct_losses_inputer': instance.directLossesInputer, + 'direct_losses_date': instance.directLossesDate, + 'direct_losses_editor': instance.directLossesEditor, + 'direct_losses_last_edit_date': instance.directLossesLastEditDate, + 'end_period_losses_inputer': instance.endPeriodLossesInputer, + 'end_period_losses_date': instance.endPeriodLossesDate, + 'end_period_losses_editor': instance.endPeriodLossesEditor, + 'end_period_losses_last_edit_date': instance.endPeriodLossesLastEditDate, + 'breeding_unique_id': instance.breedingUniqueId, + 'licence_number': instance.licenceNumber, + 'temporary_trash': instance.temporaryTrash, + 'temporary_deleted': instance.temporaryDeleted, + 'first_date_input_archive': instance.firstDateInputArchive, + 'second_date_input_archive': instance.secondDateInputArchive, + 'input_archiver': instance.inputArchiver, + 'output_archive_date': instance.outputArchiveDate, + 'output_archiver': instance.outputArchiver, + 'bar_difference_request_weight': instance.barDifferenceRequestWeight, + 'bar_difference_request_quantity': instance.barDifferenceRequestQuantity, + 'health_certificate': instance.healthCertificate, + 'samasat_discharge_percentage': instance.samasatDischargePercentage, + 'person_type_name': instance.personTypeName, + 'interact_type_name': instance.interactTypeName, + 'union_type_name': instance.unionTypeName, + 'cert_id': instance.certId, + 'increase_quantity': instance.increaseQuantity, + 'tenant_fullname': instance.tenantFullname, + 'tenant_national_code': instance.tenantNationalCode, + 'tenant_mobile': instance.tenantMobile, + 'tenant_city': instance.tenantCity, + 'has_tenant': instance.hasTenant, + 'created_by': instance.createdBy, + 'modified_by': instance.modifiedBy, + 'poultry': instance.poultry, + }; + +_VetFarm _$VetFarmFromJson(Map json) => _VetFarm( + vetFarmFullName: json['vet_farm_full_name'] as String?, + vetFarmMobile: json['vet_farm_mobile'] as String?, +); + +Map _$VetFarmToJson(_VetFarm instance) => { + 'vet_farm_full_name': instance.vetFarmFullName, + 'vet_farm_mobile': instance.vetFarmMobile, +}; + +_ActiveKill _$ActiveKillFromJson(Map json) => _ActiveKill( + activeKill: json['active_kill'] as bool?, + countOfRequest: (json['count_of_request'] as num?)?.toInt(), +); + +Map _$ActiveKillToJson(_ActiveKill instance) => + { + 'active_kill': instance.activeKill, + 'count_of_request': instance.countOfRequest, + }; + +_KillingInfo _$KillingInfoFromJson(Map json) => _KillingInfo( + violationMessage: json['violation_message'] as String?, + provinceKillRequests: (json['province_kill_requests'] as num?)?.toInt(), + provinceKillRequestsQuantity: + (json['province_kill_requests_quantity'] as num?)?.toInt(), + provinceKillRequestsWeight: (json['province_kill_requests_weight'] as num?) + ?.toDouble(), + killHouseRequests: (json['kill_house_requests'] as num?)?.toInt(), + killHouseRequestsFirstQuantity: + (json['kill_house_requests_first_quantity'] as num?)?.toInt(), + killHouseRequestsFirstWeight: + (json['kill_house_requests_first_weight'] as num?)?.toDouble(), + barCompleteWithKillHouse: (json['bar_complete_with_kill_house'] as num?) + ?.toInt(), + acceptedRealQuantityFinal: (json['accepted_real_quantity_final'] as num?) + ?.toInt(), + acceptedRealWightFinal: (json['accepted_real_wight_final'] as num?) + ?.toDouble(), + wareHouseBars: (json['ware_house_bars'] as num?)?.toInt(), + wareHouseBarsQuantity: (json['ware_house_bars_quantity'] as num?)?.toInt(), + wareHouseBarsWeight: (json['ware_house_bars_weight'] as num?)?.toDouble(), + wareHouseBarsWeightLose: (json['ware_house_bars_weight_lose'] as num?) + ?.toDouble(), +); + +Map _$KillingInfoToJson( + _KillingInfo instance, +) => { + 'violation_message': instance.violationMessage, + 'province_kill_requests': instance.provinceKillRequests, + 'province_kill_requests_quantity': instance.provinceKillRequestsQuantity, + 'province_kill_requests_weight': instance.provinceKillRequestsWeight, + 'kill_house_requests': instance.killHouseRequests, + 'kill_house_requests_first_quantity': instance.killHouseRequestsFirstQuantity, + 'kill_house_requests_first_weight': instance.killHouseRequestsFirstWeight, + 'bar_complete_with_kill_house': instance.barCompleteWithKillHouse, + 'accepted_real_quantity_final': instance.acceptedRealQuantityFinal, + 'accepted_real_wight_final': instance.acceptedRealWightFinal, + 'ware_house_bars': instance.wareHouseBars, + 'ware_house_bars_quantity': instance.wareHouseBarsQuantity, + 'ware_house_bars_weight': instance.wareHouseBarsWeight, + 'ware_house_bars_weight_lose': instance.wareHouseBarsWeightLose, +}; + +_FreeGovernmentalInfo _$FreeGovernmentalInfoFromJson( + Map json, +) => _FreeGovernmentalInfo( + governmentalAllocatedQuantity: + (json['governmental_allocated_quantity'] as num?)?.toInt(), + totalCommitmentQuantity: (json['total_commitment_quantity'] as num?) + ?.toDouble(), + freeAllocatedQuantity: (json['free_allocated_quantity'] as num?)?.toInt(), + totalFreeCommitmentQuantity: (json['total_free_commitment_quantity'] as num?) + ?.toDouble(), + leftTotalFreeCommitmentQuantity: + (json['left_total_free_commitment_quantity'] as num?)?.toInt(), +); + +Map _$FreeGovernmentalInfoToJson( + _FreeGovernmentalInfo instance, +) => { + 'governmental_allocated_quantity': instance.governmentalAllocatedQuantity, + 'total_commitment_quantity': instance.totalCommitmentQuantity, + 'free_allocated_quantity': instance.freeAllocatedQuantity, + 'total_free_commitment_quantity': instance.totalFreeCommitmentQuantity, + 'left_total_free_commitment_quantity': + instance.leftTotalFreeCommitmentQuantity, +}; + +_Breed _$BreedFromJson(Map json) => _Breed( + breed: json['breed'] as String?, + mainQuantity: (json['main_quantity'] as num?)?.toInt(), + remainQuantity: (json['remain_quantity'] as num?)?.toInt(), +); + +Map _$BreedToJson(_Breed instance) => { + 'breed': instance.breed, + 'main_quantity': instance.mainQuantity, + 'remain_quantity': instance.remainQuantity, +}; + +_LastChange _$LastChangeFromJson(Map json) => _LastChange( + date: json['date'] == null ? null : DateTime.parse(json['date'] as String), + role: json['role'] as String?, + type: json['type'] as String?, + fullName: json['full_name'] as String?, +); + +Map _$LastChangeToJson(_LastChange instance) => + { + 'date': instance.date?.toIso8601String(), + 'role': instance.role, + 'type': instance.type, + 'full_name': instance.fullName, + }; + +_LatestHatchingChange _$LatestHatchingChangeFromJson( + Map json, +) => _LatestHatchingChange( + date: json['date'] == null ? null : DateTime.parse(json['date'] as String), + role: json['role'] as String?, + fullName: json['full_name'] as String?, +); + +Map _$LatestHatchingChangeToJson( + _LatestHatchingChange instance, +) => { + 'date': instance.date?.toIso8601String(), + 'role': instance.role, + 'full_name': instance.fullName, +}; diff --git a/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.dart b/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.dart new file mode 100644 index 0000000..a0da0d1 --- /dev/null +++ b/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.dart @@ -0,0 +1,55 @@ +import 'package:rasadyar_core/core.dart'; + +part 'poultry_location_model.freezed.dart'; +part 'poultry_location_model.g.dart'; + +@freezed +abstract class PoultryLocationModel with _$PoultryLocationModel { + const factory PoultryLocationModel({ + int? id, + String? unitName, + @JsonKey(name: 'Lat') double? lat, + @JsonKey(name: 'Long') double? long, + User? user, + List? hatching, + Address? address, + String? breedingUniqueId, + @JsonKey(includeFromJson: false, includeToJson: false) LatLng? latLng, + }) = _PoultryLocationModel; + + factory PoultryLocationModel.fromJson(Map json) => + _$PoultryLocationModelFromJson(json).copyWith( + latLng: (json['Lat'] != null && json['Long'] != null) + ? LatLng(json['Lat'] as double, json['Long'] as double) + : null, + ); +} + +@freezed +abstract class User with _$User { + const factory User({String? fullname, String? mobile}) = _User; + + factory User.fromJson(Map json) => _$UserFromJson(json); +} + +@freezed +abstract class Hatching with _$Hatching { + const factory Hatching({int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber}) = + _Hatching; + + factory Hatching.fromJson(Map json) => _$HatchingFromJson(json); +} + +@freezed +abstract class Address with _$Address { + const factory Address({City? city, String? address}) = _Address; + + factory Address.fromJson(Map json) => _$AddressFromJson(json); +} + +@freezed +abstract class City with _$City { + const factory City({String? name}) = _City; + + factory City.fromJson(Map json) => _$CityFromJson(json); +} diff --git a/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.freezed.dart b/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.freezed.dart new file mode 100644 index 0000000..68f16d3 --- /dev/null +++ b/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.freezed.dart @@ -0,0 +1,1448 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'poultry_location_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$PoultryLocationModel { + + int? get id; String? get unitName;@JsonKey(name: 'Lat') double? get lat;@JsonKey(name: 'Long') double? get long; User? get user; List? get hatching; Address? get address; String? get breedingUniqueId;@JsonKey(includeFromJson: false, includeToJson: false) LatLng? get latLng; +/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PoultryLocationModelCopyWith get copyWith => _$PoultryLocationModelCopyWithImpl(this as PoultryLocationModel, _$identity); + + /// Serializes this PoultryLocationModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PoultryLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.long, long) || other.long == long)&&(identical(other.user, user) || other.user == user)&&const DeepCollectionEquality().equals(other.hatching, hatching)&&(identical(other.address, address) || other.address == address)&&(identical(other.breedingUniqueId, breedingUniqueId) || other.breedingUniqueId == breedingUniqueId)&&(identical(other.latLng, latLng) || other.latLng == latLng)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,unitName,lat,long,user,const DeepCollectionEquality().hash(hatching),address,breedingUniqueId,latLng); + +@override +String toString() { + return 'PoultryLocationModel(id: $id, unitName: $unitName, lat: $lat, long: $long, user: $user, hatching: $hatching, address: $address, breedingUniqueId: $breedingUniqueId, latLng: $latLng)'; +} + + +} + +/// @nodoc +abstract mixin class $PoultryLocationModelCopyWith<$Res> { + factory $PoultryLocationModelCopyWith(PoultryLocationModel value, $Res Function(PoultryLocationModel) _then) = _$PoultryLocationModelCopyWithImpl; +@useResult +$Res call({ + int? id, String? unitName,@JsonKey(name: 'Lat') double? lat,@JsonKey(name: 'Long') double? long, User? user, List? hatching, Address? address, String? breedingUniqueId,@JsonKey(includeFromJson: false, includeToJson: false) LatLng? latLng +}); + + +$UserCopyWith<$Res>? get user;$AddressCopyWith<$Res>? get address; + +} +/// @nodoc +class _$PoultryLocationModelCopyWithImpl<$Res> + implements $PoultryLocationModelCopyWith<$Res> { + _$PoultryLocationModelCopyWithImpl(this._self, this._then); + + final PoultryLocationModel _self; + final $Res Function(PoultryLocationModel) _then; + +/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? unitName = freezed,Object? lat = freezed,Object? long = freezed,Object? user = freezed,Object? hatching = freezed,Object? address = freezed,Object? breedingUniqueId = freezed,Object? latLng = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,lat: freezed == lat ? _self.lat : lat // ignore: cast_nullable_to_non_nullable +as double?,long: freezed == long ? _self.long : long // ignore: cast_nullable_to_non_nullable +as double?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,hatching: freezed == hatching ? _self.hatching : hatching // ignore: cast_nullable_to_non_nullable +as List?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,breedingUniqueId: freezed == breedingUniqueId ? _self.breedingUniqueId : breedingUniqueId // ignore: cast_nullable_to_non_nullable +as String?,latLng: freezed == latLng ? _self.latLng : latLng // ignore: cast_nullable_to_non_nullable +as LatLng?, + )); +} +/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PoultryLocationModel]. +extension PoultryLocationModelPatterns on PoultryLocationModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PoultryLocationModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PoultryLocationModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PoultryLocationModel value) $default,){ +final _that = this; +switch (_that) { +case _PoultryLocationModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PoultryLocationModel value)? $default,){ +final _that = this; +switch (_that) { +case _PoultryLocationModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List? hatching, Address? address, String? breedingUniqueId, @JsonKey(includeFromJson: false, includeToJson: false) LatLng? latLng)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PoultryLocationModel() when $default != null: +return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address,_that.breedingUniqueId,_that.latLng);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List? hatching, Address? address, String? breedingUniqueId, @JsonKey(includeFromJson: false, includeToJson: false) LatLng? latLng) $default,) {final _that = this; +switch (_that) { +case _PoultryLocationModel(): +return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address,_that.breedingUniqueId,_that.latLng);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List? hatching, Address? address, String? breedingUniqueId, @JsonKey(includeFromJson: false, includeToJson: false) LatLng? latLng)? $default,) {final _that = this; +switch (_that) { +case _PoultryLocationModel() when $default != null: +return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address,_that.breedingUniqueId,_that.latLng);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PoultryLocationModel implements PoultryLocationModel { + const _PoultryLocationModel({this.id, this.unitName, @JsonKey(name: 'Lat') this.lat, @JsonKey(name: 'Long') this.long, this.user, final List? hatching, this.address, this.breedingUniqueId, @JsonKey(includeFromJson: false, includeToJson: false) this.latLng}): _hatching = hatching; + factory _PoultryLocationModel.fromJson(Map json) => _$PoultryLocationModelFromJson(json); + +@override final int? id; +@override final String? unitName; +@override@JsonKey(name: 'Lat') final double? lat; +@override@JsonKey(name: 'Long') final double? long; +@override final User? user; + final List? _hatching; +@override List? get hatching { + final value = _hatching; + if (value == null) return null; + if (_hatching is EqualUnmodifiableListView) return _hatching; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final Address? address; +@override final String? breedingUniqueId; +@override@JsonKey(includeFromJson: false, includeToJson: false) final LatLng? latLng; + +/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PoultryLocationModelCopyWith<_PoultryLocationModel> get copyWith => __$PoultryLocationModelCopyWithImpl<_PoultryLocationModel>(this, _$identity); + +@override +Map toJson() { + return _$PoultryLocationModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PoultryLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.long, long) || other.long == long)&&(identical(other.user, user) || other.user == user)&&const DeepCollectionEquality().equals(other._hatching, _hatching)&&(identical(other.address, address) || other.address == address)&&(identical(other.breedingUniqueId, breedingUniqueId) || other.breedingUniqueId == breedingUniqueId)&&(identical(other.latLng, latLng) || other.latLng == latLng)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,unitName,lat,long,user,const DeepCollectionEquality().hash(_hatching),address,breedingUniqueId,latLng); + +@override +String toString() { + return 'PoultryLocationModel(id: $id, unitName: $unitName, lat: $lat, long: $long, user: $user, hatching: $hatching, address: $address, breedingUniqueId: $breedingUniqueId, latLng: $latLng)'; +} + + +} + +/// @nodoc +abstract mixin class _$PoultryLocationModelCopyWith<$Res> implements $PoultryLocationModelCopyWith<$Res> { + factory _$PoultryLocationModelCopyWith(_PoultryLocationModel value, $Res Function(_PoultryLocationModel) _then) = __$PoultryLocationModelCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? unitName,@JsonKey(name: 'Lat') double? lat,@JsonKey(name: 'Long') double? long, User? user, List? hatching, Address? address, String? breedingUniqueId,@JsonKey(includeFromJson: false, includeToJson: false) LatLng? latLng +}); + + +@override $UserCopyWith<$Res>? get user;@override $AddressCopyWith<$Res>? get address; + +} +/// @nodoc +class __$PoultryLocationModelCopyWithImpl<$Res> + implements _$PoultryLocationModelCopyWith<$Res> { + __$PoultryLocationModelCopyWithImpl(this._self, this._then); + + final _PoultryLocationModel _self; + final $Res Function(_PoultryLocationModel) _then; + +/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? unitName = freezed,Object? lat = freezed,Object? long = freezed,Object? user = freezed,Object? hatching = freezed,Object? address = freezed,Object? breedingUniqueId = freezed,Object? latLng = freezed,}) { + return _then(_PoultryLocationModel( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable +as String?,lat: freezed == lat ? _self.lat : lat // ignore: cast_nullable_to_non_nullable +as double?,long: freezed == long ? _self.long : long // ignore: cast_nullable_to_non_nullable +as double?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User?,hatching: freezed == hatching ? _self._hatching : hatching // ignore: cast_nullable_to_non_nullable +as List?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,breedingUniqueId: freezed == breedingUniqueId ? _self.breedingUniqueId : breedingUniqueId // ignore: cast_nullable_to_non_nullable +as String?,latLng: freezed == latLng ? _self.latLng : latLng // ignore: cast_nullable_to_non_nullable +as LatLng?, + )); +} + +/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of PoultryLocationModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + String? get fullname; String? get mobile; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,mobile); + +@override +String toString() { + return 'User(fullname: $fullname, mobile: $mobile)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? mobile +}); + + + + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? mobile = freezed,}) { + return _then(_self.copyWith( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fullname, String? mobile)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.mobile);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fullname, String? mobile) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.fullname,_that.mobile);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fullname, String? mobile)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.fullname,_that.mobile);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({this.fullname, this.mobile}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final String? fullname; +@override final String? mobile; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,mobile); + +@override +String toString() { + return 'User(fullname: $fullname, mobile: $mobile)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? mobile +}); + + + + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? mobile = freezed,}) { + return _then(_User( +fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable +as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Hatching { + + int? get leftOver; int? get chickenAge; DateTime? get date; String? get licenceNumber; +/// Create a copy of Hatching +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$HatchingCopyWith get copyWith => _$HatchingCopyWithImpl(this as Hatching, _$identity); + + /// Serializes this Hatching to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Hatching&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.date, date) || other.date == date)&&(identical(other.licenceNumber, licenceNumber) || other.licenceNumber == licenceNumber)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,leftOver,chickenAge,date,licenceNumber); + +@override +String toString() { + return 'Hatching(leftOver: $leftOver, chickenAge: $chickenAge, date: $date, licenceNumber: $licenceNumber)'; +} + + +} + +/// @nodoc +abstract mixin class $HatchingCopyWith<$Res> { + factory $HatchingCopyWith(Hatching value, $Res Function(Hatching) _then) = _$HatchingCopyWithImpl; +@useResult +$Res call({ + int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber +}); + + + + +} +/// @nodoc +class _$HatchingCopyWithImpl<$Res> + implements $HatchingCopyWith<$Res> { + _$HatchingCopyWithImpl(this._self, this._then); + + final Hatching _self; + final $Res Function(Hatching) _then; + +/// Create a copy of Hatching +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? leftOver = freezed,Object? chickenAge = freezed,Object? date = freezed,Object? licenceNumber = freezed,}) { + return _then(_self.copyWith( +leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable +as int?,chickenAge: freezed == chickenAge ? _self.chickenAge : chickenAge // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,licenceNumber: freezed == licenceNumber ? _self.licenceNumber : licenceNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Hatching]. +extension HatchingPatterns on Hatching { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Hatching value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Hatching() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Hatching value) $default,){ +final _that = this; +switch (_that) { +case _Hatching(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Hatching value)? $default,){ +final _that = this; +switch (_that) { +case _Hatching() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Hatching() when $default != null: +return $default(_that.leftOver,_that.chickenAge,_that.date,_that.licenceNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber) $default,) {final _that = this; +switch (_that) { +case _Hatching(): +return $default(_that.leftOver,_that.chickenAge,_that.date,_that.licenceNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber)? $default,) {final _that = this; +switch (_that) { +case _Hatching() when $default != null: +return $default(_that.leftOver,_that.chickenAge,_that.date,_that.licenceNumber);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Hatching implements Hatching { + const _Hatching({this.leftOver, this.chickenAge, this.date, this.licenceNumber}); + factory _Hatching.fromJson(Map json) => _$HatchingFromJson(json); + +@override final int? leftOver; +@override final int? chickenAge; +@override final DateTime? date; +@override final String? licenceNumber; + +/// Create a copy of Hatching +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$HatchingCopyWith<_Hatching> get copyWith => __$HatchingCopyWithImpl<_Hatching>(this, _$identity); + +@override +Map toJson() { + return _$HatchingToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Hatching&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.date, date) || other.date == date)&&(identical(other.licenceNumber, licenceNumber) || other.licenceNumber == licenceNumber)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,leftOver,chickenAge,date,licenceNumber); + +@override +String toString() { + return 'Hatching(leftOver: $leftOver, chickenAge: $chickenAge, date: $date, licenceNumber: $licenceNumber)'; +} + + +} + +/// @nodoc +abstract mixin class _$HatchingCopyWith<$Res> implements $HatchingCopyWith<$Res> { + factory _$HatchingCopyWith(_Hatching value, $Res Function(_Hatching) _then) = __$HatchingCopyWithImpl; +@override @useResult +$Res call({ + int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber +}); + + + + +} +/// @nodoc +class __$HatchingCopyWithImpl<$Res> + implements _$HatchingCopyWith<$Res> { + __$HatchingCopyWithImpl(this._self, this._then); + + final _Hatching _self; + final $Res Function(_Hatching) _then; + +/// Create a copy of Hatching +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? leftOver = freezed,Object? chickenAge = freezed,Object? date = freezed,Object? licenceNumber = freezed,}) { + return _then(_Hatching( +leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable +as int?,chickenAge: freezed == chickenAge ? _self.chickenAge : chickenAge // ignore: cast_nullable_to_non_nullable +as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as DateTime?,licenceNumber: freezed == licenceNumber ? _self.licenceNumber : licenceNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Address { + + City? get city; String? get address; +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressCopyWith
get copyWith => _$AddressCopyWithImpl
(this as Address, _$identity); + + /// Serializes this Address to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,address); + +@override +String toString() { + return 'Address(city: $city, address: $address)'; +} + + +} + +/// @nodoc +abstract mixin class $AddressCopyWith<$Res> { + factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl; +@useResult +$Res call({ + City? city, String? address +}); + + +$CityCopyWith<$Res>? get city; + +} +/// @nodoc +class _$AddressCopyWithImpl<$Res> + implements $AddressCopyWith<$Res> { + _$AddressCopyWithImpl(this._self, this._then); + + final Address _self; + final $Res Function(Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? city = freezed,Object? address = freezed,}) { + return _then(_self.copyWith( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Address]. +extension AddressPatterns on Address { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Address value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Address value) $default,){ +final _that = this; +switch (_that) { +case _Address(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Address value)? $default,){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( City? city, String? address)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.city,_that.address);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( City? city, String? address) $default,) {final _that = this; +switch (_that) { +case _Address(): +return $default(_that.city,_that.address);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( City? city, String? address)? $default,) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.city,_that.address);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Address implements Address { + const _Address({this.city, this.address}); + factory _Address.fromJson(Map json) => _$AddressFromJson(json); + +@override final City? city; +@override final String? address; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity); + +@override +Map toJson() { + return _$AddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.city, city) || other.city == city)&&(identical(other.address, address) || other.address == address)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,address); + +@override +String toString() { + return 'Address(city: $city, address: $address)'; +} + + +} + +/// @nodoc +abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> { + factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl; +@override @useResult +$Res call({ + City? city, String? address +}); + + +@override $CityCopyWith<$Res>? get city; + +} +/// @nodoc +class __$AddressCopyWithImpl<$Res> + implements _$AddressCopyWith<$Res> { + __$AddressCopyWithImpl(this._self, this._then); + + final _Address _self; + final $Res Function(_Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? city = freezed,Object? address = freezed,}) { + return _then(_Address( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as City?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$City { + + String? get name; +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityCopyWith get copyWith => _$CityCopyWithImpl(this as City, _$identity); + + /// Serializes this City to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is City&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'City(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $CityCopyWith<$Res> { + factory $CityCopyWith(City value, $Res Function(City) _then) = _$CityCopyWithImpl; +@useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class _$CityCopyWithImpl<$Res> + implements $CityCopyWith<$Res> { + _$CityCopyWithImpl(this._self, this._then); + + final City _self; + final $Res Function(City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [City]. +extension CityPatterns on City { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _City value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _City value) $default,){ +final _that = this; +switch (_that) { +case _City(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _City value)? $default,){ +final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name) $default,) {final _that = this; +switch (_that) { +case _City(): +return $default(_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name)? $default,) {final _that = this; +switch (_that) { +case _City() when $default != null: +return $default(_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _City implements City { + const _City({this.name}); + factory _City.fromJson(Map json) => _$CityFromJson(json); + +@override final String? name; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CityCopyWith<_City> get copyWith => __$CityCopyWithImpl<_City>(this, _$identity); + +@override +Map toJson() { + return _$CityToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _City&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'City(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$CityCopyWith<$Res> implements $CityCopyWith<$Res> { + factory _$CityCopyWith(_City value, $Res Function(_City) _then) = __$CityCopyWithImpl; +@override @useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class __$CityCopyWithImpl<$Res> + implements _$CityCopyWith<$Res> { + __$CityCopyWithImpl(this._self, this._then); + + final _City _self; + final $Res Function(_City) _then; + +/// Create a copy of City +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,}) { + return _then(_City( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.g.dart b/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.g.dart new file mode 100644 index 0000000..0c14730 --- /dev/null +++ b/packages/inspection/lib/data/model/response/poultry_location/poultry_location_model.g.dart @@ -0,0 +1,82 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'poultry_location_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_PoultryLocationModel _$PoultryLocationModelFromJson( + Map json, +) => _PoultryLocationModel( + id: (json['id'] as num?)?.toInt(), + unitName: json['unit_name'] as String?, + lat: (json['Lat'] as num?)?.toDouble(), + long: (json['Long'] as num?)?.toDouble(), + user: json['user'] == null + ? null + : User.fromJson(json['user'] as Map), + hatching: (json['hatching'] as List?) + ?.map((e) => Hatching.fromJson(e as Map)) + .toList(), + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + breedingUniqueId: json['breeding_unique_id'] as String?, +); + +Map _$PoultryLocationModelToJson( + _PoultryLocationModel instance, +) => { + 'id': instance.id, + 'unit_name': instance.unitName, + 'Lat': instance.lat, + 'Long': instance.long, + 'user': instance.user, + 'hatching': instance.hatching, + 'address': instance.address, + 'breeding_unique_id': instance.breedingUniqueId, +}; + +_User _$UserFromJson(Map json) => _User( + fullname: json['fullname'] as String?, + mobile: json['mobile'] as String?, +); + +Map _$UserToJson(_User instance) => { + 'fullname': instance.fullname, + 'mobile': instance.mobile, +}; + +_Hatching _$HatchingFromJson(Map json) => _Hatching( + leftOver: (json['left_over'] as num?)?.toInt(), + chickenAge: (json['chicken_age'] as num?)?.toInt(), + date: json['date'] == null ? null : DateTime.parse(json['date'] as String), + licenceNumber: json['licence_number'] as String?, +); + +Map _$HatchingToJson(_Hatching instance) => { + 'left_over': instance.leftOver, + 'chicken_age': instance.chickenAge, + 'date': instance.date?.toIso8601String(), + 'licence_number': instance.licenceNumber, +}; + +_Address _$AddressFromJson(Map json) => _Address( + city: json['city'] == null + ? null + : City.fromJson(json['city'] as Map), + address: json['address'] as String?, +); + +Map _$AddressToJson(_Address instance) => { + 'city': instance.city, + 'address': instance.address, +}; + +_City _$CityFromJson(Map json) => + _City(name: json['name'] as String?); + +Map _$CityToJson(_City instance) => { + 'name': instance.name, +}; diff --git a/packages/inspection/lib/data/model/response/user_profile/user_profile_model.dart b/packages/inspection/lib/data/model/response/user_profile/user_profile_model.dart new file mode 100644 index 0000000..a9dea06 --- /dev/null +++ b/packages/inspection/lib/data/model/response/user_profile/user_profile_model.dart @@ -0,0 +1,73 @@ +import 'package:rasadyar_core/core.dart'; + +part 'user_profile_model.freezed.dart'; + +part 'user_profile_model.g.dart'; + +@freezed +abstract class UserProfileModel with _$UserProfileModel { + const factory UserProfileModel({ + required User user, + required Role role, + required List permissions, + }) = _UserProfileModel; + + factory UserProfileModel.fromJson(Map json) => _$UserProfileModelFromJson(json); +} + +@freezed +abstract class User with _$User { + const factory User({ + required int id, + required String username, + required String password, + required String firstName, + required String lastName, + required bool isActive, + required String mobile, + required String phone, + required String nationalCode, + required DateTime birthdate, + required String nationality, + required String ownership, + required String address, + required String photo, + required int province, + required int city, + required bool otpStatus, + required String cityName, + required String provinceName, + }) = _User; + + + + factory User.fromJson(Map json) => _$UserFromJson(json); +} + +@freezed +abstract class Role with _$Role { + const factory Role({ + required int id, + required String roleName, + required String description, + required RoleType type, + required List permissions, + }) = _Role; + + factory Role.fromJson(Map json) => _$RoleFromJson(json); +} + +@freezed +abstract class RoleType with _$RoleType { + const factory RoleType({String? key, required String name}) = _RoleType; + + factory RoleType.fromJson(Map json) => _$RoleTypeFromJson(json); +} + +@freezed +abstract class Permission with _$Permission { + const factory Permission({required String pageName, required List pageAccess}) = + _Permission; + + factory Permission.fromJson(Map json) => _$PermissionFromJson(json); +} diff --git a/packages/inspection/lib/data/model/response/user_profile/user_profile_model.freezed.dart b/packages/inspection/lib/data/model/response/user_profile/user_profile_model.freezed.dart new file mode 100644 index 0000000..2e3865e --- /dev/null +++ b/packages/inspection/lib/data/model/response/user_profile/user_profile_model.freezed.dart @@ -0,0 +1,1479 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'user_profile_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$UserProfileModel { + + User get user; Role get role; List get permissions; +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserProfileModelCopyWith get copyWith => _$UserProfileModelCopyWithImpl(this as UserProfileModel, _$identity); + + /// Serializes this UserProfileModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfileModel&&(identical(other.user, user) || other.user == user)&&(identical(other.role, role) || other.role == role)&&const DeepCollectionEquality().equals(other.permissions, permissions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user,role,const DeepCollectionEquality().hash(permissions)); + +@override +String toString() { + return 'UserProfileModel(user: $user, role: $role, permissions: $permissions)'; +} + + +} + +/// @nodoc +abstract mixin class $UserProfileModelCopyWith<$Res> { + factory $UserProfileModelCopyWith(UserProfileModel value, $Res Function(UserProfileModel) _then) = _$UserProfileModelCopyWithImpl; +@useResult +$Res call({ + User user, Role role, List permissions +}); + + +$UserCopyWith<$Res> get user;$RoleCopyWith<$Res> get role; + +} +/// @nodoc +class _$UserProfileModelCopyWithImpl<$Res> + implements $UserProfileModelCopyWith<$Res> { + _$UserProfileModelCopyWithImpl(this._self, this._then); + + final UserProfileModel _self; + final $Res Function(UserProfileModel) _then; + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? user = null,Object? role = null,Object? permissions = null,}) { + return _then(_self.copyWith( +user: null == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as Role,permissions: null == permissions ? _self.permissions : permissions // ignore: cast_nullable_to_non_nullable +as List, + )); +} +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res> get user { + + return $UserCopyWith<$Res>(_self.user, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RoleCopyWith<$Res> get role { + + return $RoleCopyWith<$Res>(_self.role, (value) { + return _then(_self.copyWith(role: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [UserProfileModel]. +extension UserProfileModelPatterns on UserProfileModel { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UserProfileModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UserProfileModel value) $default,){ +final _that = this; +switch (_that) { +case _UserProfileModel(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UserProfileModel value)? $default,){ +final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( User user, Role role, List permissions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that.user,_that.role,_that.permissions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( User user, Role role, List permissions) $default,) {final _that = this; +switch (_that) { +case _UserProfileModel(): +return $default(_that.user,_that.role,_that.permissions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( User user, Role role, List permissions)? $default,) {final _that = this; +switch (_that) { +case _UserProfileModel() when $default != null: +return $default(_that.user,_that.role,_that.permissions);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _UserProfileModel implements UserProfileModel { + const _UserProfileModel({required this.user, required this.role, required final List permissions}): _permissions = permissions; + factory _UserProfileModel.fromJson(Map json) => _$UserProfileModelFromJson(json); + +@override final User user; +@override final Role role; + final List _permissions; +@override List get permissions { + if (_permissions is EqualUnmodifiableListView) return _permissions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_permissions); +} + + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserProfileModelCopyWith<_UserProfileModel> get copyWith => __$UserProfileModelCopyWithImpl<_UserProfileModel>(this, _$identity); + +@override +Map toJson() { + return _$UserProfileModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfileModel&&(identical(other.user, user) || other.user == user)&&(identical(other.role, role) || other.role == role)&&const DeepCollectionEquality().equals(other._permissions, _permissions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user,role,const DeepCollectionEquality().hash(_permissions)); + +@override +String toString() { + return 'UserProfileModel(user: $user, role: $role, permissions: $permissions)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserProfileModelCopyWith<$Res> implements $UserProfileModelCopyWith<$Res> { + factory _$UserProfileModelCopyWith(_UserProfileModel value, $Res Function(_UserProfileModel) _then) = __$UserProfileModelCopyWithImpl; +@override @useResult +$Res call({ + User user, Role role, List permissions +}); + + +@override $UserCopyWith<$Res> get user;@override $RoleCopyWith<$Res> get role; + +} +/// @nodoc +class __$UserProfileModelCopyWithImpl<$Res> + implements _$UserProfileModelCopyWith<$Res> { + __$UserProfileModelCopyWithImpl(this._self, this._then); + + final _UserProfileModel _self; + final $Res Function(_UserProfileModel) _then; + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? user = null,Object? role = null,Object? permissions = null,}) { + return _then(_UserProfileModel( +user: null == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as User,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as Role,permissions: null == permissions ? _self._permissions : permissions // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserCopyWith<$Res> get user { + + return $UserCopyWith<$Res>(_self.user, (value) { + return _then(_self.copyWith(user: value)); + }); +}/// Create a copy of UserProfileModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RoleCopyWith<$Res> get role { + + return $RoleCopyWith<$Res>(_self.role, (value) { + return _then(_self.copyWith(role: value)); + }); +} +} + + +/// @nodoc +mixin _$User { + + int get id; String get username; String get password; String get firstName; String get lastName; bool get isActive; String get mobile; String get phone; String get nationalCode; DateTime get birthdate; String get nationality; String get ownership; String get address; String get photo; int get province; int get city; bool get otpStatus; String get cityName; String get provinceName; +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserCopyWith get copyWith => _$UserCopyWithImpl(this as User, _$identity); + + /// Serializes this User to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.id, id) || other.id == id)&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.isActive, isActive) || other.isActive == isActive)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.birthdate, birthdate) || other.birthdate == birthdate)&&(identical(other.nationality, nationality) || other.nationality == nationality)&&(identical(other.ownership, ownership) || other.ownership == ownership)&&(identical(other.address, address) || other.address == address)&&(identical(other.photo, photo) || other.photo == photo)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.otpStatus, otpStatus) || other.otpStatus == otpStatus)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,username,password,firstName,lastName,isActive,mobile,phone,nationalCode,birthdate,nationality,ownership,address,photo,province,city,otpStatus,cityName,provinceName]); + +@override +String toString() { + return 'User(id: $id, username: $username, password: $password, firstName: $firstName, lastName: $lastName, isActive: $isActive, mobile: $mobile, phone: $phone, nationalCode: $nationalCode, birthdate: $birthdate, nationality: $nationality, ownership: $ownership, address: $address, photo: $photo, province: $province, city: $city, otpStatus: $otpStatus, cityName: $cityName, provinceName: $provinceName)'; +} + + +} + +/// @nodoc +abstract mixin class $UserCopyWith<$Res> { + factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl; +@useResult +$Res call({ + int id, String username, String password, String firstName, String lastName, bool isActive, String mobile, String phone, String nationalCode, DateTime birthdate, String nationality, String ownership, String address, String photo, int province, int city, bool otpStatus, String cityName, String provinceName +}); + + + + +} +/// @nodoc +class _$UserCopyWithImpl<$Res> + implements $UserCopyWith<$Res> { + _$UserCopyWithImpl(this._self, this._then); + + final User _self; + final $Res Function(User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? username = null,Object? password = null,Object? firstName = null,Object? lastName = null,Object? isActive = null,Object? mobile = null,Object? phone = null,Object? nationalCode = null,Object? birthdate = null,Object? nationality = null,Object? ownership = null,Object? address = null,Object? photo = null,Object? province = null,Object? city = null,Object? otpStatus = null,Object? cityName = null,Object? provinceName = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int,username: null == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String,firstName: null == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String,lastName: null == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool,mobile: null == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String,nationalCode: null == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String,birthdate: null == birthdate ? _self.birthdate : birthdate // ignore: cast_nullable_to_non_nullable +as DateTime,nationality: null == nationality ? _self.nationality : nationality // ignore: cast_nullable_to_non_nullable +as String,ownership: null == ownership ? _self.ownership : ownership // ignore: cast_nullable_to_non_nullable +as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String,photo: null == photo ? _self.photo : photo // ignore: cast_nullable_to_non_nullable +as String,province: null == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as int,city: null == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as int,otpStatus: null == otpStatus ? _self.otpStatus : otpStatus // ignore: cast_nullable_to_non_nullable +as bool,cityName: null == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String,provinceName: null == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [User]. +extension UserPatterns on User { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _User value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _User value) $default,){ +final _that = this; +switch (_that) { +case _User(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _User value)? $default,){ +final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int id, String username, String password, String firstName, String lastName, bool isActive, String mobile, String phone, String nationalCode, DateTime birthdate, String nationality, String ownership, String address, String photo, int province, int city, bool otpStatus, String cityName, String provinceName)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.id,_that.username,_that.password,_that.firstName,_that.lastName,_that.isActive,_that.mobile,_that.phone,_that.nationalCode,_that.birthdate,_that.nationality,_that.ownership,_that.address,_that.photo,_that.province,_that.city,_that.otpStatus,_that.cityName,_that.provinceName);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int id, String username, String password, String firstName, String lastName, bool isActive, String mobile, String phone, String nationalCode, DateTime birthdate, String nationality, String ownership, String address, String photo, int province, int city, bool otpStatus, String cityName, String provinceName) $default,) {final _that = this; +switch (_that) { +case _User(): +return $default(_that.id,_that.username,_that.password,_that.firstName,_that.lastName,_that.isActive,_that.mobile,_that.phone,_that.nationalCode,_that.birthdate,_that.nationality,_that.ownership,_that.address,_that.photo,_that.province,_that.city,_that.otpStatus,_that.cityName,_that.provinceName);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int id, String username, String password, String firstName, String lastName, bool isActive, String mobile, String phone, String nationalCode, DateTime birthdate, String nationality, String ownership, String address, String photo, int province, int city, bool otpStatus, String cityName, String provinceName)? $default,) {final _that = this; +switch (_that) { +case _User() when $default != null: +return $default(_that.id,_that.username,_that.password,_that.firstName,_that.lastName,_that.isActive,_that.mobile,_that.phone,_that.nationalCode,_that.birthdate,_that.nationality,_that.ownership,_that.address,_that.photo,_that.province,_that.city,_that.otpStatus,_that.cityName,_that.provinceName);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _User implements User { + const _User({required this.id, required this.username, required this.password, required this.firstName, required this.lastName, required this.isActive, required this.mobile, required this.phone, required this.nationalCode, required this.birthdate, required this.nationality, required this.ownership, required this.address, required this.photo, required this.province, required this.city, required this.otpStatus, required this.cityName, required this.provinceName}); + factory _User.fromJson(Map json) => _$UserFromJson(json); + +@override final int id; +@override final String username; +@override final String password; +@override final String firstName; +@override final String lastName; +@override final bool isActive; +@override final String mobile; +@override final String phone; +@override final String nationalCode; +@override final DateTime birthdate; +@override final String nationality; +@override final String ownership; +@override final String address; +@override final String photo; +@override final int province; +@override final int city; +@override final bool otpStatus; +@override final String cityName; +@override final String provinceName; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity); + +@override +Map toJson() { + return _$UserToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.id, id) || other.id == id)&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.isActive, isActive) || other.isActive == isActive)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.birthdate, birthdate) || other.birthdate == birthdate)&&(identical(other.nationality, nationality) || other.nationality == nationality)&&(identical(other.ownership, ownership) || other.ownership == ownership)&&(identical(other.address, address) || other.address == address)&&(identical(other.photo, photo) || other.photo == photo)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.otpStatus, otpStatus) || other.otpStatus == otpStatus)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,username,password,firstName,lastName,isActive,mobile,phone,nationalCode,birthdate,nationality,ownership,address,photo,province,city,otpStatus,cityName,provinceName]); + +@override +String toString() { + return 'User(id: $id, username: $username, password: $password, firstName: $firstName, lastName: $lastName, isActive: $isActive, mobile: $mobile, phone: $phone, nationalCode: $nationalCode, birthdate: $birthdate, nationality: $nationality, ownership: $ownership, address: $address, photo: $photo, province: $province, city: $city, otpStatus: $otpStatus, cityName: $cityName, provinceName: $provinceName)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> { + factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl; +@override @useResult +$Res call({ + int id, String username, String password, String firstName, String lastName, bool isActive, String mobile, String phone, String nationalCode, DateTime birthdate, String nationality, String ownership, String address, String photo, int province, int city, bool otpStatus, String cityName, String provinceName +}); + + + + +} +/// @nodoc +class __$UserCopyWithImpl<$Res> + implements _$UserCopyWith<$Res> { + __$UserCopyWithImpl(this._self, this._then); + + final _User _self; + final $Res Function(_User) _then; + +/// Create a copy of User +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? username = null,Object? password = null,Object? firstName = null,Object? lastName = null,Object? isActive = null,Object? mobile = null,Object? phone = null,Object? nationalCode = null,Object? birthdate = null,Object? nationality = null,Object? ownership = null,Object? address = null,Object? photo = null,Object? province = null,Object? city = null,Object? otpStatus = null,Object? cityName = null,Object? provinceName = null,}) { + return _then(_User( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int,username: null == username ? _self.username : username // ignore: cast_nullable_to_non_nullable +as String,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable +as String,firstName: null == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String,lastName: null == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable +as String,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool,mobile: null == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String,nationalCode: null == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable +as String,birthdate: null == birthdate ? _self.birthdate : birthdate // ignore: cast_nullable_to_non_nullable +as DateTime,nationality: null == nationality ? _self.nationality : nationality // ignore: cast_nullable_to_non_nullable +as String,ownership: null == ownership ? _self.ownership : ownership // ignore: cast_nullable_to_non_nullable +as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as String,photo: null == photo ? _self.photo : photo // ignore: cast_nullable_to_non_nullable +as String,province: null == province ? _self.province : province // ignore: cast_nullable_to_non_nullable +as int,city: null == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as int,otpStatus: null == otpStatus ? _self.otpStatus : otpStatus // ignore: cast_nullable_to_non_nullable +as bool,cityName: null == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable +as String,provinceName: null == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + + +/// @nodoc +mixin _$Role { + + int get id; String get roleName; String get description; RoleType get type; List get permissions; +/// Create a copy of Role +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RoleCopyWith get copyWith => _$RoleCopyWithImpl(this as Role, _$identity); + + /// Serializes this Role to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Role&&(identical(other.id, id) || other.id == id)&&(identical(other.roleName, roleName) || other.roleName == roleName)&&(identical(other.description, description) || other.description == description)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.permissions, permissions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,roleName,description,type,const DeepCollectionEquality().hash(permissions)); + +@override +String toString() { + return 'Role(id: $id, roleName: $roleName, description: $description, type: $type, permissions: $permissions)'; +} + + +} + +/// @nodoc +abstract mixin class $RoleCopyWith<$Res> { + factory $RoleCopyWith(Role value, $Res Function(Role) _then) = _$RoleCopyWithImpl; +@useResult +$Res call({ + int id, String roleName, String description, RoleType type, List permissions +}); + + +$RoleTypeCopyWith<$Res> get type; + +} +/// @nodoc +class _$RoleCopyWithImpl<$Res> + implements $RoleCopyWith<$Res> { + _$RoleCopyWithImpl(this._self, this._then); + + final Role _self; + final $Res Function(Role) _then; + +/// Create a copy of Role +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? roleName = null,Object? description = null,Object? type = null,Object? permissions = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int,roleName: null == roleName ? _self.roleName : roleName // ignore: cast_nullable_to_non_nullable +as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as RoleType,permissions: null == permissions ? _self.permissions : permissions // ignore: cast_nullable_to_non_nullable +as List, + )); +} +/// Create a copy of Role +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RoleTypeCopyWith<$Res> get type { + + return $RoleTypeCopyWith<$Res>(_self.type, (value) { + return _then(_self.copyWith(type: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Role]. +extension RolePatterns on Role { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Role value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Role() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Role value) $default,){ +final _that = this; +switch (_that) { +case _Role(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Role value)? $default,){ +final _that = this; +switch (_that) { +case _Role() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int id, String roleName, String description, RoleType type, List permissions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Role() when $default != null: +return $default(_that.id,_that.roleName,_that.description,_that.type,_that.permissions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int id, String roleName, String description, RoleType type, List permissions) $default,) {final _that = this; +switch (_that) { +case _Role(): +return $default(_that.id,_that.roleName,_that.description,_that.type,_that.permissions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int id, String roleName, String description, RoleType type, List permissions)? $default,) {final _that = this; +switch (_that) { +case _Role() when $default != null: +return $default(_that.id,_that.roleName,_that.description,_that.type,_that.permissions);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Role implements Role { + const _Role({required this.id, required this.roleName, required this.description, required this.type, required final List permissions}): _permissions = permissions; + factory _Role.fromJson(Map json) => _$RoleFromJson(json); + +@override final int id; +@override final String roleName; +@override final String description; +@override final RoleType type; + final List _permissions; +@override List get permissions { + if (_permissions is EqualUnmodifiableListView) return _permissions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_permissions); +} + + +/// Create a copy of Role +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RoleCopyWith<_Role> get copyWith => __$RoleCopyWithImpl<_Role>(this, _$identity); + +@override +Map toJson() { + return _$RoleToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Role&&(identical(other.id, id) || other.id == id)&&(identical(other.roleName, roleName) || other.roleName == roleName)&&(identical(other.description, description) || other.description == description)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._permissions, _permissions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,roleName,description,type,const DeepCollectionEquality().hash(_permissions)); + +@override +String toString() { + return 'Role(id: $id, roleName: $roleName, description: $description, type: $type, permissions: $permissions)'; +} + + +} + +/// @nodoc +abstract mixin class _$RoleCopyWith<$Res> implements $RoleCopyWith<$Res> { + factory _$RoleCopyWith(_Role value, $Res Function(_Role) _then) = __$RoleCopyWithImpl; +@override @useResult +$Res call({ + int id, String roleName, String description, RoleType type, List permissions +}); + + +@override $RoleTypeCopyWith<$Res> get type; + +} +/// @nodoc +class __$RoleCopyWithImpl<$Res> + implements _$RoleCopyWith<$Res> { + __$RoleCopyWithImpl(this._self, this._then); + + final _Role _self; + final $Res Function(_Role) _then; + +/// Create a copy of Role +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? roleName = null,Object? description = null,Object? type = null,Object? permissions = null,}) { + return _then(_Role( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int,roleName: null == roleName ? _self.roleName : roleName // ignore: cast_nullable_to_non_nullable +as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as RoleType,permissions: null == permissions ? _self._permissions : permissions // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +/// Create a copy of Role +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RoleTypeCopyWith<$Res> get type { + + return $RoleTypeCopyWith<$Res>(_self.type, (value) { + return _then(_self.copyWith(type: value)); + }); +} +} + + +/// @nodoc +mixin _$RoleType { + + String? get key; String get name; +/// Create a copy of RoleType +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RoleTypeCopyWith get copyWith => _$RoleTypeCopyWithImpl(this as RoleType, _$identity); + + /// Serializes this RoleType to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RoleType&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'RoleType(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $RoleTypeCopyWith<$Res> { + factory $RoleTypeCopyWith(RoleType value, $Res Function(RoleType) _then) = _$RoleTypeCopyWithImpl; +@useResult +$Res call({ + String? key, String name +}); + + + + +} +/// @nodoc +class _$RoleTypeCopyWithImpl<$Res> + implements $RoleTypeCopyWith<$Res> { + _$RoleTypeCopyWithImpl(this._self, this._then); + + final RoleType _self; + final $Res Function(RoleType) _then; + +/// Create a copy of RoleType +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? name = null,}) { + return _then(_self.copyWith( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [RoleType]. +extension RoleTypePatterns on RoleType { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _RoleType value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _RoleType() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _RoleType value) $default,){ +final _that = this; +switch (_that) { +case _RoleType(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _RoleType value)? $default,){ +final _that = this; +switch (_that) { +case _RoleType() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? key, String name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _RoleType() when $default != null: +return $default(_that.key,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? key, String name) $default,) {final _that = this; +switch (_that) { +case _RoleType(): +return $default(_that.key,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? key, String name)? $default,) {final _that = this; +switch (_that) { +case _RoleType() when $default != null: +return $default(_that.key,_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _RoleType implements RoleType { + const _RoleType({this.key, required this.name}); + factory _RoleType.fromJson(Map json) => _$RoleTypeFromJson(json); + +@override final String? key; +@override final String name; + +/// Create a copy of RoleType +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RoleTypeCopyWith<_RoleType> get copyWith => __$RoleTypeCopyWithImpl<_RoleType>(this, _$identity); + +@override +Map toJson() { + return _$RoleTypeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RoleType&&(identical(other.key, key) || other.key == key)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,key,name); + +@override +String toString() { + return 'RoleType(key: $key, name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$RoleTypeCopyWith<$Res> implements $RoleTypeCopyWith<$Res> { + factory _$RoleTypeCopyWith(_RoleType value, $Res Function(_RoleType) _then) = __$RoleTypeCopyWithImpl; +@override @useResult +$Res call({ + String? key, String name +}); + + + + +} +/// @nodoc +class __$RoleTypeCopyWithImpl<$Res> + implements _$RoleTypeCopyWith<$Res> { + __$RoleTypeCopyWithImpl(this._self, this._then); + + final _RoleType _self; + final $Res Function(_RoleType) _then; + +/// Create a copy of RoleType +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? name = null,}) { + return _then(_RoleType( +key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + + +/// @nodoc +mixin _$Permission { + + String get pageName; List get pageAccess; +/// Create a copy of Permission +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PermissionCopyWith get copyWith => _$PermissionCopyWithImpl(this as Permission, _$identity); + + /// Serializes this Permission to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Permission&&(identical(other.pageName, pageName) || other.pageName == pageName)&&const DeepCollectionEquality().equals(other.pageAccess, pageAccess)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,pageName,const DeepCollectionEquality().hash(pageAccess)); + +@override +String toString() { + return 'Permission(pageName: $pageName, pageAccess: $pageAccess)'; +} + + +} + +/// @nodoc +abstract mixin class $PermissionCopyWith<$Res> { + factory $PermissionCopyWith(Permission value, $Res Function(Permission) _then) = _$PermissionCopyWithImpl; +@useResult +$Res call({ + String pageName, List pageAccess +}); + + + + +} +/// @nodoc +class _$PermissionCopyWithImpl<$Res> + implements $PermissionCopyWith<$Res> { + _$PermissionCopyWithImpl(this._self, this._then); + + final Permission _self; + final $Res Function(Permission) _then; + +/// Create a copy of Permission +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? pageName = null,Object? pageAccess = null,}) { + return _then(_self.copyWith( +pageName: null == pageName ? _self.pageName : pageName // ignore: cast_nullable_to_non_nullable +as String,pageAccess: null == pageAccess ? _self.pageAccess : pageAccess // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Permission]. +extension PermissionPatterns on Permission { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Permission value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Permission() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Permission value) $default,){ +final _that = this; +switch (_that) { +case _Permission(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Permission value)? $default,){ +final _that = this; +switch (_that) { +case _Permission() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String pageName, List pageAccess)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Permission() when $default != null: +return $default(_that.pageName,_that.pageAccess);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String pageName, List pageAccess) $default,) {final _that = this; +switch (_that) { +case _Permission(): +return $default(_that.pageName,_that.pageAccess);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String pageName, List pageAccess)? $default,) {final _that = this; +switch (_that) { +case _Permission() when $default != null: +return $default(_that.pageName,_that.pageAccess);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Permission implements Permission { + const _Permission({required this.pageName, required final List pageAccess}): _pageAccess = pageAccess; + factory _Permission.fromJson(Map json) => _$PermissionFromJson(json); + +@override final String pageName; + final List _pageAccess; +@override List get pageAccess { + if (_pageAccess is EqualUnmodifiableListView) return _pageAccess; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_pageAccess); +} + + +/// Create a copy of Permission +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PermissionCopyWith<_Permission> get copyWith => __$PermissionCopyWithImpl<_Permission>(this, _$identity); + +@override +Map toJson() { + return _$PermissionToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Permission&&(identical(other.pageName, pageName) || other.pageName == pageName)&&const DeepCollectionEquality().equals(other._pageAccess, _pageAccess)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,pageName,const DeepCollectionEquality().hash(_pageAccess)); + +@override +String toString() { + return 'Permission(pageName: $pageName, pageAccess: $pageAccess)'; +} + + +} + +/// @nodoc +abstract mixin class _$PermissionCopyWith<$Res> implements $PermissionCopyWith<$Res> { + factory _$PermissionCopyWith(_Permission value, $Res Function(_Permission) _then) = __$PermissionCopyWithImpl; +@override @useResult +$Res call({ + String pageName, List pageAccess +}); + + + + +} +/// @nodoc +class __$PermissionCopyWithImpl<$Res> + implements _$PermissionCopyWith<$Res> { + __$PermissionCopyWithImpl(this._self, this._then); + + final _Permission _self; + final $Res Function(_Permission) _then; + +/// Create a copy of Permission +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? pageName = null,Object? pageAccess = null,}) { + return _then(_Permission( +pageName: null == pageName ? _self.pageName : pageName // ignore: cast_nullable_to_non_nullable +as String,pageAccess: null == pageAccess ? _self._pageAccess : pageAccess // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + +// dart format on diff --git a/packages/inspection/lib/data/model/response/user_profile/user_profile_model.g.dart b/packages/inspection/lib/data/model/response/user_profile/user_profile_model.g.dart new file mode 100644 index 0000000..7bf5323 --- /dev/null +++ b/packages/inspection/lib/data/model/response/user_profile/user_profile_model.g.dart @@ -0,0 +1,104 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_profile_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_UserProfileModel _$UserProfileModelFromJson(Map json) => + _UserProfileModel( + user: User.fromJson(json['user'] as Map), + role: Role.fromJson(json['role'] as Map), + permissions: (json['permissions'] as List) + .map((e) => Permission.fromJson(e as Map)) + .toList(), + ); + +Map _$UserProfileModelToJson(_UserProfileModel instance) => + { + 'user': instance.user, + 'role': instance.role, + 'permissions': instance.permissions, + }; + +_User _$UserFromJson(Map json) => _User( + id: (json['id'] as num).toInt(), + username: json['username'] as String, + password: json['password'] as String, + firstName: json['first_name'] as String, + lastName: json['last_name'] as String, + isActive: json['is_active'] as bool, + mobile: json['mobile'] as String, + phone: json['phone'] as String, + nationalCode: json['national_code'] as String, + birthdate: DateTime.parse(json['birthdate'] as String), + nationality: json['nationality'] as String, + ownership: json['ownership'] as String, + address: json['address'] as String, + photo: json['photo'] as String, + province: (json['province'] as num).toInt(), + city: (json['city'] as num).toInt(), + otpStatus: json['otp_status'] as bool, + cityName: json['city_name'] as String, + provinceName: json['province_name'] as String, +); + +Map _$UserToJson(_User instance) => { + 'id': instance.id, + 'username': instance.username, + 'password': instance.password, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'is_active': instance.isActive, + 'mobile': instance.mobile, + 'phone': instance.phone, + 'national_code': instance.nationalCode, + 'birthdate': instance.birthdate.toIso8601String(), + 'nationality': instance.nationality, + 'ownership': instance.ownership, + 'address': instance.address, + 'photo': instance.photo, + 'province': instance.province, + 'city': instance.city, + 'otp_status': instance.otpStatus, + 'city_name': instance.cityName, + 'province_name': instance.provinceName, +}; + +_Role _$RoleFromJson(Map json) => _Role( + id: (json['id'] as num).toInt(), + roleName: json['role_name'] as String, + description: json['description'] as String, + type: RoleType.fromJson(json['type'] as Map), + permissions: json['permissions'] as List, +); + +Map _$RoleToJson(_Role instance) => { + 'id': instance.id, + 'role_name': instance.roleName, + 'description': instance.description, + 'type': instance.type, + 'permissions': instance.permissions, +}; + +_RoleType _$RoleTypeFromJson(Map json) => + _RoleType(key: json['key'] as String?, name: json['name'] as String); + +Map _$RoleTypeToJson(_RoleType instance) => { + 'key': instance.key, + 'name': instance.name, +}; + +_Permission _$PermissionFromJson(Map json) => _Permission( + pageName: json['page_name'] as String, + pageAccess: (json['page_access'] as List) + .map((e) => e as String) + .toList(), +); + +Map _$PermissionToJson(_Permission instance) => + { + 'page_name': instance.pageName, + 'page_access': instance.pageAccess, + }; diff --git a/packages/inspection/lib/data/repositories/auth/auth_repository.dart b/packages/inspection/lib/data/repositories/auth/auth_repository.dart new file mode 100644 index 0000000..d582adb --- /dev/null +++ b/packages/inspection/lib/data/repositories/auth/auth_repository.dart @@ -0,0 +1,17 @@ + +import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; +import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; + +abstract class AuthRepository { + Future login({required Map authRequest}); + + Future captcha(); + + Future logout(); + + Future hasAuthenticated(); + + Future loginWithRefreshToken({required Map authRequest}); + + +} diff --git a/packages/inspection/lib/data/repositories/auth/auth_repository_imp.dart b/packages/inspection/lib/data/repositories/auth/auth_repository_imp.dart new file mode 100644 index 0000000..2e6e452 --- /dev/null +++ b/packages/inspection/lib/data/repositories/auth/auth_repository_imp.dart @@ -0,0 +1,37 @@ +import 'package:rasadyar_inspection/data/data_source/remote/auth/auth_remote.dart'; +import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; +import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; + +import 'auth_repository.dart'; + +class AuthRepositoryImpl implements AuthRepository { + final AuthRemote authRemote; + + AuthRepositoryImpl(this.authRemote); + + @override + Future login({required Map authRequest}) async => + await authRemote.login(authRequest: authRequest); + + @override + Future captcha() async { + return await authRemote.captcha(); + } + + @override + Future loginWithRefreshToken({ + required Map authRequest, + }) async { + return await authRemote.loginWithRefreshToken(authRequest: authRequest); + } + + @override + Future logout() async { + await authRemote.logout(); + } + + @override + Future hasAuthenticated() async { + return await authRemote.hasAuthenticated(); + } +} diff --git a/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart b/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart new file mode 100644 index 0000000..283b5ca --- /dev/null +++ b/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart @@ -0,0 +1,30 @@ +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; + +abstract class InspectionRepository { + /// Fetches the inspection data for a given [inspectionId]. + /// + /// Returns a `Future` that resolves to a `Map` containing + /// the inspection data. + Future> fetchInspectionData(String inspectionId); + + /// Fetches the list of inspections for a given [userId]. + /// + /// Returns a `Future` that resolves to a `List>` + /// containing the list of inspections. + Future>> fetchInspections(String userId); + + /// Fetches nearby poultry locations based on the provided coordinates and radius. + /// + /// Returns a `Future` that resolves to a `List?`. + Future?> getNearbyLocation({ + double? centerLat, + double? centerLng, + double? radius, + }); + + Future?> getHatchingDetails({ + String? code, + bool? active, + }); +} \ No newline at end of file diff --git a/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart b/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart new file mode 100644 index 0000000..5eecf18 --- /dev/null +++ b/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart @@ -0,0 +1,42 @@ +import 'package:rasadyar_inspection/data/data_source/remote/inspection/inspection_remote.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; +import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository.dart'; + +class InspectionRepositoryImp implements InspectionRepository { + final InspectionRemoteDataSource remoteDataSource; + + InspectionRepositoryImp({required this.remoteDataSource}); + + @override + Future> fetchInspectionData(String inspectionId) { + // TODO: implement fetchInspectionData + throw UnimplementedError(); + } + + @override + Future>> fetchInspections(String userId) { + // TODO: implement fetchInspections + throw UnimplementedError(); + } + + @override + Future?> getNearbyLocation({ + double? centerLat, + double? centerLng, + double? radius, + String? value, + }) async { + return remoteDataSource.getNearbyLocation( + centerLat: centerLat, + centerLng: centerLng, + radius: radius, + value: value, + ); + } + + @override + Future?> getHatchingDetails({String? code, bool? active}) async { + return await remoteDataSource.getHatchingDetails(code: code, active: active ?? false); + } +} diff --git a/packages/inspection/lib/data/repositories/user/user_repository.dart b/packages/inspection/lib/data/repositories/user/user_repository.dart new file mode 100644 index 0000000..b5974e9 --- /dev/null +++ b/packages/inspection/lib/data/repositories/user/user_repository.dart @@ -0,0 +1,19 @@ + +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; + +abstract class UserRepository { + /// Fetches the user profile from the remote data source. + /// + /// Returns a [Future] that resolves to a [UserProfileModel]. + Future fetchUserProfile({required String token}); + + /// Updates the user profile in the remote data source. + /// + /// Takes a [UserProfileModel] as an argument and returns a [Future] that resolves to a boolean indicating success or failure. + Future updateUserProfile(UserProfileModel userProfile); + + /// Changes the password of the user in the remote data source. + /// + /// Takes the old password, new password, and confirm password as arguments and returns a [Future] that resolves to a boolean indicating success or failure. + Future changePassword(String oldPassword, String newPassword, String confirmPassword); +} diff --git a/packages/inspection/lib/data/repositories/user/user_repository_imp.dart b/packages/inspection/lib/data/repositories/user/user_repository_imp.dart new file mode 100644 index 0000000..abd87fe --- /dev/null +++ b/packages/inspection/lib/data/repositories/user/user_repository_imp.dart @@ -0,0 +1,28 @@ + +import 'package:rasadyar_inspection/data/data_source/remote/user/user_data_source_imp.dart'; +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; + +import 'user_repository.dart'; + +class UserRepositoryImp implements UserRepository { + final UserRemoteDataSourceImp _remoteDataSource; + + UserRepositoryImp(this._remoteDataSource); + + @override + Future changePassword(String oldPassword, String newPassword, String confirmPassword) { + // TODO: implement changePassword + throw UnimplementedError(); + } + + @override + Future fetchUserProfile({required String token}) async { + return await _remoteDataSource.getProfile(token: token); + } + + @override + Future updateUserProfile(UserProfileModel userProfile) { + // TODO: implement updateUserProfile + throw UnimplementedError(); + } +} diff --git a/packages/inspection/lib/data/utils/dio_exception_handeler.dart b/packages/inspection/lib/data/utils/dio_exception_handeler.dart new file mode 100644 index 0000000..6f5e233 --- /dev/null +++ b/packages/inspection/lib/data/utils/dio_exception_handeler.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class DioErrorHandler { + void handle(DioException error) { + switch (error.response?.statusCode) { + case 401: + _handleGeneric(error); + break; + case 403: + _handleGeneric(error); + break; + + case 410: + _handle410(); + break; + default: + _handleGeneric(error); + } + } + + //wrong password/user name => "detail": "No active account found with the given credentials" - 401 + void _handle410() { + Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است')); + } + + //wrong captcha => "detail": "Captcha code is incorrect" - 403 + void _handle403() {} + + void _handleGeneric(DioException error) { + Get.showSnackbar( + _errorSnackBar( + error.response?.data.keys.first == 'is_user' + ? 'کاربر با این شماره تلفن وجود ندارد' + : error.response?.data[error.response?.data.keys.first] ?? + 'خطا در برقراری ارتباط با سرور', + ), + ); + } + + GetSnackBar _errorSnackBar(String message) { + return GetSnackBar( + titleText: Text( + 'خطا', + style: AppFonts.yekan14.copyWith(color: Colors.white), + ), + messageText: Text( + message, + style: AppFonts.yekan12.copyWith(color: Colors.white), + ), + backgroundColor: AppColor.error, + margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8), + borderRadius: 12, + duration: Duration(milliseconds: 3500), + snackPosition: SnackPosition.TOP, + ); + } +} diff --git a/packages/inspection/lib/data/utils/marker_generator.dart b/packages/inspection/lib/data/utils/marker_generator.dart new file mode 100644 index 0000000..af3ad4a --- /dev/null +++ b/packages/inspection/lib/data/utils/marker_generator.dart @@ -0,0 +1,91 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:math'; + +import 'package:flutter/foundation.dart'; +import 'package:latlong2/latlong.dart'; + + +/* +class GridGenParams { + final LatLng center; + final int count; + final double spacingMeters; + + const GridGenParams({ + required this.center, + required this.count, + required this.spacingMeters, + }); +}Future> generateGridMarkersIsolate(GridGenParams params) async { + return compute(_generateGridMarkersOptimized, params); +} + +List _generateGridMarkersOptimized(GridGenParams params) { + final List result = []; + final Distance distance = const Distance(); + + // Pre-calculate the grid dimensions + final int gridSize = sqrt(params.count).ceil(); + final double halfWidth = (gridSize * params.spacingMeters) / 2; + final double halfHeight = (gridSize * params.spacingMeters) / 2; + + // Calculate top-left corner of the grid + final LatLng topLeft = distance.offset( + distance.offset(params.center, -halfHeight, 0), // south + -halfWidth, 270 // west + ); + + // Generate grid in batches for better memory management + const int batchSize = 10000; + for (int batch = 0; batch < (params.count / batchSize).ceil(); batch++) { + final int startIdx = batch * batchSize; + final int endIdx = min((batch + 1) * batchSize, params.count); + + for (int i = startIdx; i < endIdx; i++) { + final int row = i ~/ gridSize; + final int col = i % gridSize; + + final double dx = col * params.spacingMeters; + final double dy = row * params.spacingMeters; + + final LatLng point = distance.offset( + distance.offset(topLeft, dy, 180), // south + dx, 90 // east + ); + + result.add(point); + } + } + + return result.sublist(0, min(result.length, params.count)); +} +*/ +class LatLngSimple { + final double lat; + final double lng; + + LatLngSimple(this.lat, this.lng); + + Map toJson() => {'lat': lat, 'lng': lng}; +} + + +List generateLatLngInIsolate(int count) { + final Random random = Random(); + const double minLat = 35.610; + const double maxLat = 36.120; + const double minLng = 50.190; + const double maxLng = 51.100; + + return List.generate(count, (_) { + double lat = minLat + random.nextDouble() * (maxLat - minLat); + double lng = minLng + random.nextDouble() * (maxLng - minLng); + return LatLngSimple(lat, lng); + }); +} + +Future> generateLocationsUsingCompute(int count) async { + final result = await compute(generateLatLngInIsolate, count); + return result.map((e) => LatLng(e.lat, e.lng)).toList(); +} \ No newline at end of file diff --git a/packages/inspection/lib/injection/inspection_di.dart b/packages/inspection/lib/injection/inspection_di.dart new file mode 100644 index 0000000..456896e --- /dev/null +++ b/packages/inspection/lib/injection/inspection_di.dart @@ -0,0 +1,71 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/data_source/remote/auth/auth_remote.dart'; +import 'package:rasadyar_inspection/data/data_source/remote/auth/auth_remote_imp.dart'; +import 'package:rasadyar_inspection/data/data_source/remote/inspection/inspection_remote_imp.dart'; +import 'package:rasadyar_inspection/data/data_source/remote/user/user_data_source_imp.dart'; +import 'package:rasadyar_inspection/data/repositories/auth/auth_repository_imp.dart'; +import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository_imp.dart'; +import 'package:rasadyar_inspection/data/repositories/user/user_repository_imp.dart'; +import 'package:rasadyar_inspection/data/utils/dio_exception_handeler.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; + +GetIt diInspection = GetIt.instance; + +Future setupInspectionDI() async { + diInspection.registerSingleton(DioErrorHandler()); + var tokenService = Get.find(); + if (tokenService.baseurl.value == null) { + await tokenService.saveBaseUrl('https://bazrasbackend.rasadyaar.ir/'); + } + diInspection.registerLazySingleton( + () => AppInterceptor( + //TODO : Update the base URL to the correct one for inspection module + refreshTokenCallback: () async => null, + saveTokenCallback: (String newToken) async { + await tokenService.saveAccessToken(newToken); + }, + clearTokenCallback: () async { + await tokenService.deleteTokens(); + Get.offAllNamed(InspectionRoutes.auth, arguments: Module.inspection); + }, + authArguments: Module.inspection, + ), + instanceName: 'inspectionInterceptor', + ); + + diInspection.registerLazySingleton(() { + return DioRemote( + baseUrl: tokenService.baseurl.value, + interceptors: diInspection.get(instanceName: 'inspectionInterceptor'), + ); + }, instanceName: 'inspectionDioRemote'); + + var dioRemote = diInspection.get(instanceName: 'inspectionDioRemote'); + await dioRemote.init(); + + diInspection.registerLazySingleton( + () => AuthRemoteImp(diInspection.get(instanceName: 'inspectionDioRemote')), + ); + + diInspection.registerSingleton( + AuthRepositoryImpl(diInspection.get()), + ); + + diInspection.registerSingleton( + UserRemoteDataSourceImp(diInspection.get(instanceName: 'inspectionDioRemote')), + ); + + diInspection.registerSingleton( + UserRepositoryImp(diInspection.get()), + ); + + diInspection.registerSingleton( + InspectionRemoteDataSourceImp(diInspection.get(instanceName: 'inspectionDioRemote')), + ); + + diInspection.registerSingleton( + InspectionRepositoryImp(remoteDataSource: diInspection.get()), + ); + + diInspection.registerSingleton(ImagePicker()); +} diff --git a/packages/inspection/lib/inspection.dart b/packages/inspection/lib/inspection.dart new file mode 100644 index 0000000..cfd321b --- /dev/null +++ b/packages/inspection/lib/inspection.dart @@ -0,0 +1,5 @@ +library; + +export 'presentation/pages/pages.dart'; +export 'presentation/routes/app_routes.dart'; +export 'presentation/routes/app_pages.dart'; diff --git a/packages/inspection/lib/presentation/pages/action/logic.dart b/packages/inspection/lib/presentation/pages/action/logic.dart new file mode 100644 index 0000000..3d2a504 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/action/logic.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class ActionLogic extends GetxController with GetTickerProviderStateMixin { + late Rx slidController; + bool showSlideHint = true; + + RxInt selectedIndex = 0.obs; + RxInt previousIndex = 0.obs; + + List headersTitle = [ + 'کاربران', + 'سوابق', + 'آمار', + ]; + + List headersIcons = [ + Assets.vec.profileUserSvg.path, + Assets.vec.calendarSearchSvg.path, + Assets.vec.diagramSvg.path, + ]; + + RxList supervisionHistoryList = [false, false, false, false].obs; + + List tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر']; + + List hamadanCities = [ + 'همدان', + 'ملایر', + 'نهاوند', + 'تویسرکان', + 'اسدآباد', + 'بهار', + 'رزن', + 'کبودرآهنگ', + 'فامنین', + 'لالجین', + ]; + + RxInt filter1Index = 0.obs; + RxInt filter2Index = 0.obs; + + @override + void onInit() { + super.onInit(); + slidController = SlidableController(this).obs; + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + Future triggerSlidableAnimation() async { + await Future.delayed(Duration(milliseconds: 200)); + await slidController.value.openEndActionPane(); + await Future.delayed(Duration(milliseconds: 200)); + await slidController.value.close(); + showSlideHint = !showSlideHint; + } + + void updateSelectedIndex(int index) { + if (index == selectedIndex.value) { + return; + } + previousIndex.value = selectedIndex.value; + selectedIndex.value = index; + } +} diff --git a/packages/inspection/lib/presentation/pages/action/view.dart b/packages/inspection/lib/presentation/pages/action/view.dart new file mode 100644 index 0000000..062a66b --- /dev/null +++ b/packages/inspection/lib/presentation/pages/action/view.dart @@ -0,0 +1,443 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/pages/records/view.dart'; +import 'package:rasadyar_inspection/presentation/pages/statistics/view.dart'; +import 'package:rasadyar_inspection/presentation/pages/users/view.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/view.dart'; + +import 'logic.dart'; + +class ActionPage extends GetView { + const ActionPage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + hasBack: false, + hasFilter: true, + hasSearch: true, + widgets: [ + SizedBox(height: 20), + ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate(controller.headersIcons.length, (index) { + return headerWidget( + iconPath: controller.headersIcons[index], + title: controller.headersTitle[index], + onTap: () { + controller.updateSelectedIndex(index); + }, + isSelected: controller.selectedIndex.value == index, + ); + }), + ); + }, controller.selectedIndex), + Expanded( + child: Container( + color: Colors.white, + child: ObxValue((index) { + return switch (index.value) { + 0 => UsersPage(), + 1 => RecordsPage(), + 2 => StatisticsPage(), + int() => throw UnimplementedError(), + }; + }, controller.selectedIndex), + ), + ), + ], + ); + } + + + + Widget supervisionHistoryWidget() { + return ObxValue((data) { + return ListView.builder( + itemBuilder: (context, index) { + return historyItem(data[index], () { + data[index] = !data[index]; + }); + }, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemCount: data.length, + ); + }, controller.supervisionHistoryList); + } + + + + Widget headerWidget({ + required String iconPath, + required String title, + required VoidCallback onTap, + bool isSelected = false, + }) { + return GestureDetector( + onTap: onTap, + child: Container( + width: 93.w, + height: 104.h, + margin: EdgeInsets.symmetric(horizontal: 8.w), + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 8.h), + decoration: BoxDecoration( + color: isSelected ? Colors.white : Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Container( + width: 48.w, + height: 48.h, + padding: EdgeInsets.all(8), + decoration: ShapeDecoration( + color: isSelected ? AppColor.blueLightActive : Colors.transparent, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: SvgGenImage.vec(iconPath).svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode( + isSelected ? AppColor.blueNormalActive : AppColor.blueNormal, + BlendMode.srcIn, + ), + ), + ), + + Text( + title, + style: AppFonts.yekan12.copyWith( + + color: isSelected ? AppColor.blueNormalActive : AppColor.blueNormal, + ), + ), + ], + ), + ), + ); + } + + + Widget slidableWidgetTwo({required VoidCallback onTap}) { + return Slidable( + key: Key('selectedLocationWidget'), + controller: controller.slidController.value, + endActionPane: ActionPane( + motion: StretchMotion(), + children: [ + CustomSlidableAction( + onPressed: (context) {}, + backgroundColor: AppColor.blueNormal, + foregroundColor: Colors.white, + padding: EdgeInsets.all(16), + borderRadius: BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + autoClose: true, + child: Assets.vec.trashSvg.svg(width: 24, height: 24), + ), + CustomSlidableAction( + onPressed: (context) {}, + backgroundColor: AppColor.redNormal, + foregroundColor: Colors.white, + padding: EdgeInsets.all(16), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + ), + autoClose: true, + child: Assets.vec.trashSvg.svg(width: 24, height: 24), + ), + ], + ), + child: GestureDetector( + onTap: onTap, + child: Container( + height: 62, + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + spacing: 4, + children: [ + Text( + 'داود خرم مهری پور', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + '03295224154', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + spacing: 4, + children: [ + Text( + 'افزودن کاربر', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + 'ثبت بازرسی', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + spacing: 4, + children: [ + Text('همدان', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text( + 'همدان', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + ], + ), + ), + ), + ); + } + + Widget historyItem(bool isExpanded, VoidCallback onTap) { + return AnimatedContainer( + margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10), + curve: Curves.easeInOut, + duration: Duration(seconds: 1), + height: isExpanded ? 364 : 62, + child: isExpanded ? markerDetailsWidget(ontap: onTap) : slidableWidgetTwo(onTap: onTap), + ); + } + + Widget markerDetailsWidget({required VoidCallback ontap}) { + return GestureDetector( + onTap: ontap, + behavior: HitTestBehavior.opaque, + child: Container( + clipBehavior: Clip.antiAlias, + + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 12, + children: [ + vecWidgetWithOnTap( + child: Assets.vec.editSvg.svg(), + onTap: () {}, + width: 24, + height: 24, + color: AppColor.blueNormal, + ), + Text( + 'سوابق بازرسی من', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + vecWidgetWithOnTap( + child: Assets.vec.trashSvg.svg(), + width: 24, + height: 24, + color: AppColor.redNormal, + onTap: () {}, + ), + ], + ), + Container( + height: 32, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + + ...List.generate( + 5, + (index) => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'فروش رفته', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + ), + ], + ), + ), + ); + } + + Column optionWidget({ + required RxInt selected, + required String title, + required List options, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 10), + child: Text( + title, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ), + + Padding( + padding: const EdgeInsets.symmetric(horizontal: 30), + child: Wrap( + runSpacing: 8, + spacing: 8, + children: options + .map( + (e) => ObxValue((data) { + return ChoiceChip( + onSelected: (value) { + selected.value = options.indexOf(e); + }, + selectedColor: AppColor.blueNormal, + labelStyle: data.value == options.indexOf(e) + ? AppFonts.yekan13.copyWith(color: AppColor.whiteLight) + : AppFonts.yekan12.copyWith(color: AppColor.darkGreyNormalActive), + checkmarkColor: Colors.white, + label: Text(e), + selected: options.indexOf(e) == data.value, + ); + }, selected), + ) + .toList(), + ), + ), + ], + ); + } + + Container headerInfo({required String title, required String description, Color? background}) { + return Container( + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: ShapeDecoration( + color: background ?? AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blackLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + alignment: AlignmentDirectional.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 10, + children: [ + Text(title, style: AppFonts.yekan10), + + Text(description, style: AppFonts.yekan12), + ], + ), + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/add_mobile_inspector/logic.dart b/packages/inspection/lib/presentation/pages/add_mobile_inspector/logic.dart new file mode 100644 index 0000000..83748bd --- /dev/null +++ b/packages/inspection/lib/presentation/pages/add_mobile_inspector/logic.dart @@ -0,0 +1,17 @@ +import 'package:rasadyar_core/core.dart'; + +class AddMobileInspectorLogic extends GetxController { + RxInt countInspector = 1.obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart b/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart new file mode 100644 index 0000000..c39030c --- /dev/null +++ b/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart @@ -0,0 +1,129 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; + +import 'logic.dart'; + +class AddMobileInspectorPage extends GetView { + const AddMobileInspectorPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.bgLight, + appBar: RAppBar( + title: 'افزودن بازرس همراه', + leading: Assets.vec.messageAddSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode( + Colors.white, + BlendMode.srcIn, + ), + ), + additionalActions: [ + RFab.smallAdd(onPressed: () => controller.countInspector.value++), + ], + ), + body: Column( + children: [ + Expanded( + child: ObxValue((data) { + return ListView.separated( + padding: const EdgeInsets.fromLTRB(25, 10, 25, 0), + itemBuilder: (context, index) => mobileInspectorWidget(), + separatorBuilder: (context, index) => SizedBox(height: 15), + itemCount: data.value, + ); + }, controller.countInspector), + ), + + Padding( + padding: const EdgeInsets.fromLTRB(20, 4, 20, 25), + child: RElevated( + text: 'مرحله بعد', + onPressed: () { + Get.toNamed(InspectionRoutes.inspectionRegistrationOfViolation); + }, + height: 40, + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ), + ], + ), + ); + } + + +} +Container mobileInspectorWidget() { + return Container( + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 0.7, color: AppColor.bgDark), + ), + child: Column( + spacing: 16, + children: [ + RTextField( + controller: TextEditingController(), + label: 'نام و نام خانوادگی', + filled: true, + filledColor: AppColor.whiteLight, + padding: EdgeInsets.zero, + ), + RTextField( + controller: TextEditingController(), + label: 'شماره مجوز', + filled: true, + filledColor: AppColor.whiteLight, + padding: EdgeInsets.zero, + ), + RTextField( + controller: TextEditingController(), + label: 'شماره ثبت', + filled: true, + filledColor: AppColor.whiteLight, + padding: EdgeInsets.zero, + ), + RTextField( + controller: TextEditingController(), + label: 'کد اقتصادی', + filled: true, + filledColor: AppColor.whiteLight, + padding: EdgeInsets.zero, + ), + + Padding( + padding: const EdgeInsets.symmetric(vertical: 12), + child: SizedBox( + height: 40, + child: Row( + spacing: 16, + children: [ + Expanded( + child: RElevated( + text: 'ثبت', + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + onPressed: () {}, + ), + ), + Expanded( + child: ROutlinedElevated( + text: 'انصراف', + textStyle: AppFonts.yekan16, + onPressed: () {}, + ), + ), + ], + ), + ), + ), + ], + ), + ); +} \ No newline at end of file diff --git a/packages/inspection/lib/presentation/pages/add_supervision/logic.dart b/packages/inspection/lib/presentation/pages/add_supervision/logic.dart new file mode 100644 index 0000000..4f308bb --- /dev/null +++ b/packages/inspection/lib/presentation/pages/add_supervision/logic.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; +import 'package:rasadyar_core/core.dart'; + +class AddSupervisionLogic extends GetxController { + RxInt selectedSegment = 0.obs; + RxInt violationSegmentsSelected = 0.obs; + RxInt selectedTypeOfOwnership = 0.obs; + RxInt selectedUnitType = 0.obs; + RxList selectedAccompanyingInspectors = RxList([0]); + + Map> tmpData = { + 'نوع مالکیت': ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر'], + 'نوع واحد': ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر'], + 'بازرسان همراه': ['ندارد','دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر'], + }; + + List tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر']; + + // The data for the segments + final Map segments = { + 0: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('دائم', style: AppFonts.yekan13), + ), + 1: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('موقت', style: AppFonts.yekan13), + ), + }; + + // The data for the segments + final Map violationSegments = { + 0: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('دارد', style: AppFonts.yekan13), + ), + 1: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('ندارد', style: AppFonts.yekan13), + ), + }; + + +List routes = [ + InspectionRoutes.inspectionRegistrationOfViolation, + InspectionRoutes.inspectionDisplayInformation +]; + + + + @override + void onReady() { + + super.onReady(); + + + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/packages/inspection/lib/presentation/pages/add_supervision/view.dart b/packages/inspection/lib/presentation/pages/add_supervision/view.dart new file mode 100644 index 0000000..89fa9bd --- /dev/null +++ b/packages/inspection/lib/presentation/pages/add_supervision/view.dart @@ -0,0 +1,249 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; + +import 'logic.dart'; + +class AddSupervisionPage extends GetView { + const AddSupervisionPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.lightGreyLight, + appBar: RAppBar( + title: 'ایجاد بازرسی', + leading: Assets.vec.messageAddSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode( + Colors.white, + BlendMode.srcIn, + ), + ), + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 20, + vertical: 10, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Text( + 'نوع پروانه کسب', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.blueNormal, + ), + ), + SizedBox(height: 16), + ObxValue((data) { + return NewCupertinoSegmentedControl( + padding: EdgeInsets.zero, + children: controller.segments, + groupValue: data.value, + selectedColor: AppColor.blueNormal, + unselectedColor: Colors.white, + borderColor: Colors.grey.shade300, + onValueChanged: (int value) { + data.value = value; + }, + ); + }, controller.selectedSegment), + SizedBox(height: 16), + Text( + 'تخلف', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.blueNormal, + ), + ), + SizedBox(height: 16), + ObxValue((data) { + return NewCupertinoSegmentedControl( + padding: EdgeInsets.zero, + children: controller.violationSegments, + groupValue: data.value, + selectedColor: AppColor.blueNormal, + unselectedColor: Colors.white, + borderColor: Colors.grey.shade300, + onValueChanged: (int value) { + if(value == 0) { + controller.routes.ensureContainsAtStart(InspectionRoutes.inspectionRegistrationOfViolation); + } else { + controller.routes.remove(InspectionRoutes.inspectionRegistrationOfViolation); + } + data.value = value; + }, + ); + }, controller.violationSegmentsSelected), + SizedBox(height: 8), + RTextField( + controller: TextEditingController(),label: 'صادر کننده پروانه'), + SizedBox(height: 8), + RTextField( + controller: TextEditingController(),label: 'شماره مجوز'), + SizedBox(height: 8), + RTextField( + controller: TextEditingController(),label: 'شماره ثبت'), + SizedBox(height: 8), + RTextField( + controller: TextEditingController(),label: 'کد اقتصادی'), + ], + ), + ), + SizedBox(height: 10), + optionWidget( + selected: controller.selectedTypeOfOwnership, + options: controller.tmpData.entries.elementAt(0), + onSelected: + (index) => + controller.selectedTypeOfOwnership.value = index, + ), + SizedBox(height: 18), + optionWidget( + selected: controller.selectedUnitType, + options: controller.tmpData.entries.elementAt(1), + onSelected: + (index) => controller.selectedUnitType.value = index, + ), + SizedBox(height: 18), + optionWidget( + selectedList: controller.selectedAccompanyingInspectors, + options: controller.tmpData.entries.elementAt(2), + onSelected: (data) { + final selected = controller.selectedAccompanyingInspectors; + final route = InspectionRoutes.inspectionAddMobileInspector; + + if (data == 0) { + selected.resetWith(0); + controller.routes.remove(route); + return; + } + + controller.routes.ensureContainsAtStart(route); + selected.removeIfPresent(0); + selected.toggle(data); + }, + ), + ], + ), + ), + ), + + Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 25), + child: RElevated( + text: 'مرحله بعد', + onPressed: () { + Get.toNamed(controller.routes.first); + + }, + height: 40, + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ), + ], + ), + ); + } + + Column optionWidget({ + RxInt? selected, + RxList? selectedList, + required MapEntry> options, + required void Function(int index) onSelected, + }) { + assert( + (selected != null) != (selectedList != null), + 'Exactly one of selected or selectedList must be provided', + ); + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Text( + options.key, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + ), + + SizedBox( + height: 50, + child: ListView.separated( + shrinkWrap: true, + padding: EdgeInsets.symmetric(horizontal: 20), + scrollDirection: Axis.horizontal, + itemBuilder: + (context, index) => + selected != null + ? ObxValue((data) { + return ChoiceChip( + onSelected: (_) => onSelected(index), + color: WidgetStateProperty.resolveWith((data,) { + if (selected.value == index) { + return AppColor.blueNormal; + } else { + return Colors.white; + } + }), + labelStyle: + data.value == index + ? AppFonts.yekan13.copyWith( + color: AppColor.whiteLight, + ) + : AppFonts.yekan12.copyWith( + color: AppColor.darkGreyNormalActive, + ), + checkmarkColor: Colors.white, + label: Text(options.value[index]), + selected: index == data.value, + ); + }, selected) + : ObxValue((data) { + return ChoiceChip( + onSelected: (value) => onSelected.call(index), + color: WidgetStateProperty.resolveWith((states,) { + if (data.contains(index)) { + return AppColor.blueNormal; + } else { + return Colors.white; + } + }), + labelStyle: + data.contains(index) + ? AppFonts.yekan13.copyWith( + color: AppColor.whiteLight, + ) + : AppFonts.yekan12.copyWith( + color: AppColor.darkGreyNormalActive, + ), + checkmarkColor: Colors.white, + label: Text(options.value[index]), + selected: data.contains(index), + ); + }, selectedList!), + + separatorBuilder: (context, index) => SizedBox(width: 8), + itemCount: options.value.length, + ), + ), + ], + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/auth/logic.dart b/packages/inspection/lib/presentation/pages/auth/logic.dart new file mode 100644 index 0000000..3d3bc58 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/auth/logic.dart @@ -0,0 +1,188 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/request/login_request/login_request_model.dart'; +import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; +import 'package:rasadyar_inspection/data/repositories/auth/auth_repository_imp.dart'; +import 'package:rasadyar_inspection/data/utils/dio_exception_handeler.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; +import 'package:rasadyar_inspection/presentation/widget/captcha/logic.dart'; + +enum AuthType { useAndPass, otp } + +enum AuthStatus { init } + +enum OtpStatus { init, sent, verified, reSend } + +class AuthLogic extends GetxController with GetTickerProviderStateMixin { + GlobalKey formKey = GlobalKey(); + + late AnimationController _textAnimationController; + late Animation textAnimation; + RxBool showCard = false.obs; + + Rx> formKeyOtp = GlobalKey().obs; + Rx> formKeySentOtp = GlobalKey().obs; + Rx usernameController = TextEditingController().obs; + Rx passwordController = TextEditingController().obs; + Rx phoneOtpNumberController = TextEditingController().obs; + Rx otpCodeController = TextEditingController().obs; + + var captchaController = Get.find(); + + RxnString phoneNumber = RxnString(null); + RxBool isLoading = false.obs; + RxBool isDisabled = true.obs; + TokenStorageService tokenStorageService = Get.find(); + + Rx authType = AuthType.useAndPass.obs; + Rx authStatus = AuthStatus.init.obs; + Rx otpStatus = OtpStatus.init.obs; + + RxInt secondsRemaining = 120.obs; + Timer? _timer; + + AuthRepositoryImpl authRepository = diInspection.get(); + + final Module _module = Get.arguments; + + @override + void onInit() { + super.onInit(); + + _textAnimationController = + AnimationController(vsync: this, duration: const Duration(milliseconds: 1200)) + ..repeat(reverse: true, count: 2).whenComplete(() { + showCard.value = true; + }); + + textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut); + } + + @override + void onReady() { + super.onReady(); + //_textAnimationController.forward(); + } + + @override + void onClose() { + _timer?.cancel(); + super.onClose(); + } + + void startTimer() { + _timer?.cancel(); + secondsRemaining.value = 120; + + _timer = Timer.periodic(const Duration(seconds: 1), (timer) { + if (secondsRemaining.value > 0) { + secondsRemaining.value--; + } else { + timer.cancel(); + } + }); + } + + void stopTimer() { + _timer?.cancel(); + } + + String get timeFormatted { + final minutes = secondsRemaining.value ~/ 60; + final seconds = secondsRemaining.value % 60; + return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}'; + } + + bool _isFormValid() { + final isCaptchaValid = captchaController.formKey.currentState?.validate() ?? false; + final isFormValid = formKey.currentState?.validate() ?? false; + return isCaptchaValid && isFormValid; + } + + LoginRequestModel _buildLoginRequest() { + final phone = usernameController.value.text; + final pass = passwordController.value.text; + final code = captchaController.textController.value.text; + final key = captchaController.captchaKey.value; + + return LoginRequestModel.createWithCaptcha( + username: phone, + password: pass, + captchaCode: code, + captchaKey: key!, + ); + } + + Future submitLoginForm() async { + if (!_isFormValid()) return; + + final loginRequestModel = _buildLoginRequest(); + isLoading.value = true; + await safeCall( + call: () async => authRepository.login(authRequest: loginRequestModel.toJson()), + onSuccess: (result) async { + await tokenStorageService.saveModule(_module); + await tokenStorageService.saveRefreshToken(result?.refresh ?? ''); + await tokenStorageService.saveAccessToken(result?.access ?? ''); + Get.offAllNamed(InspectionRoutes.init); + }, + onError: (error, stackTrace) { + if (error is DioException) { + diInspection.get().handle(error); + } + captchaController.getCaptcha(); + }, + ); + isLoading.value = false; + } + + Future submitLoginForm2() async { + if (!_isFormValid()) return; + //AuthRepositoryImpl authTmp = diAuth.get(instanceName: 'newUrl'); + isLoading.value = true; + /* await safeCall( + call: () => authTmp.login( + authRequest: { + "username": usernameController.value.text, + "password": passwordController.value.text, + }, + ), + onSuccess: (result) async { + await tokenStorageService.saveModule(_module); + await tokenStorageService.saveAccessToken(result?.accessToken ?? ''); + await tokenStorageService.saveRefreshToken(result?.accessToken ?? ''); + }, + onError: (error, stackTrace) { + if (error is DioException) { + // diAuth.get().handle(error); + } + captchaController.getCaptcha(); + }, + );*/ + isLoading.value = false; + } + + Future getUserInfo(String value) async { + isLoading.value = true; + /*await safeCall( + call: () async => await authRepository.getUserInfo(value), + onSuccess: (result) async { + if (result != null) { + //await newSetupAuthDI(result.backend ?? ''); + await tokenStorageService.saveApiKey(result.apiKey ?? ''); + await tokenStorageService.saveBaseUrl(result.backend ?? ''); + } + }, + onError: (error, stackTrace) { + if (error is DioException) { + // diAuth.get().handle(error); + } + captchaController.getCaptcha(); + }, + );*/ + isLoading.value = false; + } +} diff --git a/packages/inspection/lib/presentation/pages/auth/view.dart b/packages/inspection/lib/presentation/pages/auth/view.dart new file mode 100644 index 0000000..6ab8612 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/auth/view.dart @@ -0,0 +1,546 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/widget/captcha/view.dart'; +import 'logic.dart'; + +class AuthPage extends GetView { + const AuthPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + alignment: Alignment.center, + + children: [ + Assets.vec.bgAuthSvg.svg(fit: BoxFit.fill), + + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.r), + child: FadeTransition( + opacity: controller.textAnimation, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'به سامانه رصدیار خوش آمدید!', + textAlign: TextAlign.right, + style: AppFonts.yekan25Bold.copyWith(color: Colors.white), + ), + Text( + 'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), + ), + ), + + Obx(() { + final screenHeight = MediaQuery + .of(context) + .size + .height; + final targetTop = (screenHeight - 676) / 2; + + return AnimatedPositioned( + duration: const Duration(milliseconds: 1200), + curve: Curves.linear, + top: controller.showCard.value ? targetTop : screenHeight, + left: 10.r, + right: 10.r, + child: Container( + width: 381.w, + height: 676.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(40), + ), + child: Column( + children: [ + SizedBox(height: 50.h), + LogoWidget(), + SizedBox(height: 20.h), + useAndPassFrom(), + SizedBox(height: 24.h), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'مطالعه بیانیه ', + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark), + ), + TextSpan( + recognizer: TapGestureRecognizer() + ..onTap = () { + Get.bottomSheet( + privacyPolicyWidget(), + isScrollControlled: true, + enableDrag: true, + ignoreSafeArea: false, + ); + }, + text: 'حریم خصوصی', + style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ], + ), + ), + ); + }), + ], + ), + ); + } + + Widget useAndPassFrom() { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 30.r), + child: Form( + key: controller.formKey, + child: AutofillGroup( + child: Column( + children: [ + RTextField( + label: 'نام کاربری', + maxLength: 11, + maxLines: 1, + controller: controller.usernameController.value, + keyboardType: TextInputType.number, + initText: controller.usernameController.value.text, + autofillHints: [AutofillHints.username], + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: AppColor.textColor, width: 1), + ), + onChanged: (value) async { + controller.usernameController.value.text = value; + controller.usernameController.refresh(); + }, + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 6, 8), + child: Assets.vec.callSvg.svg(width: 12, height: 12), + ), + suffixIcon: controller.usernameController.value.text + .trim() + .isNotEmpty + ? clearButton(() { + controller.usernameController.value.clear(); + controller.usernameController.refresh(); + }) + : null, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ شماره موبایل را وارد کنید'; + } else if (value.length < 10) { + return '⚠️ شماره موبایل باید 11 رقم باشد'; + } + return null; + }, + style: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal), + labelStyle: AppFonts.yekan13, + boxConstraints: const BoxConstraints( + maxHeight: 40, + minHeight: 40, + maxWidth: 40, + minWidth: 40, + ), + ), + const SizedBox(height: 26), + ObxValue( + (passwordController) => + RTextField( + label: 'رمز عبور', + filled: false, + obscure: true, + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: AppColor.textColor, width: 1), + ), + controller: passwordController.value, + autofillHints: [AutofillHints.password], + variant: RTextFieldVariant.password, + initText: passwordController.value.text, + onChanged: (value) { + passwordController.refresh(); + }, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ رمز عبور را وارد کنید'; + } + return null; + }, + style: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal), + labelStyle: AppFonts.yekan13, + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 8, 8), + child: Assets.vec.keySvg.svg(width: 12, height: 12), + ), + boxConstraints: const BoxConstraints( + maxHeight: 34, + minHeight: 34, + maxWidth: 34, + minWidth: 34, + ), + ), + controller.passwordController, + ), + SizedBox(height: 26), + CaptchaWidget(), + SizedBox(height: 23), + + Obx(() { + return RElevated( + text: 'ورود', + isLoading: controller.isLoading.value, + onPressed: controller.isDisabled.value + ? null + : () async { + await controller.submitLoginForm(); + }, + width: Get.width, + height: 48, + ); + }), + ], + ), + ), + ), + ); + } + + Widget privacyPolicyWidget() { + return BaseBottomSheet( + child: Column( + spacing: 5, + children: [ + Container( + padding: EdgeInsets.all(8.w), + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 3, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'بيانيه حريم خصوصی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Text( + 'اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب می‌شود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران می‌شود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیت‌های جاری می‌گردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت می‌گردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت می‌کند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید.', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8), + ), + ], + ), + ), + Container( + padding: EdgeInsets.all(8.w), + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + 'چگونگی جمع آوری و استفاده از اطلاعات کاربران', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Text( + '''الف: اطلاعاتی که شما خود در اختيار این سامانه قرار می‌دهيد، شامل موارد زيرهستند: +اقلام اطلاعاتی شامل شماره تلفن همراه، تاریخ تولد، کد پستی و کد ملی کاربران را دریافت مینماییم که از این اقلام، صرفا جهت احراز هویت کاربران استفاده خواهد شد. +ب: برخی اطلاعات ديگر که به صورت خودکار از شما دريافت میشود شامل موارد زير می‌باشد: +⦁ دستگاهی که از طریق آن سامانه رصد یار را مشاهده می‌نمایید( تلفن همراه، تبلت، رایانه). +⦁ نام و نسخه سیستم عامل و browser کامپیوتر شما. +⦁ اطلاعات صفحات بازدید شده. +⦁ تعداد بازدیدهای روزانه در درگاه. +⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم. +''', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8), + ), + ], + ), + ), + Container( + padding: EdgeInsets.all(8.w), + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + 'امنیت اطلاعات', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Text( + 'متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوه‌‌های لازم استفاده می‌کنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری می‌کنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینک‌ها از سامانه ما خارج می‌شوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند.', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8), + ), + ], + ), + ), + ], + ), + ); + } + +/* + Widget sendCodeForm() { + return ObxValue((data) { + return Form( + key: data.value, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 30, vertical: 50), + child: Column( + children: [ + SizedBox(height: 26), + ObxValue((phoneController) { + return TextFormField( + controller: phoneController.value, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + gapPadding: 11, + ), + labelText: 'شماره موبایل', + labelStyle: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith( + color: AppColor.redNormal, + ), + prefixIconConstraints: BoxConstraints( + maxHeight: 40, + minHeight: 40, + maxWidth: 40, + minWidth: 40, + ), + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 6, 8), + child: vecWidget(Assets.vecCallSvg), + ), + suffix: + phoneController.value.text.trim().isNotEmpty + ? clearButton(() { + phoneController.value.clear(); + phoneController.refresh(); + }) + : null, + counterText: '', + ), + keyboardType: TextInputType.numberWithOptions( + decimal: false, + signed: false, + ), + maxLines: 1, + maxLength: 11, + onChanged: (value) { + if (controller.isOnError.value) { + controller.isOnError.value = !controller.isOnError.value; + data.value.currentState?.reset(); + data.refresh(); + phoneController.value.text = value; + } + phoneController.refresh(); + }, + textInputAction: TextInputAction.next, + validator: (value) { + if (value == null) { + return '⚠️ شماره موبایل را وارد کنید'; + } else if (value.length < 11) { + return '⚠️ شماره موبایل باید 11 رقم باشد'; + } + return null; + }, + style: AppFonts.yekan13, + ); + }, controller.phoneOtpNumberController), + + SizedBox(height: 26), + + CaptchaWidget(), + + SizedBox(height: 23), + RElevated( + text: 'ارسال رمز یکبار مصرف', + onPressed: () { + if (data.value.currentState?.validate() == true) { + controller.otpStatus.value = OtpStatus.sent; + controller.startTimer(); + } + }, + width: Get.width, + height: 48, + ), + ], + ), + ), + ); + }, controller.formKeyOtp); + } + + Widget confirmCodeForm() { + return ObxValue((data) { + return Form( + key: data.value, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 30, vertical: 50), + child: Column( + children: [ + SizedBox(height: 26), + + ObxValue((passwordController) { + return TextFormField( + controller: passwordController.value, + obscureText: controller.hidePassword.value, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + gapPadding: 11, + ), + labelText: 'رمز عبور', + labelStyle: AppFonts.yekan13, + errorStyle: AppFonts.yekan13.copyWith( + color: AppColor.redNormal, + ), + + prefixIconConstraints: BoxConstraints( + maxHeight: 34, + minHeight: 34, + maxWidth: 34, + minWidth: 34, + ), + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 8, 8), + child: vecWidget(Assets.vecKeySvg), + ), + suffix: + passwordController.value.text.trim().isNotEmpty + ? GestureDetector( + onTap: () { + controller.hidePassword.value = + !controller.hidePassword.value; + }, + child: Icon( + controller.hidePassword.value + ? CupertinoIcons.eye + : CupertinoIcons.eye_slash, + ), + ) + : null, + counterText: '', + ), + textInputAction: TextInputAction.done, + keyboardType: TextInputType.visiblePassword, + maxLines: 1, + onChanged: (value) { + if (controller.isOnError.value) { + controller.isOnError.value = !controller.isOnError.value; + data.value.currentState?.reset(); + passwordController.value.text = value; + } + passwordController.refresh(); + }, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ رمز عبور را وارد کنید'; // "Please enter the password" + } + return null; + }, + style: AppFonts.yekan13, + ); + }, controller.passwordController), + + SizedBox(height: 23), + + ObxValue((timer) { + if (timer.value == 0) { + return TextButton( + onPressed: () { + controller.otpStatus.value = OtpStatus.reSend; + controller.startTimer(); + }, + child: Text( + style: AppFonts.yekan13.copyWith( + color: AppColor.blueNormal, + ), + 'ارسال مجدد کد یکبار مصرف', + ), + ); + } else { + return Text( + 'اعتبار رمز ارسال شده ${controller.timeFormatted}', + style: AppFonts.yekan13, + ); + } + }, controller.secondsRemaining), + + RichText( + text: TextSpan( + children: [ + TextSpan( + text: ' کد ارسال شده به شماره ', + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDark, + ), + ), + TextSpan( + text: controller.phoneOtpNumberController.value.text, + style: AppFonts.yekan13Bold.copyWith( + color: AppColor.darkGreyDark, + ), + ), + TextSpan( + recognizer: + TapGestureRecognizer() + ..onTap = () { + controller.otpStatus.value = OtpStatus.init; + }, + text: ' ویرایش', + style: AppFonts.yekan14.copyWith( + color: AppColor.blueNormal, + ), + ), + ], + ), + ), + + SizedBox(height: 23), + RElevated( + text: 'ورود', + onPressed: () { + if (controller.formKeyOtp.value.currentState?.validate() == + true) {} + }, + width: Get.width, + height: 48, + ), + ], + ), + ), + ); + }, controller.formKeySentOtp); + }*/ +} diff --git a/packages/inspection/lib/presentation/pages/display_information/logic.dart b/packages/inspection/lib/presentation/pages/display_information/logic.dart new file mode 100644 index 0000000..e90fe4d --- /dev/null +++ b/packages/inspection/lib/presentation/pages/display_information/logic.dart @@ -0,0 +1,3 @@ +import 'package:rasadyar_core/core.dart'; + +class DisplayInformationLogic extends GetxController {} diff --git a/packages/inspection/lib/presentation/pages/display_information/view.dart b/packages/inspection/lib/presentation/pages/display_information/view.dart new file mode 100644 index 0000000..33f879a --- /dev/null +++ b/packages/inspection/lib/presentation/pages/display_information/view.dart @@ -0,0 +1,428 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class DisplayInformationPage extends GetView { + const DisplayInformationPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.bgLight, + appBar: RAppBar( + title: 'نمایش اطلاعات', + leading: Assets.vec.messageAddSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode( + AppColor.blueNormal, + BlendMode.srcIn, + ), + ), + ), + + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + spacing: 20, + children: [ + ratingbarWidget(), + markerDetailsWidget(), + accompanyingInspectorsWidget(), + accompanyingInspectorsWidget(), + violationWidget(), + violationWidget(), + SizedBox(height: 30,) + ], + ), + + + ), + ), + + + + Padding( + padding: const EdgeInsets.fromLTRB(20, 4, 20, 25), + child: Row( + children: [ + Expanded( + child: RElevated(height: 40, text: 'ثبت', onPressed: () {}), + ), + SizedBox(width: 8), + Expanded( + child: ROutlinedElevated( + height: 40, + text: 'انصراف', + onPressed: () { + Get.until((route) => route.isFirst); + }, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget ratingbarWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(35, 35, 35,0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [Text('به این صنف امتیاز دهید', style: AppFonts.yekan12)], + ), + + SizedBox(height: 12), + RatingBar.builder( + initialRating: 3, + minRating: 1, + direction: Axis.horizontal, + allowHalfRating: true, + itemCount: 5, + wrapAlignment: WrapAlignment.center, + itemPadding: EdgeInsets.symmetric(horizontal: 4.0), + itemBuilder: (context, _) => Icon(Icons.star, color: Colors.amber), + onRatingUpdate: (rating) {}, + ), + ], + ), + ); + } +} + +Widget violationWidget() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 35), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 0.7, color: AppColor.bgDark), + ), + child: Column( + spacing: 16, + children: [ + RTextField( + controller: TextEditingController(), + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + ), + RTextField( + controller: TextEditingController(), + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 3, + minLines: 3, + ), + RTextField( + controller: TextEditingController(), + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + ), + RTextField( + controller: TextEditingController(), + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + ), + RTextField( + controller: TextEditingController(), + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 3, + minLines: 3, + ), + ], + ), + ); +} + +Widget markerDetailsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.symmetric(horizontal: 35, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'ایجاد بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.bgDark), + ), + ], + ), + Container( + height: 32, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + ...List.generate( + 5, + (index) => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'فروش رفته', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + ], + ), + ); +} + +Widget accompanyingInspectorsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.symmetric(horizontal: 35), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'بازرس همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.bgDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'نام و نام خانوادگی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + 'آیدا گل محمدی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ], + ), + ); +} diff --git a/packages/inspection/lib/presentation/pages/filter/logic.dart b/packages/inspection/lib/presentation/pages/filter/logic.dart new file mode 100644 index 0000000..1cd48a2 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/filter/logic.dart @@ -0,0 +1,144 @@ +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/utils/marker_generator.dart'; +import 'package:rasadyar_inspection/presentation/pages/filter/view.dart'; + + +class InspectorFilterLogic extends GetxController + with GetTickerProviderStateMixin { + Rx currentLocation = LatLng(35.824891, 50.948025).obs; + RxList allMarkers = [].obs; + RxList markers = [].obs; + Timer? _debounceTimer; + RxBool isLoading = false.obs; + + RxInt filterIndex = 0.obs; + RxInt showIndex = 0.obs; + bool showSlideHint = true; + + late Rx slidController; + + Rx mapController = MapController().obs; + late final AnimatedMapController animatedMapController; + + late DraggableBottomSheetController filterBottomSheetController; + late DraggableBottomSheetController selectedLocationBottomSheetController; + late DraggableBottomSheetController detailsLocationBottomSheetController; + late final BottomSheetManager bottomSheetManager; + + Future determineCurrentPosition() async { + final position = await Geolocator.getCurrentPosition( + locationSettings: AndroidSettings(accuracy: LocationAccuracy.best), + ); + final latLng = LatLng(position.latitude, position.longitude); + + currentLocation.value = latLng; + markers.add(latLng); + animatedMapController.animateTo( + dest: latLng, + zoom: 18, + curve: Curves.easeInOut, + duration: const Duration(seconds: 1), + ); + } + + void debouncedUpdateVisibleMarkers({required LatLng center}) { + _debounceTimer?.cancel(); + _debounceTimer = Timer(const Duration(milliseconds: 300), () { + final filtered = filterNearbyMarkers({ + 'markers': allMarkers, + 'centerLat': center.latitude, + 'centerLng': center.longitude, + 'radius': 2000.0, + }); + + markers.addAll(filtered); + }); + } + + List filterNearbyMarkers(Map args) { + final List rawMarkers = args['markers']; + final double centerLat = args['centerLat']; + final double centerLng = args['centerLng']; + final double radiusInMeters = args['radius']; + final center = LatLng(centerLat, centerLng); + final distance = Distance(); + + return rawMarkers + .where((marker) => distance(center, marker) <= radiusInMeters) + .toList(); + } + + Future generatedMarkers() async { + final generatedMarkers = await generateLocationsUsingCompute(100000); + allMarkers.value = generatedMarkers; + } + + @override + void onInit() { + super.onInit(); + animatedMapController = AnimatedMapController( + vsync: this, + duration: const Duration(milliseconds: 500), + curve: Curves.easeInOut, + cancelPreviousAnimations: true, + ); + + filterBottomSheetController = DraggableBottomSheetController( + initialHeight: 350, + minHeight: 200, + maxHeight: Get.height * 0.5, + ); + + selectedLocationBottomSheetController = DraggableBottomSheetController( + initialHeight: 200, + minHeight: 100, + maxHeight: 200, + ); + + + detailsLocationBottomSheetController = DraggableBottomSheetController( + initialHeight: Get.height * 0.5, + minHeight: Get.height * 0.37, + maxHeight: Get.height * 0.5, + ); + + slidController = SlidableController(this).obs; + bottomSheetManager = BottomSheetManager({ + filterBottomSheetController: + () => filterWidget(filterIndex: filterIndex, showIndex: showIndex), + selectedLocationBottomSheetController: + () => selectedLocationWidget( + showHint: + selectedLocationBottomSheetController.isVisible.value && + showSlideHint, + sliderController: slidController.value, + trigger: triggerSlidableAnimation, + toggle: selectedLocationBottomSheetController.toggle, + ), + detailsLocationBottomSheetController: () => markerDetailsWidget(), + }); + } + + @override + void onReady() { + super.onReady(); + determineCurrentPosition(); + generatedMarkers(); + } + + Future triggerSlidableAnimation() async { + await Future.delayed(Duration(milliseconds: 200)); + await slidController.value.openEndActionPane(); + await Future.delayed(Duration(milliseconds: 200)); + await slidController.value.close(); + showSlideHint = false; + } + + @override + void onClose() { + slidController.close(); + super.onClose(); + } +} diff --git a/packages/inspection/lib/presentation/pages/filter/view.dart b/packages/inspection/lib/presentation/pages/filter/view.dart new file mode 100644 index 0000000..a523041 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/filter/view.dart @@ -0,0 +1,521 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; +import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart'; + +import 'logic.dart'; + +class SupervisionFilterPage extends GetView { + const SupervisionFilterPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: RAppBar(title: 'نقشه', additionalActions: [_searchButton(), _filterButton()]), + body: PopScope( + canPop: !controller.bottomSheetManager.isAnyVisible, + onPopInvokedWithResult: (didPop, result) { + controller.bottomSheetManager.closeFirstVisible(); + }, + child: Stack( + children: [_buildMap(), _buildGpsButton(), Obx(() => controller.bottomSheetManager.buildVisibleSheet())], + ), + ), + ); + } + + GestureDetector _searchButton() { + return GestureDetector( + onTap: () async{ + + }, + child: Assets.vec.searchSvg + .svg(width: 24, height: 24, colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn)) + .paddingOnly(left: 16), + ); + } + + GestureDetector _filterButton() { + return GestureDetector( + onTap: () { + controller.filterBottomSheetController.toggle(); + }, + child: Assets.vec.filterSvg + .svg(width: 24, height: 24, colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn)) + .paddingOnly(left: 16), + ); + } + + Widget _buildMap() { + return ObxValue((currentLocation) { + return FlutterMap( + mapController: controller.animatedMapController.mapController, + options: MapOptions( + initialCenter: currentLocation.value, + initialZoom: 18, + onPositionChanged: (camera, hasGesture) { + controller.debouncedUpdateVisibleMarkers(center: camera.center); + }, + ), + children: [ + TileLayer(urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'), + ObxValue((markers) { + return MarkerLayer( + markers: markers + .map( + (e) => markerWidget( + marker: e, + onTap: () { + controller.selectedLocationBottomSheetController.isVisible.value = true; + }, + ), + ) + .toList(), + ); + }, controller.markers), + ], + ); + }, controller.currentLocation); + } + + Widget _buildGpsButton() { + return Positioned( + right: 10, + bottom: 15, + child: ObxValue((data) { + return RFab( + backgroundColor: AppColor.greenNormal, + isLoading: data.value, + icon: Assets.vec.gpsSvg.svg(width: 28, height: 28), + onPressed: () async { + controller.isLoading.value = true; + await controller.determineCurrentPosition(); + controller.isLoading.value = false; + }, + ); + }, controller.isLoading), + ); + } +} + +Marker markerWidget({required LatLng marker, required VoidCallback onTap}) { + return Marker( + point: marker, + child: GestureDetector( + onTap: onTap, + behavior: HitTestBehavior.opaque, + child: SizedBox(width: 36, height: 36, child: Assets.vec.mapMarkerSvg.svg(width: 30, height: 30)), + ), + ); +} + +Padding filterWidget({required RxInt filterIndex, required RxInt showIndex}) { + return Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + spacing: 16, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + spacing: 16, + children: [ + Container( + width: 100, + height: 64, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: AppColor.blueLight, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text('دامداران', style: AppFonts.yekan10), + Text('183 عدد', style: AppFonts.yekan13Bold), + ], + ), + ), + Container( + width: 100, + height: 64, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: AppColor.greenLight, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text('مرغداران', style: AppFonts.yekan10), + Text('183 عدد', style: AppFonts.yekan13Bold), + ], + ), + ), + Container( + width: 100, + height: 64, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: AppColor.blueLight, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text('اصناف', style: AppFonts.yekan10), + Text('183 عدد', style: AppFonts.yekan13Bold), + ], + ), + ), + ], + ), + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 12, + children: [ + Text( + 'فیلتر نمایش', + textAlign: TextAlign.center, + style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal), + ), + ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 8, + children: [ + customChip( + isSelected: data.value == 0, + onTap: (data) { + filterIndex.value = data; + }, + index: 0, + title: 'دامداران', + ), + customChip( + isSelected: data.value == 1, + title: 'مرغداران', + onTap: (data) { + filterIndex.value = data; + }, + index: 1, + ), + customChip( + isSelected: data.value == 2, + title: 'اصناف', + onTap: (data) { + filterIndex.value = data; + }, + index: 2, + ), + ], + ); + }, filterIndex), + ], + ), + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 12, + children: [ + Text( + 'نمایش', + textAlign: TextAlign.center, + style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal), + ), + ObxValue((data) { + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 8, + children: [ + customChip( + isSelected: data.value == 0, + title: 'نمایش همه', + onTap: (data) { + showIndex.value = data; + }, + index: 0, + ), + customChip( + isSelected: data.value == 1, + title: 'دارای تراکنش', + onTap: (data) { + showIndex.value = data; + }, + index: 1, + ), + customChip( + isSelected: data.value == 2, + title: 'بازرسی شده ها', + onTap: (data) { + showIndex.value = data; + }, + index: 2, + ), + customChip( + isSelected: data.value == 3, + title: 'بازرسی نشده ها', + onTap: (data) { + showIndex.value = data; + }, + index: 3, + ), + customChip( + isSelected: data.value == 4, + title: 'متخلفین', + onTap: (data) { + showIndex.value = data; + }, + index: 4, + ), + ], + ), + ); + }, showIndex), + ], + ), + ], + ), + ); +} + +Widget markerDetailsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.all(35), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + spacing: 12, + children: [ + Text( + 'داود خرم پور', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkHover), + ), + Spacer(), + vecWidgetWithOnTap( + child: Assets.vec.mapSvg.svg(), + onTap: () { + Get.toNamed(InspectionRoutes.inspectionLocationDetails); + }, + width: 24, + height: 24, + color: AppColor.blueNormal, + ), + vecWidgetWithOnTap( + child: Assets.vec.messageAddSvg.svg(), + width: 24, + height: 24, + color: AppColor.greenNormal, + onTap: () { + Get.toNamed(InspectionRoutes.inspectionAddSupervision); + }, + ), + + vecWidgetWithOnTap( + child: Assets.vec.securityTimeSvg.svg(), + color: AppColor.warning, + height: 24, + width: 24, + onTap: () {}, + ), + ], + ), + Container( + height: 32, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: AppColor.blueLightHover)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'باقی مانده', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + + ...List.generate( + 5, + (index) => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'فروش رفته', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + ), + ], + ), + ); +} +Widget selectedLocationWidget({ + required bool showHint, + required SlidableController sliderController, + required VoidCallback trigger, + required VoidCallback toggle, +}) { + eLog(showHint); + if (showHint) { + trigger.call(); + } + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20), + child: Slidable( + key: Key('selectedLocationWidget'), + controller: sliderController, + endActionPane: ActionPane( + motion: StretchMotion(), + children: [ + CustomSlidableAction( + onPressed: (context) { + Get.toNamed(InspectionRoutes.inspectionLocationDetails); + }, + backgroundColor: AppColor.blueNormal, + foregroundColor: Colors.white, + padding: EdgeInsets.all(16), + borderRadius: BorderRadius.only(bottomRight: Radius.circular(8), topRight: Radius.circular(8)), + child: Assets.vec.mapSvg.svg(width: 24, height: 24), + ), + CustomSlidableAction( + onPressed: (context) { + Get.toNamed(InspectionRoutes.inspectionAddSupervision); + }, + backgroundColor: AppColor.greenNormal, + padding: EdgeInsets.all(16), + child: Assets.vec.messageAddSvg.svg(), + ), + CustomSlidableAction( + onPressed: (context) {}, + backgroundColor: AppColor.warning, + padding: EdgeInsets.all(16), + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(8), topLeft: Radius.circular(8)), + child: Assets.vec.securityTimeSvg.svg(), + ), + ], + ), + child: GestureDetector( + onTap: toggle, + child: Container( + height: 58, + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Text('داود خرم مهری پور', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text('گوشت و مرغ', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)), + ], + ), + Column( + children: [ + Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text('0 کیلوگرم', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ), + ), + ), + ), + ); +} diff --git a/packages/inspection/lib/presentation/pages/inspection_map/logic.dart b/packages/inspection/lib/presentation/pages/inspection_map/logic.dart new file mode 100644 index 0000000..b6eb8b1 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/inspection_map/logic.dart @@ -0,0 +1,98 @@ +import 'dart:async'; + +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; +import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository_imp.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart'; + +import 'widget/map/logic.dart'; + +class InspectionMapLogic extends GetxController { + final BaseLogic baseLogic = Get.find(); + final MapLogic mapLogic = Get.find(); + InspectionRepositoryImp inspectionRepository = diInspection.get(); + + Rx currentLocation = LatLng(34.798315281272544, 48.51479142983491).obs; + + Rx>> allPoultryLocation = + Resource>.initial().obs; + + Rx>> searchedPoultryLocation = + Resource>.initial().obs; + + RxList markers = [].obs; + RxList markers2 = [].obs; + + RxInt filterIndex = 0.obs; + RxInt showIndex = 0.obs; + + @override + void onInit() { + super.onInit(); + + fetchAllPoultryLocations(); + + debounce(baseLogic.searchValue, (callback) { + if (callback != null && + callback.trim().isNotEmpty && + searchedPoultryLocation.value.status != ResourceStatus.loading) { + searchPoultryLocations(); + } + }, time: Duration(seconds: 2)); + } + + @override + void onReady() { + super.onReady(); + //determineCurrentPosition(); + } + + @override + void onClose() { + super.onClose(); + } + + Future fetchAllPoultryLocations() async { + allPoultryLocation.value = Resource>.loading(); + await safeCall( + call: () => inspectionRepository.getNearbyLocation(), + onSuccess: (result) async{ + if (result != null) { + + allPoultryLocation.value = Resource>.success(result); + mapLogic.allLocations.value = Resource>.success(result); + } else { + allPoultryLocation.value = Resource>.error( + 'No locations found', + ); + } + }, + onError: (error, stackTrace) { + allPoultryLocation.value = Resource>.error(error.toString()); + }, + ); + } + + Future searchPoultryLocations() async { + searchedPoultryLocation.value = Resource>.loading(); + await safeCall( + call: () => inspectionRepository.getNearbyLocation(value: baseLogic.searchValue.value), + onSuccess: (result) { + if (result != null || result!.isNotEmpty) { + searchedPoultryLocation.value = Resource>.success(result); + mapLogic.hasFilterOrSearch.value = true; + mapLogic.filteredLocations.value = Resource>.success(result); + } else { + searchedPoultryLocation.value = Resource>.empty(); + mapLogic.filteredLocations.value = Resource>.empty(); + } + }, + onError: (error, stackTrace) { + searchedPoultryLocation.value = Resource>.error( + error.toString(), + ); + }, + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/inspection_map/view.dart b/packages/inspection/lib/presentation/pages/inspection_map/view.dart new file mode 100644 index 0000000..433fdb9 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/inspection_map/view.dart @@ -0,0 +1,676 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart'; + +import 'logic.dart'; +import 'widget/map/view.dart'; + +class InspectionMapPage extends GetView { + const InspectionMapPage({super.key}); + + @override + Widget build(BuildContext context) { + return BasePage( + hasSearch: true, + hasFilter: true, + hasBack: false, + defaultSearch: false, + filteringWidget: filterWidget(showIndex: 3.obs, filterIndex: 5.obs), + widgets: [ + MapPage(), + ObxValue((data) { + if (data.value) { + WidgetsBinding.instance.addPostFrameCallback((_) { + Get.bottomSheet( + searchWidget(), + isScrollControlled: true, + isDismissible: true, + ignoreSafeArea: false, + ); + controller.baseLogic.isSearchSelected.value = false; + }); + } + return const SizedBox.shrink(); + }, controller.baseLogic.isSearchSelected), + ], + ); + } + + BaseBottomSheet searchWidget() { + return BaseBottomSheet( + height: Get.height * 0.85, + rootChild: Column( + spacing: 8, + children: [ + Row( + spacing: 12, + children: [ + Expanded( + child: RTextField( + height: 40, + borderColor: AppColor.blackLight, + suffixIcon: ObxValue( + (data) => Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: (data.value == null) + ? Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ) + : IconButton( + onPressed: () { + controller.baseLogic.searchTextController.clear(); + controller.baseLogic.searchValue.value = null; + controller.baseLogic.isSearchSelected.value = false; + controller.mapLogic.hasFilterOrSearch.value = false; + controller.searchedPoultryLocation.value = Resource.initial(); + }, + enableFeedback: true, + padding: EdgeInsets.zero, + iconSize: 24, + splashRadius: 50, + icon: Assets.vec.closeCircleSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ), + controller.baseLogic.searchValue, + ), + hintText: 'جستجو کنید ...', + hintStyle: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + filledColor: Colors.white, + filled: true, + controller: controller.baseLogic.searchTextController, + onChanged: (val) => controller.baseLogic.searchValue.value = val, + ), + ), + GestureDetector( + onTap: () { + Get.back(); + }, + child: Assets.vec.mapSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ], + ), + Expanded( + child: ObxValue((rxData) { + final resource = rxData.value; + final status = resource.status; + final items = resource.data; + final message = resource.message ?? 'خطا در بارگذاری'; + + if (status == ResourceStatus.initial) { + return Center(child: Text('ابتدا جستجو کنید')); + } + + if (status == ResourceStatus.loading) { + return const Center(child: CircularProgressIndicator()); + } + + if (status == ResourceStatus.error) { + return Center(child: Text(message)); + } + + if (items == null || items.isEmpty) { + return Center(child: EmptyWidget()); + } + + return ListView.separated( + itemCount: items.length, + separatorBuilder: (context, index) => SizedBox(height: 8), + itemBuilder: (context, index) { + final item = items[index]; // اگر item استفاده نمیشه، می‌تونه حذف بشه + return ListItem2( + index: index, + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.cowSvg.path, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + item.unitName ?? 'N/A', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + item.user?.fullname ?? '', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'جوجه ریزی فعال', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + (item.hatching != null && item.hatching!.isNotEmpty) + ? 'دارد' + : 'ندراد', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + ], + ), + ); + }, + ); + }, controller.searchedPoultryLocation), + ), + ], + ), + ); + } + + /* + Widget selectedLocationWidget2({ + required bool showHint, + required SlidableController sliderController, + required VoidCallback trigger, + required VoidCallback toggle, + }) { + return ObxValue((data) { + return BaseBottomSheet( + height: data.value ? 450.h : 150.h, + child: ListItemWithOutCounter( + secondChild: Column( + spacing: 8, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داوود خرم پور', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'تاریخ بازرسی', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '1403/12/12', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + + buildRow( + title: 'تلفن خریدار', + value: '0326598653', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow(title: 'آخرین فعالیت', value: '1409/12/12'), + buildRow(title: 'موجودی', value: '5KG'), + buildRow(title: 'فروش رفته', value: '5KG'), + ], + ), + ), + Row( + children: [ + Expanded( + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + spacing: 7, + children: [ + RElevated( + width: 40.h, + height: 38.h, + backgroundColor: AppColor.greenNormal, + child: Assets.vec.messageAddSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + onPressed: () {}, + ), + RElevated( + width: 150.w, + height: 40.h, + backgroundColor: AppColor.blueNormal, + onPressed: () { + */ + /*controller.setEditData(item); + Get.bottomSheet( + addOrEditBottomSheet(true), + isScrollControlled: true, + backgroundColor: Colors.transparent, + ).whenComplete(() { + + });*/ /* + + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + spacing: 8, + children: [ + Assets.vec.mapSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Text( + 'مسیریابی', + style: AppFonts.yekan14Bold.copyWith(color: Colors.white), + ), + ], + ), + ), + ROutlinedElevated( + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog(onConfirm: () async {}, onRefresh: () async {}); + }, + borderColor: AppColor.bgIcon, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Assets.vec.securityTimeSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.bgIcon, BlendMode.srcIn), + ), + Text( + 'سوابق بازرسی', + style: AppFonts.yekan14Bold.copyWith(color: AppColor.bgIcon), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ], + ), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.cowSvg.path, + labelIconColor: AppColor.bgIcon, + onTap: () => data.value = !data.value, + selected: data.value, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داود خرم مهری پور', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + 'گوشت و مرغ', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text( + '0 کیلوگرم', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ), + ), + ); + }, controller.isSelectedDetailsLocation); + } +*/ +} + +Widget filterWidget({required RxInt filterIndex, required RxInt showIndex}) { + return BaseBottomSheet( + height: Get.height * 0.5, + child: Column( + spacing: 16, + children: [ + SizedBox(height: 1), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + spacing: 16, + children: [ + cardWithLabel( + title: 'اصناف', + count: 1234567, + icon: Assets.vec.shopSvg.svg(width: 24.w, height: 24.h), + backgroundColor: AppColor.greenLight, + backgroundBadgeColor: AppColor.greenLightActive, + ), + cardWithLabel( + title: 'دامداران', + count: 1234567, + icon: Assets.vec.peopleSvg.svg(width: 24.w, height: 24.h), + + backgroundColor: AppColor.blueLight, + backgroundBadgeColor: AppColor.blueLightActive, + ), + cardWithLabel( + title: 'مرغداران', + count: 1234567, + icon: Assets.vec.profile2Svg.svg(width: 24.w, height: 24.h), + backgroundColor: AppColor.redLight, + backgroundBadgeColor: AppColor.redLightActive, + ), + ], + ), + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 12, + children: [ + Text( + 'فیلتر نمایش', + textAlign: TextAlign.center, + style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal), + ), + ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 8, + children: [ + customChip( + isSelected: data.value == 0, + onTap: (data) { + filterIndex.value = data; + }, + index: 0, + title: 'دامداران', + ), + customChip( + isSelected: data.value == 1, + title: 'مرغداران', + onTap: (data) { + filterIndex.value = data; + }, + index: 1, + ), + customChip( + isSelected: data.value == 2, + title: 'اصناف', + onTap: (data) { + filterIndex.value = data; + }, + index: 2, + ), + ], + ); + }, filterIndex), + ], + ), + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 12, + children: [ + Text( + 'نمایش', + textAlign: TextAlign.center, + style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal), + ), + ObxValue((data) { + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 8, + children: [ + customChip( + isSelected: data.value == 0, + title: 'نمایش همه', + onTap: (data) { + showIndex.value = data; + }, + index: 0, + ), + customChip( + isSelected: data.value == 1, + title: 'دارای تراکنش', + onTap: (data) { + showIndex.value = data; + }, + index: 1, + ), + + customChip( + isSelected: data.value == 2, + title: 'بازرسی شده ها', + onTap: (data) { + showIndex.value = data; + }, + index: 2, + ), + customChip( + isSelected: data.value == 3, + title: 'بازرسی نشده ها', + onTap: (data) { + showIndex.value = data; + }, + index: 3, + ), + customChip( + isSelected: data.value == 4, + title: 'متخلفین', + onTap: (data) { + showIndex.value = data; + }, + index: 4, + ), + ], + ), + ); + }, showIndex), + ], + ), + ], + ), + ); +} + +Widget cardWithLabel({ + required String title, + required int count, + String unit = 'عدد', + required Widget icon, + required Color backgroundColor, + required Color backgroundBadgeColor, +}) { + return SizedBox( + width: 114.w, + height: 115.h, + child: Stack( + clipBehavior: Clip.antiAlias, + alignment: Alignment.topCenter, + children: [ + Positioned( + bottom: 0, + right: 0, + left: 0, + child: Container( + width: 114.w, + height: 91.h, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: backgroundColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 0.25, color: AppColor.blackLightHover), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 6, + children: [ + Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.textColor)), + Text( + count.separatedByComma, + style: AppFonts.yekan16.copyWith(color: AppColor.textColor), + ), + Text(unit, style: AppFonts.yekan12.copyWith(color: AppColor.textColor)), + ], + ), + ), + ), + Positioned( + top: 5.h, + child: Container( + width: 32.w, + height: 32.h, + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: backgroundBadgeColor, + borderRadius: BorderRadius.circular(50), + border: Border.all(color: AppColor.borderColor, width: 0.25), + ), + child: Center(child: icon), + ), + ), + ], + ), + ); +} + +Widget selectedLocationWidget({ + required bool showHint, + required SlidableController sliderController, + required VoidCallback trigger, + required VoidCallback toggle, +}) { + if (showHint) { + trigger.call(); + } + return BaseBottomSheet( + height: 150.h, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20), + child: Slidable( + key: Key('selectedLocationWidget'), + controller: sliderController, + endActionPane: ActionPane( + motion: StretchMotion(), + children: [ + CustomSlidableAction( + onPressed: (context) { + Get.toNamed(InspectionRoutes.inspectionLocationDetails); + }, + backgroundColor: AppColor.blueNormal, + foregroundColor: Colors.white, + padding: EdgeInsets.all(16), + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(8), + topRight: Radius.circular(8), + ), + child: Assets.vec.mapSvg.svg(width: 24, height: 24), + ), + CustomSlidableAction( + onPressed: (context) { + Get.toNamed(InspectionRoutes.inspectionAddSupervision); + }, + backgroundColor: AppColor.greenNormal, + padding: EdgeInsets.all(16), + child: Assets.vec.messageAddSvg.svg(), + ), + CustomSlidableAction( + onPressed: (context) {}, + backgroundColor: AppColor.warning, + padding: EdgeInsets.all(16), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(8), + topLeft: Radius.circular(8), + ), + child: Assets.vec.securityTimeSvg.svg(), + ), + ], + ), + child: GestureDetector( + onTap: toggle, + child: Container( + height: 58, + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Text( + 'داود خرم مهری پور', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + 'گوشت و مرغ', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + children: [ + Text( + 'باقی مانده', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + '0 کیلوگرم', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ), + ), + ), + ), + ), + ); +} diff --git a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart new file mode 100644 index 0000000..1d217b4 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart @@ -0,0 +1,189 @@ +import 'dart:async'; +import 'dart:math'; + +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; +import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository_imp.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart'; + +class MapLogic extends GetxController with GetTickerProviderStateMixin { + RxBool isLoading = false.obs; + RxBool isSelectedDetailsLocation = false.obs; + RxDouble currentZoom = (15.0).obs; + Rx mapController = MapController().obs; + BaseLogic baseLogic = Get.find(); + InspectionRepositoryImp inspectionRepository = diInspection.get(); + + Rx currentLocation = LatLng(34.798315281272544, 48.51479142983491).obs; + RxBool hasFilterOrSearch = false.obs; + + Timer? _debounceTimer; + + final distance = Distance(); + + late final AnimatedMapController animatedMapController; + + Rx>> markerLocations = + Resource>.initial().obs; + + Rx>> allLocations = + Resource>.initial().obs; + + Rx>> filteredLocations = + Resource>.initial().obs; + + Rx>> hatchingDetails = + Resource>.initial().obs; + + @override + void onInit() { + super.onInit(); + animatedMapController = AnimatedMapController( + vsync: this, + duration: const Duration(milliseconds: 500), + curve: Curves.easeInOut, + cancelPreviousAnimations: true, + ); + + ever(hasFilterOrSearch, (callback) { + if (callback) { + markerLocations.value = filteredLocations.value; + } else { + markerLocations.value = allLocations.value; + } + }); + + ever(allLocations, (_) { + if (!hasFilterOrSearch.value) { + markerLocations.value = allLocations.value; + } + }); + + ever(filteredLocations, (_) { + if (hasFilterOrSearch.value) { + markerLocations.value = filteredLocations.value; + } + }); + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + double _deg2rad(double deg) => deg * (pi / 180); + + Future determineCurrentPosition() async { + isLoading.value = true; + final position = await Geolocator.getCurrentPosition( + locationSettings: AndroidSettings(accuracy: LocationAccuracy.best), + ); + final latLng = LatLng(position.latitude, position.longitude); + + /*currentLocation.value = latLng; + markers.add(PoultryLocationModel( + lat: latLng.latitude, + long: latLng.longitude + ));*/ + animatedMapController.animateTo( + dest: latLng, + zoom: 18, + curve: Curves.easeInOut, + duration: const Duration(seconds: 1), + ); + isLoading.value = false; + } + + /* + void debouncedUpdateVisibleMarkers({required LatLng center, required double zoom}) { + _debounceTimer?.cancel(); + _debounceTimer = Timer(const Duration(milliseconds: 300), () { + final radius = getVisibleRadiusKm( + zoom: zoom, + screenWidthPx: Get.width.toDouble(), + latitude: center.latitude, + ); + + final filtered = filterNearbyMarkers( + all.value.data ?? [], + center.latitude, + center.longitude, + radius, + ); + final existingIds = markers2.map((e) => e.id).toSet(); + final uniqueFiltered = filtered.where((e) => !existingIds.contains(e.id)).toList(); + markers2.addAll(uniqueFiltered); + }); + } +*/ + + List filterNearbyMarkers( + List allMarkers, + double centerLat, + double centerLng, + double radiusInMeters, + ) { + final center = LatLng(centerLat, centerLng); + + return allMarkers.where((marker) => distance(center, marker) <= radiusInMeters).toList(); + } + + double getVisibleRadiusKm({required LatLng center, required LatLng corner}) { + const earthRadius = 6371; // Km + + final dLat = _deg2rad(corner.latitude - center.latitude); + final dLng = _deg2rad(corner.longitude - center.longitude); + + final a = + sin(dLat / 2) * sin(dLat / 2) + + cos(_deg2rad(center.latitude)) * + cos(_deg2rad(corner.latitude)) * + sin(dLng / 2) * + sin(dLng / 2); + + final c = 2 * atan2(sqrt(a), sqrt(1 - a)); + return earthRadius * c; + } + + bool isInVisibleBounds(LatLng point, LatLngBounds bounds) { + return point.latitude <= bounds.north && + point.latitude >= bounds.south && + point.longitude >= bounds.west && + point.longitude <= bounds.east; + } + + Future getFullDetailsLocation(PoultryLocationModel model) async { + hatchingDetails.value = Resource>.loading(); + await safeCall( + call: () => inspectionRepository.getHatchingDetails( + code: model.breedingUniqueId, + active: (model.hatching != null && model.hatching!.isNotEmpty), + ), + onSuccess: (result) { + if (result != null && result.isNotEmpty) { + hatchingDetails.value = Resource>.success(result); + } else { + hatchingDetails.value = Resource>.empty(); + } + }, + onError: (error, stackTrace) { + hatchingDetails.value = Resource>.error('$error / $stackTrace'); + }, + ); + } + + void cleanDataAfterBottomSheet() { + eLog('cleanDataAfterBottomSheet'); + hatchingDetails.value = Resource>.initial(); + } +} diff --git a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart new file mode 100644 index 0000000..417f50d --- /dev/null +++ b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart @@ -0,0 +1,572 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; +import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; + +import 'logic.dart'; + +class MapPage extends GetView { + const MapPage({super.key}); + + @override + Widget build(BuildContext context) { + return Expanded( + child: Stack( + fit: StackFit.expand, + children: [ + ObxValue((currentLocation) { + return FlutterMap( + mapController: controller.animatedMapController.mapController, + options: MapOptions( + initialCenter: currentLocation.value, + interactionOptions: const InteractionOptions( + flags: InteractiveFlag.all & ~InteractiveFlag.rotate, + ), + initialZoom: 15, + onPositionChanged: (camera, hasGesture) { + controller.currentZoom.value = camera.zoom; + /* controller.debouncedUpdateVisibleMarkers( + center: camera.center, + zoom: camera.zoom, + );*/ + }, + ), + + children: [ + TileLayer( + urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', + userAgentPackageName: 'ir.mnpc.rasadyar', + ), + + ObxValue((markers) { + return MarkerClusterLayerWidget( + options: MarkerClusterLayerOptions( + maxClusterRadius: 80, + size: const Size(40, 40), + alignment: Alignment.center, + padding: const EdgeInsets.all(50), + maxZoom: 18, + markers: buildMarkers(markers.value.data ?? []), + builder: (context, clusterMarkers) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: Colors.blue, + ), + child: Center( + child: Text( + clusterMarkers.length.toString(), + style: const TextStyle(color: Colors.white), + ), + ), + ); + }, + ), + ); + }, controller.markerLocations), + ], + ); + }, controller.currentLocation), + + // Uncomment the following lines to enable the search widget + /* Positioned( + top: 10, + left: 20, + right: 20, + child: ObxValue((data) { + if (data.value) { + return SearchWidget( + onSearchChanged: (data) { + controller.baseLogic.searchValue.value = data; + }, + ); + } else { + return SizedBox.shrink(); + } + }, controller.baseLogic.isSearchSelected), + ),*/ + ], + ), + ); + } + + Widget _buildGpsButton() { + return ObxValue((data) { + return RFab( + backgroundColor: AppColor.greenNormal, + isLoading: data.value, + icon: Assets.vec.gpsSvg.svg(width: 40.w, height: 40.h), + onPressed: () async => await controller.determineCurrentPosition(), + ); + }, controller.isLoading); + } + + List buildMarkers(List markers) { + final visibleBounds = controller.animatedMapController.mapController.camera.visibleBounds; + final isZoomedIn = controller.currentZoom > 17; + + final updatedMarkers = markers.map((location) { + final point = LatLng(location.lat ?? 0, location.long ?? 0); + final isVisible = controller.isInVisibleBounds(point, visibleBounds); + + if (isZoomedIn && isVisible) { + return buildMarkerWithHatching(point, location); + } else { + return buildMarkerWithOutHatching(point, location); + } + }).toList(); + + return updatedMarkers; + } + + Marker buildMarkerWithHatching(LatLng point, PoultryLocationModel location) { + return Marker( + point: point, + width: 180.w, + height: 50.h, + child: GestureDetector( + onTap: () { + bool hasHatching = location.hatching != null && location.hatching!.isNotEmpty; + Get.bottomSheet( + detailsBottomSheet(hasHatching, location), + isScrollControlled: true, + isDismissible: true, + ).then((_) => controller.cleanDataAfterBottomSheet()); + }, + child: Container( + height: 30.h, + padding: EdgeInsets.all(5.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15.r), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.1), + blurRadius: 5, + offset: const Offset(0, 2), + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h), + Text(location.user?.fullname ?? '', style: AppFonts.yekan12), + ], + ), + ), + ), + ); + } + + Marker buildMarkerWithOutHatching(LatLng point, PoultryLocationModel location) { + return Marker( + point: point, + width: 40.h, + height: 50.h, + child: GestureDetector( + onTap: () { + bool hasHatching = location.hatching != null && location.hatching!.isNotEmpty; + Get.bottomSheet( + detailsBottomSheet(hasHatching, location), + isScrollControlled: true, + isDismissible: true, + ).then((_) => controller.cleanDataAfterBottomSheet()); + }, + child: Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h), + ), + ); + } + + Widget detailsBottomSheet(bool hasHatching, PoultryLocationModel location) { + return ObxValue((data) { + return BaseBottomSheet( + height: data.value + ? hasHatching + ? 550.h + : 400.h + : 150.h, + child: Column( + spacing: 12, + children: [ + ListItemWithOutCounter( + secondChild: Column( + spacing: 8, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + location.unitName ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'جوجه ریزی فعال', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + hasHatching ? 'دارد' : 'ندارد', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + buildRow(title: 'مشخصات مرغدار', value: location.user?.fullname ?? 'N/A'), + + buildRow( + title: 'تلفن مرغدار', + value: location.user?.mobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + Visibility( + visible: location.address?.city?.name != null, + child: buildRow( + title: 'شهر', + value: location.address?.city?.name ?? 'N/A', + ), + ), + Visibility( + visible: location.address?.address != null, + child: buildRow(title: 'آردس', value: location.address?.address ?? 'N/A'), + ), + + buildRow(title: 'شناسه یکتا', value: location.breedingUniqueId ?? 'N/A'), + ], + ), + ), + Row( + children: [ + Expanded( + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + spacing: 7, + children: [ + RElevated( + width: 40.h, + height: 38.h, + backgroundColor: AppColor.greenNormal, + child: Assets.vec.messageAddSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + onPressed: () {}, + ), + RElevated( + width: 150.w, + height: 40.h, + backgroundColor: AppColor.blueNormal, + onPressed: () { + if (controller.hatchingDetails.value.status != + ResourceStatus.success) { + controller.getFullDetailsLocation(location); + } + Get.bottomSheet( + fullDetailsBottomSheet(location), + isScrollControlled: true, + isDismissible: true, + ignoreSafeArea: false, + ); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + spacing: 8, + children: [ + Assets.vec.mapSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Text( + 'جزییات کامل', + style: AppFonts.yekan14Bold.copyWith(color: Colors.white), + ), + ], + ), + ), + ROutlinedElevated( + width: 150.w, + height: 40.h, + onPressed: () { + // buildDeleteDialog(onConfirm: () async {}, onRefresh: () async {}); + }, + borderColor: AppColor.bgIcon, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Assets.vec.securityTimeSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.bgIcon, BlendMode.srcIn), + ), + Text( + 'سوابق بازرسی', + style: AppFonts.yekan14Bold.copyWith(color: AppColor.bgIcon), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ], + ), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.cowSvg.path, + labelIconColor: AppColor.bgIcon, + onTap: () => data.value = !data.value, + selected: data.value, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + location.unitName ?? 'N/A', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + location.user?.fullname ?? '', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'جوجه ریزی فعال', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + (location.hatching != null && location.hatching!.isNotEmpty) + ? 'دارد' + : 'ندراد', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ), + ), + + if (hasHatching) ...{hatchingWidget(location)}, + ], + ), + ); + }, controller.isSelectedDetailsLocation); + } + + Container hatchingWidget(PoultryLocationModel location) { + return Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + padding: EdgeInsets.all(8.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: Column( + spacing: 8.h, + children: [ + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text('تاریخ', style: AppFonts.yekan14.copyWith(color: AppColor.textColor)), + + Text( + location.hatching?.first.date?.formattedJalaliDate ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + buildRow( + title: 'باقیمانده', + value: '${location.hatching?.first.leftOver.separatedByComma ?? 'N/A'} عدد', + ), + buildRow( + title: 'سن جوجه ریزی', + value: '${location.hatching?.first.chickenAge ?? 'N/A'} روز', + ), + buildRow( + title: 'شماره مجوز جوجه ریزی', + value: location.hatching?.first.licenceNumber.toString() ?? 'N/A', + ), + ], + ), + ); + } + + Widget fullDetailsBottomSheet(PoultryLocationModel location) { + return BaseBottomSheet( + height: 550.h, + child: ObxValue((state) { + switch (state.value.status) { + case ResourceStatus.initial: + case ResourceStatus.loading: + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [CupertinoActivityIndicator(), Text('در حال دریافت اطلاعات ...')], + ); + + case ResourceStatus.success: + return widgetFullDetailsBottomSheet(); + case ResourceStatus.error: + return ErrorWidget(state.value.message ?? 'خطا در دریافت اطلاعات'); + case ResourceStatus.empty: + return EmptyWidget(); + } + }, controller.hatchingDetails), + ); + } + + Container widgetFullDetailsBottomSheet() => Container( + padding: EdgeInsets.all(8.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.r), + border: Border.all(width: 1.w, color: AppColor.lightGreyNormalHover), + ), + child: ObxValue((data) { + final HatchingDetails? hatchingDetails = data.value.data?.first; + return Column( + spacing: 6.h, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'تاریخ جوجه ریزی', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + hatchingDetails?.date.toString().formattedJalaliDate ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + + buildRow( + title: 'مشخصات مرغدار', + value: hatchingDetails?.vetFarm?.vetFarmFullName ?? 'N/A', + ), + + buildRow( + title: 'تلفن مرغدار', + value: hatchingDetails?.vetFarm?.vetFarmMobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow( + title: 'جوجه ریزی فعال', + value: (hatchingDetails?.archive ?? false) ? 'ندارد' : 'دارد', + ), + buildRow(title: 'دوره', value: hatchingDetails?.period.toString() ?? 'N/A'), + + buildRow( + title: 'تعداد جوجه ریزی', + value: hatchingDetails?.quantity.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow( + title: 'تلفات کل', + value: hatchingDetails?.totalLosses.separatedByComma.addCountEXT ?? 'N/A', + ), + buildRow( + title: 'تلفات دامپزشکی', + value: hatchingDetails?.losses.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow( + title: 'باقیمانده در سالن', + value: hatchingDetails?.leftOver.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow(title: 'نژاد', value: hatchingDetails?.chickenBreed ?? 'N/A'), + + buildRow(title: 'شماره مجوز جوجه ریزی', value: hatchingDetails?.licenceNumber ?? 'N/A'), + + buildRow( + title: 'سن جوجه', + value: ((hatchingDetails?.archive ?? false) == true) + ? hatchingDetails?.nowAge.toString().addDayEXT ?? 'N/A' + : hatchingDetails?.chickenAge.toString().addDayEXT ?? 'N/A', + ), + + buildRow( + title: 'تعداد کشتار', + value: hatchingDetails?.killedQuantity.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow( + title: 'میانگین وزن کشتار', + value: hatchingDetails?.totalAverageKilledWeight.toString().addKgEXT ?? 'N/A', + ), + + buildRow( + title: 'وزن کشتار', + value: hatchingDetails?.totalKilledWeight.separatedByComma.addKgEXT ?? 'N/A', + ), + ], + ); + }, controller.hatchingDetails), + ); +} diff --git a/packages/inspection/lib/presentation/pages/location_details/logic.dart b/packages/inspection/lib/presentation/pages/location_details/logic.dart new file mode 100644 index 0000000..bc0a16e --- /dev/null +++ b/packages/inspection/lib/presentation/pages/location_details/logic.dart @@ -0,0 +1,34 @@ +import 'package:flutter/cupertino.dart'; +import 'package:rasadyar_core/core.dart'; + +class LocationDetailsLogic extends GetxController { + RxInt selectedSegment = 0.obs; + + // The data for the segments + final Map segments = { + 0: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('همه', style: AppFonts.yekan13), + ), + 1: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('بر اساس تاریخ', style: AppFonts.yekan13), + ), + }; + + RxBool seletected = false.obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/packages/inspection/lib/presentation/pages/location_details/view.dart b/packages/inspection/lib/presentation/pages/location_details/view.dart new file mode 100644 index 0000000..559508c --- /dev/null +++ b/packages/inspection/lib/presentation/pages/location_details/view.dart @@ -0,0 +1,254 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/utils/color_utils.dart'; +import 'package:rasadyar_core/presentation/widget/tabs/new_tab.dart'; +import 'logic.dart'; + +class LocationDetailsPage extends GetView { + const LocationDetailsPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.lightGreyLight, + appBar: RAppBar(title: 'جزئیات محل'), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 22), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + headerInfo(description: 'ایداگل محمدی', title: 'نام مالک'), + + headerInfo( + description: '09415115545', + title: 'شماره همراه', + background: AppColor.green1Light, + ), + + headerInfo(description: '183کیلوگرم', title: 'موجودی'), + ], + ), + ), + + Padding( + padding: const EdgeInsets.fromLTRB(22, 13, 22, 4), + child: Text( + 'نوع دریافت', + textAlign: TextAlign.center, + style: AppFonts.yekan13.copyWith(color: AppColor.blueNormal), + ), + ), + + ObxValue((data) { + return NewCupertinoSegmentedControl( + padding: EdgeInsetsDirectional.symmetric( + horizontal: 20, + vertical: 10, + ), + children: controller.segments, + groupValue: data.value, + selectedColor: AppColor.blueNormal, + unselectedColor: Colors.white, + borderColor: Colors.grey.shade300, + onValueChanged: (int value) { + data.value = value; + }, + ); + }, controller.selectedSegment), + Container( + height: 32, + margin: EdgeInsets.only(top: 10, left: 22, right: 22), + + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 10, + children: [ + Expanded( + child: ROutlinedElevatedIcon( + icon: FaIcon(FontAwesomeIcons.calendar), + onPressed:() async { + + Jalali? picked = await showPersianDatePicker( + context: context, + initialDate: Jalali.now(), + firstDate: Jalali(1385, 8), + lastDate: Jalali(1450, 9), + + initialEntryMode: + PersianDatePickerEntryMode.calendarOnly, + initialDatePickerMode: PersianDatePickerMode.day, + ); + }, + text: 'از تاریخ', + textStyle: AppFonts.yekan16.copyWith( + color: AppColor.blueNormal, + ), + ), + ), + Expanded( + child: ROutlinedElevatedIcon( + icon: FaIcon(FontAwesomeIcons.calendar), + onPressed: () async { + + Jalali? picked = await showPersianDatePicker( + context: context, + initialDate: Jalali.now(), + firstDate: Jalali(1385, 8), + lastDate: Jalali(1450, 9), + + initialEntryMode: + PersianDatePickerEntryMode.calendarOnly, + initialDatePickerMode: PersianDatePickerMode.day, + ); + }, + text: 'تا تاریخ', + textStyle: AppFonts.yekan16.copyWith( + color: AppColor.blueNormal, + ), + ), + ), + ], + ), + ), + SizedBox(height: 20), + Row( + children: [ + Expanded(child: Divider()), + Container( + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 6), + margin: EdgeInsets.symmetric(horizontal: 2), + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: AppColor.blueNormal.disabledColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(60), + ), + ), + child: Text( + 'تعداد کل تراکنش ها : 0', + textAlign: TextAlign.center, + style: AppFonts.yekan10, + ), + ), + Expanded(child: Divider()), + ], + ), + + Expanded( + child: GridView.builder( + itemCount: 51, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.fromLTRB(20, 14, 20, 50), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 8, + mainAxisSpacing: 8, + ), + itemBuilder: + (context, index) => Container( + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1, + color: const Color(0xFFEFEFEF), + ), + borderRadius: BorderRadius.circular(16), + ), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 22, + vertical: 21, + ), + child: Column( + spacing: 6, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + '${index + 1}- تراکنش موفق', + textAlign: TextAlign.center, + style: AppFonts.yekan10, + ), + SizedBox(height: 2), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan12, + ), + + Text( + 'محصول : مرغ', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.lightGreyNormalActive, + ), + ), + Text( + 'وزن : 5555 گرم', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.lightGreyNormalActive, + ), + ), + Text( + 'مبلغ : 14،000،000', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.lightGreyNormalActive, + ), + ), + + Text( + 'سرویس سامان کیش', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.blueNormal, + ), + ), + ], + ), + ), + ), + ), + ), + ], + ), + ); + } + + Container headerInfo({ + required String title, + required String description, + Color? background, + }) { + return Container( + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: ShapeDecoration( + color: background ?? AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blackLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + alignment: AlignmentDirectional.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 10, + children: [ + Text(title, style: AppFonts.yekan10), + + Text(description, style: AppFonts.yekan12), + ], + ), + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/pages.dart b/packages/inspection/lib/presentation/pages/pages.dart new file mode 100644 index 0000000..35043b5 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/pages.dart @@ -0,0 +1,22 @@ +export 'action/logic.dart'; +export 'action/view.dart'; +export 'add_mobile_inspector/logic.dart'; +export 'add_mobile_inspector/view.dart'; +export 'add_supervision/logic.dart'; +export 'add_supervision/view.dart'; +export 'display_information/logic.dart'; +export 'display_information/view.dart'; +export 'inspection_map/logic.dart'; +export 'inspection_map/view.dart'; +export 'location_details/logic.dart'; +export 'location_details/view.dart'; +export 'profile/logic.dart'; +export 'profile/view.dart'; +export 'records/logic.dart'; +export 'records/view.dart'; +export 'registration_of_violation/logic.dart'; +export 'registration_of_violation/view.dart'; +export 'root/logic.dart'; +export 'root/view.dart'; +export 'statistics/logic.dart'; +export 'statistics/view.dart'; diff --git a/packages/inspection/lib/presentation/pages/profile/logic.dart b/packages/inspection/lib/presentation/pages/profile/logic.dart new file mode 100644 index 0000000..e71a84b --- /dev/null +++ b/packages/inspection/lib/presentation/pages/profile/logic.dart @@ -0,0 +1,54 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; +import 'package:rasadyar_inspection/data/repositories/user/user_repository_imp.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; +import 'package:rasadyar_inspection/inspection.dart'; + +class ProfileLogic extends GetxController { + RootLogic rootLogic = Get.find(); + UserRepositoryImp userRepository = diInspection.get(); + Rx> userProfile = Resource.loading().obs; + + RxInt selectedRole = 0.obs; + RxInt selectedInformationType = 0.obs; + + @override + void onReady() { + super.onReady(); + rootLogic.userProfile.listen((data) { + if (data != null) { + userProfile.value = Resource.success(data); + } else { + userProfile.value = Resource.error('Failed to load user profile'); + } + }); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + Future fetchUserProfile() async { + userProfile.value = Resource.loading(); + + await safeCall( + call: () => userRepository.fetchUserProfile( + token: rootLogic.tokenStorageService.accessToken.value ?? '', + ), + onSuccess: (profile) { + if (profile != null) { + userProfile.value = Resource.success(profile); + } else { + userProfile.value = Resource.error('Failed to load user profile'); + } + }, + onError: (error, stackTrace) { + userProfile.value = Resource.error( + 'Failed to load user profile: ${error.toString()}', + ); + }, + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/profile/view.dart b/packages/inspection/lib/presentation/pages/profile/view.dart new file mode 100644 index 0000000..510f243 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/profile/view.dart @@ -0,0 +1,635 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; + +import 'logic.dart'; + +class ProfilePage extends GetView { + const ProfilePage({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Expanded( + flex: 1, + child: Container( + color: AppColor.blueNormal, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(), + ObxValue((data) { + final status = data.value.status; + + if (status == ResourceStatus.loading) { + return Container( + width: 128.w, + height: 128.h, + child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal)), + ); + } + + if (status == ResourceStatus.error) { + return Container( + width: 128.w, + height: 128.h, + child: Center(child: Text('خطا در دریافت اطلاعات')), + ); + } + + // Default UI + return Container( + width: 128.w, + height: 128.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: AppColor.blueLightActive, + ), + child: Center( + child: CircleAvatar( + radius: 64.w, + backgroundImage: NetworkImage(data.value.data?.user.photo ?? ''), + ), + ), + ); + }, controller.userProfile), + ], + ), + ), + ), + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 16, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10), + child: userProfileInformation(), + ), + ), + + Center( + child: Wrap( + alignment: WrapAlignment.center, + spacing: 20, + runSpacing: 10, + children: [ + cardActionWidget( + title: 'تغییر رمز عبور', + selected: true, + onPressed: () { + Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true); + }, + icon: Assets.vec.lockSvg.path, + ), + cardActionWidget( + title: 'خروج', + selected: true, + color: ColorFilter.mode(Colors.redAccent, BlendMode.srcIn), + cardColor: Color(0xFFEFEFEF), + textColor: AppColor.redDarkerText, + onPressed: () { + Get.bottomSheet(exitBottomSheet(), isScrollControlled: true); + }, + icon: Assets.vec.logoutSvg.path, + ), + ], + ), + ), + + SizedBox(height: 100), + ], + ), + ), + ], + ); + } + + Container invoiceIssuanceInformation() => Container(); + + Widget bankInformationWidget() => Column( + spacing: 16, + children: [ + itemList(title: 'نام بانک', content: 'سامان'), + itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'), + itemList(title: 'شماره کارت ', content: '54154545415'), + itemList(title: 'شماره حساب', content: '62565263263652'), + itemList(title: 'شماره شبا', content: '62565263263652'), + ], + ); + + Widget userProfileInformation() { + return ObxValue((data) { + if (data.value.status == ResourceStatus.loading) { + return LoadingWidget(); + } else if (data.value.status == ResourceStatus.error) { + return ErrorWidget('خطا در دریافت اطلاعات کاربر'); + } else if (data.value.status == ResourceStatus.success) { + User item = data.value.data!.user; + return Column( + spacing: 6, + children: [ + buildRowOnTapped( + onTap: () { + Get.bottomSheet( + userInformationBottomSheet(), + isScrollControlled: true, + ignoreSafeArea: false, + ); + }, + titleWidget: Column( + spacing: 3, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'اطلاعات هویتی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + Container(width: 37.w, height: 1.h, color: AppColor.greenNormal), + ], + ), + valueWidget: Assets.vec.editSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + itemList( + title: 'نام و نام خانوادگی', + content: '${item.firstName} ${item.lastName}', + icon: Assets.vec.userSvg.path, + hasColoredBox: true, + ), + itemList( + title: 'موبایل', + content: item.mobile ?? 'نامشخص', + icon: Assets.vec.callSvg.path, + ), + itemList( + title: 'کدملی', + content: item.nationalCode ?? 'نامشخص', + icon: Assets.vec.tagUserSvg.path, + ), + itemList( + title: 'شماره شناسنامه', + content: item.nationalCode ?? 'نامشخص', + icon: Assets.vec.userSquareSvg.path, + ), + + itemList( + title: 'استان', + content: item.provinceName ?? 'نامشخص', + icon: Assets.vec.pictureFrameSvg.path, + ), + itemList( + title: 'شهر', + content: item.cityName ?? 'نامشخص', + icon: Assets.vec.mapSvg.path, + ), + ], + ); + } else { + return SizedBox.shrink(); + } + }, controller.userProfile); + } + + Widget itemList({ + required String title, + required String content, + String? icon, + bool hasColoredBox = false, + }) => Container( + padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h), + decoration: BoxDecoration( + color: hasColoredBox ? AppColor.greenLight : Colors.transparent, + borderRadius: BorderRadius.circular(8), + border: hasColoredBox + ? Border.all(width: 0.25, color: AppColor.bgDark) + : Border.all(width: 0, color: Colors.transparent), + ), + child: Row( + spacing: 4, + children: [ + if (icon != null) + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: SvgGenImage.vec(icon).svg( + width: 20.w, + height: 20.h, + colorFilter: ColorFilter.mode(AppColor.mediumGreyNormalActive, BlendMode.srcIn), + ), + ), + Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyNormalActive)), + Spacer(), + Text(content, style: AppFonts.yekan13.copyWith(color: AppColor.mediumGreyNormalHover)), + ], + ), + ); + + Widget cardActionWidget({ + required String title, + required VoidCallback onPressed, + required String icon, + bool selected = false, + ColorFilter? color, + Color? cardColor, + Color? textColor, + }) { + return GestureDetector( + onTap: onPressed, + child: Column( + spacing: 4, + children: [ + Container( + width: 52, + height: 52, + padding: EdgeInsets.all(8), + decoration: ShapeDecoration( + color: cardColor ?? AppColor.blueLight, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: SvgGenImage.vec(icon).svg( + width: 40, + height: 40, + colorFilter: + color ?? + ColorFilter.mode( + selected ? AppColor.blueNormal : AppColor.whiteLight, + BlendMode.srcIn, + ), + ), + ), + SizedBox(height: 2), + Text( + title, + style: AppFonts.yekan10.copyWith( + color: textColor ?? (selected ? AppColor.blueNormal : AppColor.blueLightActive), + ), + textAlign: TextAlign.center, + ), + ], + ), + ); + } + + Widget userInformationBottomSheet() { + return Container(color: Colors.red); + /* return BaseBottomSheet( + height: 750.h, + child: SingleChildScrollView( + child: Column( + spacing: 8, + children: [ + Text( + 'ویرایش اطلاعات هویتی', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), + ), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 12, + children: [ + RTextField( + controller: controller.nameController, + label: 'نام', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.lastNameController, + label: 'نام خانوادگی', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.nationalCodeController, + label: 'شماره شناسنامه', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + RTextField( + controller: controller.nationalIdController, + label: 'کد ملی', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + ), + + ObxValue((data) { + return RTextField( + controller: controller.birthdayController, + label: 'تاریخ تولد', + initText: data.value?.formatCompactDate() ?? '', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + onTap: () {}, + ); + }, controller.birthDate), + + SizedBox(), + ], + ), + ), + SizedBox(), + + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), + ), + child: Column( + spacing: 8, + children: [ + Text( + 'عکس پروفایل', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + ObxValue((data) { + return Container( + width: Get.width, + height: 270, + decoration: BoxDecoration( + color: AppColor.lightGreyNormal, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLight), + ), + child: Center( + child: data.value == null + ? Padding( + padding: const EdgeInsets.fromLTRB(30, 10, 10, 30), + child: Image.network( + controller.userProfile.value.data?.image ?? '', + ), + ) + : Image.file(File(data.value!.path), fit: BoxFit.cover), + ), + ); + }, controller.selectedImage), + + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + text: 'گالری', + width: 150.w, + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + onPressed: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.gallery, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + ), + SizedBox(width: 16), + ROutlinedElevated( + text: 'دوربین', + width: 150.w, + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal), + onPressed: () async { + controller.selectedImage.value = await controller.imagePicker.pickImage( + source: ImageSource.camera, + imageQuality: 60, + maxWidth: 1080, + maxHeight: 720, + ); + }, + ), + ], + ), + ], + ), + ), + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ObxValue((data) { + return RElevated( + height: 40.h, + text: 'ویرایش', + isLoading: data.value, + onPressed: () async { + await controller.updateUserProfile(); + controller.getUserProfile(); + Get.back(); + }, + ); + }, controller.isOnLoading), + ROutlinedElevated( + height: 40.h, + text: 'انصراف', + borderColor: AppColor.blueNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + );*/ + } + + /* Widget _provinceWidget() { + return Obx(() { + return OverlayDropdownWidget( + items: controller.rootLogic.provinces, + onChanged: (value) { + controller.selectedProvince.value = value; + }, + selectedItem: controller.selectedProvince.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'), + ); + }); + } + + Widget _cityWidget() { + return ObxValue((data) { + return OverlayDropdownWidget( + items: data, + onChanged: (value) { + controller.selectedCity.value = value; + }, + selectedItem: controller.selectedCity.value, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'), + ); + }, controller.cites); + }*/ + + Widget changePasswordBottomSheet() { + return Container(color: Colors.red); + /* return BaseBottomSheet( + height: 400.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text( + 'تغییر رمز عبور', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), + ), + SizedBox(), + RTextField( + controller: controller.oldPasswordController, + hintText: 'رمز عبور قبلی', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'رمز عبور را وارد کنید'; + } else if (controller.userProfile.value.data?.password != value) { + return 'رمز عبور صحیح نیست'; + } + return null; + }, + ), + RTextField( + controller: controller.newPasswordController, + hintText: 'رمز عبور جدید', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'رمز عبور را وارد کنید'; + } else if (value.length < 6) { + return 'رمز عبور باید بیش از 6 کارکتر باشد.'; + } + return null; + }, + ), + RTextField( + controller: controller.retryNewPasswordController, + hintText: 'تکرار رمز عبور جدید', + borderColor: AppColor.darkGreyLight, + filledColor: AppColor.bgLight, + filled: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'رمز عبور را وارد کنید'; + } else if (value.length < 6) { + return 'رمز عبور باید بیش از 6 کارکتر باشد.'; + } else if (controller.newPasswordController.text != value) { + return 'رمز عبور جدید یکسان نیست'; + } + return null; + }, + ), + + SizedBox(), + + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + height: 40.h, + text: 'ویرایش', + onPressed: () async { + if (controller.formKey.currentState?.validate() != true) { + return; + } + await controller.updatePassword(); + controller.getUserProfile(); + controller.clearPasswordForm(); + Get.back(); + }, + ), + ROutlinedElevated( + height: 40.h, + text: 'انصراف', + borderColor: AppColor.blueNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + ), + );*/ + } + + Widget exitBottomSheet() { + return Container(color: Colors.red); + /* return BaseBottomSheet( + height: 220.h, + child: SingleChildScrollView( + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text('خروج', style: AppFonts.yekan16Bold.copyWith(color: AppColor.error)), + SizedBox(), + Text( + 'آیا مطمئن هستید که می‌خواهید از حساب کاربری خود خارج شوید؟', + textAlign: TextAlign.center, + style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor), + ), + + SizedBox(), + + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + height: 40.h, + text: 'خروج', + backgroundColor: AppColor.error, + onPressed: () async { + await controller.rootLogic.tokenService.deleteTokens().then((value) { + Get.back(); + Get.offAllNamed(ChickenRoutes.auth, arguments: Module.chicken); + }); + }, + ), + ROutlinedElevated( + height: 40.h, + text: 'انصراف', + borderColor: AppColor.blueNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + ), + );*/ + } +} diff --git a/packages/inspection/lib/presentation/pages/records/logic.dart b/packages/inspection/lib/presentation/pages/records/logic.dart new file mode 100644 index 0000000..a4c1fce --- /dev/null +++ b/packages/inspection/lib/presentation/pages/records/logic.dart @@ -0,0 +1,32 @@ +import 'package:rasadyar_core/core.dart'; + +class RecordsLogic extends GetxController { + Rx>> countList = Resource>.success( + PaginationModel(results: [1, 2, 3, 4, 5, 6], count: 1, next: null, previous: null), + ).obs; + + RxBool isLoadingMore = false.obs; + RxInt currentPage = 1.obs; + RxInt indexExpanded = (-1).obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + void toggleExpandedList(int index) { + if (indexExpanded.value == index) { + indexExpanded.value = -1; + } else { + indexExpanded.value = index; + } + } + +} diff --git a/packages/inspection/lib/presentation/pages/records/view.dart b/packages/inspection/lib/presentation/pages/records/view.dart new file mode 100644 index 0000000..e2b56be --- /dev/null +++ b/packages/inspection/lib/presentation/pages/records/view.dart @@ -0,0 +1,184 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class RecordsPage extends GetView { + const RecordsPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + isPaginating: controller.isLoadingMore.value, + onRefresh: () async { + controller.currentPage.value = 1; + //await controller.getAllocatedMade(); + }, + onLoadMore: () async { + controller.currentPage.value++; + iLog(controller.currentPage.value); + // await controller.getAllocatedMade(true); + }, + padding: EdgeInsets.fromLTRB(8, 12, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.value == index, + onTap: () => controller.toggleExpandedList(index), + index: index, + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.calendarSearchOutlineSvg.path, + labelIconColor: AppColor.bgIcon, + secondChild: itemListExpandedWidget(item, index), + child: itemListWidget(item), + ); + }, controller.indexExpanded); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.countList), + floatingActionButton: RFab.add(onPressed: () {}), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + Widget itemListWidget(int item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 3, + children: [ + Text('داود خرم مهری پور', style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal)), + Text( + '09302545455', + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text('0 کیلوگرم', style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover)), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ); + } + + Widget itemListExpandedWidget(int item, int index) { + return Column( + spacing: 8, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داوود خرم پور', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'تاریخ بازرسی', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '1403/12/12', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + + buildRow( + title: 'تلفن خریدار', + value: '0326598653', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow(title: 'آخرین فعالیت', value: '1409/12/12'), + buildRow(title: 'موجودی', value: '5KG'), + buildRow(title: 'فروش رفته', value: '5KG'), + ], + ), + ), + Visibility( + visible: true, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + + onPressed: () { + /* controller.setEditData(item); + Get.bottomSheet( + addOrEditBottomSheet(true), + isScrollControlled: true, + backgroundColor: Colors.transparent, + ).whenComplete(() { + controller.clearForm(); + });*/ + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.blueDark, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + // controller.isExpandedList.remove(index); + // controller.denyAllocation(item.key ?? ''); + //await controller.deleteAllocation(item); + }, + onRefresh: () async {}, + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ), + ], + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/registration_of_violation/logic.dart b/packages/inspection/lib/presentation/pages/registration_of_violation/logic.dart new file mode 100644 index 0000000..ba48ff1 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/registration_of_violation/logic.dart @@ -0,0 +1,5 @@ +import 'package:rasadyar_core/core.dart'; + +class RegistrationOfViolationLogic extends GetxController { + RxInt countViolation = 1.obs; +} diff --git a/packages/inspection/lib/presentation/pages/registration_of_violation/view.dart b/packages/inspection/lib/presentation/pages/registration_of_violation/view.dart new file mode 100644 index 0000000..371d368 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/registration_of_violation/view.dart @@ -0,0 +1,119 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; + +import 'logic.dart'; + +class RegistrationOfViolationPage extends GetView { + const RegistrationOfViolationPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.bgLight, + appBar: RAppBar( + title: 'ثبت تخلف', + leading: Assets.vec.messageAddSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + additionalActions: [RFab.smallAdd(onPressed: () => controller.countViolation.value++)], + ), + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + child: Column( + children: [ + Expanded( + child: ObxValue((data) { + return ListView.separated( + itemBuilder: (context, index) => violationWidget22(), + separatorBuilder: (context, index) => SizedBox(height: 15), + itemCount: data.value, + ); + }, controller.countViolation), + ), + + Padding( + padding: const EdgeInsets.fromLTRB(0, 4, 0, 25), + child: RElevated( + text: 'مرحله بعد', + onPressed: () { + Get.toNamed(InspectionRoutes.inspectionDisplayInformation); + }, + isFullWidth: true, + height: 40, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ), + ], + ), + ), + ); + } +} + +Container violationWidget22() { + return Container( + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 0.7, color: AppColor.bgDark), + ), + child: Column( + spacing: 16, + children: [ + RTextField( + controller: TextEditingController(), + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + ), + RTextField( + controller: TextEditingController(), + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 3, + minLines: 3, + ), + RTextField( + controller: TextEditingController(), + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + ), + RTextField( + controller: TextEditingController(), + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + ), + RTextField( + controller: TextEditingController(), + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 3, + minLines: 3, + ), + + SizedBox( + height: 40, + child: Row( + spacing: 16, + children: [ + Expanded( + child: RElevated(text: 'ثبت', onPressed: () {}), + ), + Expanded( + child: ROutlinedElevated(text: 'انصراف', onPressed: () {}), + ), + ], + ), + ), + ], + ), + ); +} diff --git a/packages/inspection/lib/presentation/pages/root/logic.dart b/packages/inspection/lib/presentation/pages/root/logic.dart new file mode 100644 index 0000000..f444120 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/root/logic.dart @@ -0,0 +1,102 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; +import 'package:rasadyar_inspection/data/repositories/user/user_repository_imp.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; +import 'package:rasadyar_inspection/presentation/pages/action/view.dart'; +import 'package:rasadyar_inspection/presentation/pages/inspection_map/view.dart'; +import 'package:rasadyar_inspection/presentation/pages/profile/view.dart'; + +enum ErrorLocationType { serviceDisabled, permissionDenied, none } + +class RootLogic extends GetxController { + RxInt currentIndex = 0.obs; + List pages = [InspectionMapPage(), ActionPage(), ProfilePage()]; + RxList errorLocationType = RxList(); + TokenStorageService tokenStorageService = Get.find(); + UserRepositoryImp userRepository = diInspection.get(); + Rxn userProfile = Rxn(); + + @override + void onInit() { + super.onInit(); + userRepository + .fetchUserProfile(token: tokenStorageService.accessToken.value ?? '') + .then((value) => userProfile.value = value); + } + + @override + void onReady() { + super.onReady(); + + locationServiceEnabled().then((value) { + if (!value) { + errorLocationType.add(ErrorLocationType.serviceDisabled); + } + }); + + checkPermission().then((value) { + if (!value) { + errorLocationType.add(ErrorLocationType.permissionDenied); + } + }); + + listenToLocationServiceStatus().listen((event) { + if (!event) { + errorLocationType.add(ErrorLocationType.serviceDisabled); + } else { + errorLocationType.remove(ErrorLocationType.serviceDisabled); + } + }); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + Stream listenToLocationServiceStatus() { + return Geolocator.getServiceStatusStream().map((status) { + return status == ServiceStatus.enabled; + }); + } + + Future locationServiceEnabled() async { + bool serviceEnabled = await Geolocator.isLocationServiceEnabled(); + if (!serviceEnabled) { + return false; + } + return true; + } + + Future checkPermission({bool request = false}) async { + try { + final LocationPermission permission = await Geolocator.checkPermission(); + + switch (permission) { + case LocationPermission.denied: + final LocationPermission requestResult = await Geolocator.requestPermission(); + return requestResult != LocationPermission.denied && + requestResult != LocationPermission.deniedForever; + + case LocationPermission.deniedForever: + return request ? await Geolocator.openAppSettings() : false; + + case LocationPermission.always: + case LocationPermission.whileInUse: + return true; + + default: + return false; + } + } catch (e) { + eLog(e); + return await Geolocator.openLocationSettings(); + } + } + + void changePage(int index) { + currentIndex.value = index; + } +} diff --git a/packages/inspection/lib/presentation/pages/root/view.dart b/packages/inspection/lib/presentation/pages/root/view.dart new file mode 100644 index 0000000..8b4542a --- /dev/null +++ b/packages/inspection/lib/presentation/pages/root/view.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class RootPage extends GetView { + const RootPage({super.key}); + + @override + Widget build(BuildContext context) { + return ObxValue((currentIndex) { + return PopScope( + canPop: false, + child: Scaffold( + backgroundColor: AppColor.bgLight, + body: IndexedStack(index: currentIndex.value, children: controller.pages), + bottomNavigationBar: RBottomNavigation( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + items: [ + RBottomNavigationItem( + label: 'نقشه', + icon: Assets.vec.mapSvg.path, + isSelected: currentIndex.value == 0, + onTap: () { + Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); + controller.changePage(0); + }, + ), + RBottomNavigationItem( + label: 'اقدام', + icon: Assets.vec.settingSvg.path, + isSelected: currentIndex.value == 1, + onTap: () { + Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); + controller.changePage(1); + }, + ), + + RBottomNavigationItem( + label: 'پروفایل', + icon: Assets.vec.profileCircleSvg.path, + isSelected: currentIndex.value == 2, + onTap: () { + Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); + Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); + + controller.changePage(2); + }, + ), + ], + ), + ), + ); + }, controller.currentIndex); + } +} diff --git a/packages/inspection/lib/presentation/pages/statistics/logic.dart b/packages/inspection/lib/presentation/pages/statistics/logic.dart new file mode 100644 index 0000000..256523a --- /dev/null +++ b/packages/inspection/lib/presentation/pages/statistics/logic.dart @@ -0,0 +1,63 @@ +import 'package:rasadyar_core/core.dart'; + +class StatisticsLogic extends GetxController { + List transactionFilters = ['همه', 'دارای تراکنش', 'بدون تراکنش']; + RxList transactionFiltersSelected = RxList(); + RxList iranProvinces = [ + 'آذربایجان شرقی', + 'آذربایجان غربی', + 'اردبیل', + 'اصفهان', + 'البرز', + 'ایلام', + 'بوشهر', + 'تهران', + 'چهارمحال و بختیاری', + 'خراسان جنوبی', + 'خراسان رضوی', + 'خراسان شمالی', + 'خوزستان', + 'زنجان', + 'سمنان', + 'سیستان و بلوچستان', + 'فارس', + 'قزوین', + 'قم', + 'کردستان', + 'کرمان', + 'کرمانشاه', + 'کهگیلویه و بویراحمد', + 'گلستان', + 'گیلان', + 'لرستان', + 'مازندران', + 'مرکزی', + 'هرمزگان', + 'همدان', + 'یزد', + ].obs; + RxnString iranProvincesSelected = RxnString(); + RxInt s1 =2536524448.obs; + RxInt s2 =2536524448.obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + void onTransactionFilterSelected(int index) { + if (transactionFiltersSelected.contains(index)) { + transactionFiltersSelected.remove(index); + } else { + transactionFiltersSelected.add(index); + } + update(); + } +} diff --git a/packages/inspection/lib/presentation/pages/statistics/view.dart b/packages/inspection/lib/presentation/pages/statistics/view.dart new file mode 100644 index 0000000..4d05d6e --- /dev/null +++ b/packages/inspection/lib/presentation/pages/statistics/view.dart @@ -0,0 +1,368 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart'; + +import 'logic.dart'; + +class StatisticsPage extends GetView { + const StatisticsPage({super.key}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 10, + children: [ + Expanded( + child: Container( + height: 32.h, + decoration: BoxDecoration( + border: Border.all(color: AppColor.blueNormal, width: 1), + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 4.h), + child: Row( + children: [ + Assets.vec.calendarSvg.svg( + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + SizedBox(width: 4.w), + Text('از', style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal)), + SizedBox(width: 22.w), + + Text( + '1404/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive), + ), + ], + ), + ), + ), + Expanded( + child: Container( + height: 32.h, + decoration: BoxDecoration( + border: Border.all(color: AppColor.blueNormal, width: 1), + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 4.h), + child: Row( + children: [ + Assets.vec.calendarSvg.svg( + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + SizedBox(width: 4.w), + Text('تا', style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal)), + SizedBox(width: 22.w), + + Text( + '1404/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive), + ), + ], + ), + ), + ), + ], + ), + ), + + SizedBox(height: 16.h), + + Container( + height: 80.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.lightGreyNormalHover, width: 1), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 8, + children: [ + Row( + children: [ + Text( + 'فیلتر تراکنش ها', + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + Expanded( + child: ListView.separated( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) => ObxValue((selectedIndex) { + return customChip( + title: controller.transactionFilters[index], + isSelected: selectedIndex.contains(index), + index: index, + onTap: (data) => controller.onTransactionFilterSelected(data), + ); + }, controller.transactionFiltersSelected), + separatorBuilder: (context, index) => SizedBox(width: 8), + itemCount: controller.transactionFilters.length, + ), + ), + ], + ), + ), + ), + SizedBox(height: 8.h), + Container( + height: 80.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.lightGreyNormalHover, width: 1), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 8, + children: [ + Row( + children: [ + Text( + 'فیلتر شهرستان', + textAlign: TextAlign.right, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + Expanded(child: _provinceDropdownWidget()), + ], + ), + ), + ), + SizedBox(height: 8.h), + Container( + + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.lightGreyNormalHover, width: 1), + ), + padding: EdgeInsets.all(8), + child: Column( + spacing: 8, + children: [ + Row( + spacing: 8, + children: [ + Expanded( + child: ObxValue( + (data) => _informationLabelCard( + title: 'تعداد تراکنش ها', + titleColor: AppColor.blueNormal, + isLoading: data.value == null, + description: 25369654.separatedByComma, + iconPath: Assets.vec.cubeScanSvg.path, + bgDescriptionColor: Colors.white, + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [AppColor.blueLight, Colors.white], + ), + ), + controller.s1, + ), + ), + + Expanded( + child: ObxValue((data) { + return _informationLabelCard( + title: 'جمع تراکنش ها', + isLoading: data.value == null, + description: data.value.separatedByComma ?? '0', + unit: 'ريال', + iconPath: Assets.vec.cubeCardSvg.path, + bgDescriptionColor: Colors.white, + titleColor: AppColor.greenDarkHover, + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [AppColor.greenLightHover, Colors.white], + ), + ); + }, controller.s2), + ), + ], + ), + Row( + spacing: 16, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + RElevated( + width: 160.w, + height: 40.h, + backgroundColor: AppColor.greenNormal, + onPressed: () {}, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Assets.vec.excelDownloadSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + SizedBox(width: 4.w), + Text('EXCEL', style: AppFonts.yekan14.copyWith(color: Colors.white)), + ], + ), + ), + ROutlinedElevated( + width: 160.w, + height: 40.h, + borderColor: AppColor.error, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Assets.vec.pdfDownloadSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: const ColorFilter.mode(AppColor.error, BlendMode.srcIn), + ), + SizedBox(width: 4.w), + Text('PDF', style: AppFonts.yekan14.copyWith(color: AppColor.error)), + ], + ), + ), + ], + ), + ], + ), + ), + SizedBox(height: 8.h), + ], + ), + ); + } + + Widget _provinceDropdownWidget() { + return ObxValue((data) { + return OverlayDropdownWidget( + items: data, + onChanged: (value) { + controller.iranProvincesSelected.value = value; + controller.iranProvincesSelected.refresh(); + }, + selectedItem: controller.iranProvincesSelected.value, + itemBuilder: (item) => Text( + item ?? 'بدون نام', + style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker), + ), + labelBuilder: (item) => + Text('انتخاب استان', style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight)), + ); + }, controller.iranProvinces); + } + + Container _informationLabelCard({ + required String title, + required String description, + required String iconPath, + required Color bgDescriptionColor, + String? unit, + bool isLoading = false, + Color? iconColor, + Color? titleColor, + Color? bgLabelColor, + LinearGradient? gradient, + }) { + return Container( + height: 82.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.lightGreyNormalHover, width: 1), + ), + clipBehavior: Clip.hardEdge, + child: Row( + children: [ + // Left side with icon and title + Expanded( + flex: 91, + child: Container( + height: 82.h, + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: gradient == null ? bgLabelColor : null, + borderRadius: BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + gradient: gradient, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + SvgGenImage.vec(iconPath).svg( + width: 24, + height: 24, + colorFilter: iconColor != null + ? ColorFilter.mode(iconColor, BlendMode.srcIn) + : null, + ), + Text( + title, + textAlign: TextAlign.right, + style: AppFonts.yekan10.copyWith( + color: titleColor ?? AppColor.mediumGreyDarkActive, + ), + ), + ], + ), + ), + ), + // Right side with description and unit + Expanded( + flex: 109, + child: Container( + decoration: BoxDecoration( + color: bgDescriptionColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + ), + ), + child: isLoading + ? Center(child: CupertinoActivityIndicator()) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 4, + children: [ + Text( + description, + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive), + ), + Visibility( + visible: unit != null, + child: Text( + unit ?? '', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive), + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/packages/inspection/lib/presentation/pages/users/logic.dart b/packages/inspection/lib/presentation/pages/users/logic.dart new file mode 100644 index 0000000..d7490ba --- /dev/null +++ b/packages/inspection/lib/presentation/pages/users/logic.dart @@ -0,0 +1,33 @@ +import 'package:rasadyar_core/core.dart'; + +class UsersLogic extends GetxController { + Rx>> countList = Resource>.success( + PaginationModel(results: [1, 2, 3, 4, 5, 6], count: 1, next: null, previous: null), + ).obs; + + RxBool isLoadingMore = false.obs; + RxInt currentPage = 1.obs; + RxInt indexExpanded = (-1).obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + + + void toggleExpandedList(int index) { + if (indexExpanded.value == index) { + indexExpanded.value = -1; + } else { + indexExpanded.value = index; + } + } +} diff --git a/packages/inspection/lib/presentation/pages/users/view.dart b/packages/inspection/lib/presentation/pages/users/view.dart new file mode 100644 index 0000000..ddf1285 --- /dev/null +++ b/packages/inspection/lib/presentation/pages/users/view.dart @@ -0,0 +1,190 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class UsersPage extends GetView { + const UsersPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + isPaginating: controller.isLoadingMore.value, + onRefresh: () async { + controller.currentPage.value = 1; + //await controller.getAllocatedMade(); + }, + onLoadMore: () async { + controller.currentPage.value++; + iLog(controller.currentPage.value); + // await controller.getAllocatedMade(true); + }, + padding: EdgeInsets.fromLTRB(8, 12, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.value == index, + onTap: () => controller.toggleExpandedList(index), + index: index, + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.profile2OutlineSvg.path, + labelIconColor: AppColor.bgIcon, + secondChild: itemListExpandedWidget(item, index), + child: itemListWidget(item), + ); + }, controller.indexExpanded); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + ); + }, controller.countList), + floatingActionButton: RFab.add(onPressed: () {}), + floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, + ); + } + + Widget itemListWidget(int item) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 3, + children: [ + Text( + 'داود خرم مهری پور', + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + Text( + '09302545455', + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('باقی مانده', style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)), + Text( + '0 کیلوگرم', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ); + } + + Widget itemListExpandedWidget(int item, int index) { + return Column( + spacing: 8, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داوود خرم پور', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'تاریخ بازرسی', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + '1403/12/12', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + + buildRow( + title: 'تلفن خریدار', + value: '0326598653', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow(title: 'آخرین فعالیت', value: '1409/12/12'), + buildRow(title: 'موجودی', value: '5KG'), + buildRow(title: 'فروش رفته', value: '5KG'), + ], + ), + ), + Visibility( + visible:true, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 16.w, + children: [ + RElevated( + text: 'ویرایش', + width: 150.w, + height: 40.h, + + onPressed: () { + /* controller.setEditData(item); + Get.bottomSheet( + addOrEditBottomSheet(true), + isScrollControlled: true, + backgroundColor: Colors.transparent, + ).whenComplete(() { + controller.clearForm(); + });*/ + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.blueDark, + ), + ROutlinedElevated( + text: 'حذف', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + width: 150.w, + height: 40.h, + onPressed: () { + buildDeleteDialog( + onConfirm: () async { + // controller.isExpandedList.remove(index); + // controller.denyAllocation(item.key ?? ''); + //await controller.deleteAllocation(item); + }, + onRefresh: () async{} + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ), + ], + ); + } +} diff --git a/packages/inspection/lib/presentation/routes/app_pages.dart b/packages/inspection/lib/presentation/routes/app_pages.dart new file mode 100644 index 0000000..e6cc067 --- /dev/null +++ b/packages/inspection/lib/presentation/routes/app_pages.dart @@ -0,0 +1,78 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/pages/auth/logic.dart'; +import 'package:rasadyar_inspection/presentation/pages/auth/view.dart'; +import 'package:rasadyar_inspection/presentation/pages/filter/logic.dart'; +import 'package:rasadyar_inspection/presentation/pages/inspection_map/widget/map/logic.dart'; +import 'package:rasadyar_inspection/presentation/pages/pages.dart'; +import 'package:rasadyar_inspection/presentation/pages/users/logic.dart'; +import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart'; +import 'package:rasadyar_inspection/presentation/widget/captcha/logic.dart'; + +sealed class InspectionPages { + InspectionPages._(); + + static final pages = [ + + GetPage( + name: InspectionRoutes.auth, + page: () => AuthPage(), + binding: BindingsBuilder(() { + Get.lazyPut(() => AuthLogic()); + Get.lazyPut(() => CaptchaWidgetLogic()); + }), + ), + GetPage( + name: InspectionRoutes.init, + page: () => RootPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => RootLogic()); + Get.lazyPut(() => InspectorFilterLogic()); + Get.lazyPut(() => InspectionMapLogic()); + Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => UsersLogic()); + Get.lazyPut(() => RecordsLogic()); + Get.lazyPut(() => StatisticsLogic()); + Get.lazyPut(() => LocationDetailsLogic(), fenix: true); + Get.lazyPut(() => ActionLogic()); + Get.lazyPut(() => ProfileLogic()); + Get.lazyPut(() => MapLogic()); + }), + ), + + GetPage( + name: InspectionRoutes.inspectionLocationDetails, + page: () => LocationDetailsPage(), + bindings: [BindingsBuilder.put(() => LocationDetailsLogic())], + ), + + GetPage( + name: InspectionRoutes.inspectionAddSupervision, + page: () => AddSupervisionPage(), + binding: BindingsBuilder.put(() => AddSupervisionLogic()), + ), + GetPage( + name: InspectionRoutes.inspectionRegistrationOfViolation, + page: () => RegistrationOfViolationPage(), + binding: BindingsBuilder.put(() => RegistrationOfViolationLogic()), + ), + + GetPage( + name: InspectionRoutes.inspectionDisplayInformation, + page: () => DisplayInformationPage(), + binding: BindingsBuilder.put(() => DisplayInformationLogic()), + ), + GetPage( + name: InspectionRoutes.inspectionUserProfile, + page: () => ProfilePage(), + binding: BindingsBuilder.put(() => ProfileLogic()), + ), + GetPage( + name: InspectionRoutes.inspectionAddMobileInspector, + page: () => AddMobileInspectorPage(), + binding: BindingsBuilder.put(() => AddMobileInspectorLogic()), + ), + + ]; +} diff --git a/packages/inspection/lib/presentation/routes/app_routes.dart b/packages/inspection/lib/presentation/routes/app_routes.dart new file mode 100644 index 0000000..72c0c48 --- /dev/null +++ b/packages/inspection/lib/presentation/routes/app_routes.dart @@ -0,0 +1,14 @@ +sealed class InspectionRoutes { + InspectionRoutes._(); + + static const init = '/supervision'; + static const auth = '/AuthSupervision'; + static const inspectionUserProfile = '$init/userSettings'; + static const inspectionLocationDetails = '$init/locationDetails'; + static const inspectionAddSupervision = '$inspectionLocationDetails/addSupervision'; + static const inspectionAddMobileInspector = '$inspectionLocationDetails/addMobileInspector'; + static const inspectionRegistrationOfViolation = + '$inspectionAddSupervision/RegistrationOfViolation'; + static const inspectionDisplayInformation = + '$inspectionRegistrationOfViolation/DisplayInformation'; +} diff --git a/packages/inspection/lib/presentation/widget/app_bar/i_app_bar.dart b/packages/inspection/lib/presentation/widget/app_bar/i_app_bar.dart new file mode 100644 index 0000000..d49c50d --- /dev/null +++ b/packages/inspection/lib/presentation/widget/app_bar/i_app_bar.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart'; + +RAppBar inspectionAppBar({ + bool hasBack = true, + bool hasFilter = true, + bool hasSearch = true, + bool isBase = false, + VoidCallback? onBackPressed, + GestureTapCallback? onFilterTap, + GestureTapCallback? onSearchTap, +}) { + return RAppBar( + hasBack: isBase == true ? false : hasBack, + onBackPressed: onBackPressed, + leadingWidth: 155, + leading: Row( + mainAxisSize: MainAxisSize.min, + spacing: 6, + children: [ + Text('رصدبان', style: AppFonts.yekan16Bold.copyWith(color: Colors.white)), + Assets.vec.appBarInspectionSvg.svg(width: 24, height: 24), + ], + ), + additionalActions: [ + if (!isBase && hasSearch) searchWidget(onSearchTap), + SizedBox(width: 8), + if (!isBase && hasFilter) filterWidget(onFilterTap), + SizedBox(width: 8), + ], + ); +} + +GestureDetector filterWidget(GestureTapCallback? onFilterTap) { + return GestureDetector( + onTap: onFilterTap, + child: Stack( + alignment: Alignment.topRight, + children: [ + Assets.vec.filterOutlineSvg.svg( + width: 20, + height: 20, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Obx(() { + final controller = Get.find(); + return Visibility( + visible: controller.isFilterSelected.value, + child: Container( + width: 8, + height: 8, + decoration: const BoxDecoration(color: Colors.red, shape: BoxShape.circle), + ), + ); + }), + ], + ), + ); +} + +GestureDetector searchWidget(GestureTapCallback? onSearchTap) { + return GestureDetector( + onTap: onSearchTap, + child: Stack( + alignment: Alignment.topRight, + children: [ + Assets.vec.searchSvg.svg( + width: 24, + height: 24, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Obx(() { + final controller = Get.find(); + return Visibility( + visible: controller.searchValue.value != null, + child: Container( + width: 8, + height: 8, + decoration: const BoxDecoration(color: Colors.red, shape: BoxShape.circle), + ), + ); + }), + ], + ), + ); +} diff --git a/packages/inspection/lib/presentation/widget/base_page/logic.dart b/packages/inspection/lib/presentation/widget/base_page/logic.dart new file mode 100644 index 0000000..79ac095 --- /dev/null +++ b/packages/inspection/lib/presentation/widget/base_page/logic.dart @@ -0,0 +1,25 @@ +import 'package:flutter/cupertino.dart'; +import 'package:rasadyar_core/core.dart'; + +class BaseLogic extends GetxController { + final RxBool isFilterSelected = false.obs; + final RxBool isSearchSelected = false.obs; + final TextEditingController searchTextController = TextEditingController(); + final RxnString searchValue = RxnString(); + + void setSearchCallback(void Function(String)? onSearchChanged) { + debounce(searchValue, (val) { + if (val != null && val.trim().isNotEmpty) { + onSearchChanged?.call(val); + } + }, time: const Duration(milliseconds: 600)); + } + + void toggleFilter() { + isFilterSelected.value = !isFilterSelected.value; + } + + void toggleSearch() { + isSearchSelected.value = !isSearchSelected.value; + } +} diff --git a/packages/inspection/lib/presentation/widget/base_page/view.dart b/packages/inspection/lib/presentation/widget/base_page/view.dart new file mode 100644 index 0000000..278cb89 --- /dev/null +++ b/packages/inspection/lib/presentation/widget/base_page/view.dart @@ -0,0 +1,146 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/widget/app_bar/i_app_bar.dart'; +import 'package:rasadyar_inspection/presentation/widget/search.dart'; + +import 'logic.dart'; + +class BasePage extends StatefulWidget { + const BasePage({ + super.key, + this.routes, + required this.widgets, + this.routesWidget, + this.floatingActionButtonLocation, + this.floatingActionButton, + this.onSearchChanged, + this.hasBack = true, + this.hasFilter = true, + this.hasSearch = true, + this.isBase = false, + this.defaultSearch = true, + this.onBackPressed, + this.onFilterTap, + this.onSearchTap, + this.filteringWidget, + + }); + + final List? routes; + final Widget? routesWidget; + final bool defaultSearch; + final List widgets; + final FloatingActionButtonLocation? floatingActionButtonLocation; + final Widget? floatingActionButton; + final Widget? filteringWidget; + final void Function(String?)? onSearchChanged; + final bool hasBack; + final bool hasFilter; + final bool hasSearch; + final bool isBase; + final VoidCallback? onBackPressed; + final GestureTapCallback? onFilterTap; + final GestureTapCallback? onSearchTap; + + @override + State createState() => _BasePageState(); +} + +class _BasePageState extends State { + BaseLogic get controller => Get.find(); + Worker? filterWorker; + bool _isBottomSheetOpen = false; + + @override + void initState() { + super.initState(); + /* filterWorker = ever(controller.isFilterSelected, (bool isSelected) { + if (!mounted) return; + + if (isSelected && widget.filteringWidget != null) { + // بررسی اینکه آیا bottomSheet از قبل باز است یا نه + if (_isBottomSheetOpen) { + controller.isFilterSelected.value = false; + return; + } + + // بررسی اینکه آیا route فعلی current است یا نه + if (ModalRoute.of(context)?.isCurrent != true) { + controller.isFilterSelected.value = false; + return; + } + + _isBottomSheetOpen = true; + Get.bottomSheet( + widget.filteringWidget!, + isScrollControlled: true, + isDismissible: true, + enableDrag: true, + ).then((_) { + // تنظیم مقدار به false بعد از بسته شدن bottomSheet + if (mounted) { + _isBottomSheetOpen = false; + controller.isFilterSelected.value = false; + } + }); + } + });*/ + } + + @override + void dispose() { + filterWorker?.dispose(); + super.dispose(); + } + + void _onFilterTap() { + if (widget.hasFilter && widget.filteringWidget != null) { + + final currentRoute = ModalRoute.of(context); + if (currentRoute?.isCurrent != true) { + return; + } + + + Get.bottomSheet( + widget.filteringWidget!, + isScrollControlled: true, + isDismissible: true, + enableDrag: true, + ); + } + } + + @override + Widget build(BuildContext context) { + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) => widget.onBackPressed, + child: Scaffold( + backgroundColor: AppColor.bgLight, + appBar: inspectionAppBar( + hasBack: widget.isBase ? false : widget.hasBack, + onBackPressed: widget.onBackPressed, + hasFilter: widget.hasFilter, + hasSearch: widget.hasSearch, + isBase: widget.isBase, + onFilterTap: widget.hasFilter ? _onFilterTap : null, + onSearchTap: widget.hasSearch ? () => controller.toggleSearch() : null, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //widget.routesWidget != null ? widget.routesWidget! : buildPageRoute(widget.routes!), + if (!widget.isBase && widget.hasSearch && widget.defaultSearch) ...{ + SearchWidget(onSearchChanged: widget.onSearchChanged), + }, + ...widget.widgets, + ], + ), + floatingActionButtonLocation: + widget.floatingActionButtonLocation ?? FloatingActionButtonLocation.startFloat, + floatingActionButton: widget.floatingActionButton, + ), + ); + } +} diff --git a/packages/inspection/lib/presentation/widget/captcha/logic.dart b/packages/inspection/lib/presentation/widget/captcha/logic.dart new file mode 100644 index 0000000..04823a8 --- /dev/null +++ b/packages/inspection/lib/presentation/widget/captcha/logic.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; +import 'package:rasadyar_inspection/data/repositories/auth/auth_repository_imp.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; + +class CaptchaWidgetLogic extends GetxController with StateMixin { + TextEditingController textController = TextEditingController(); + RxnString captchaKey = RxnString(); + GlobalKey formKey = GlobalKey(); + AuthRepositoryImpl authRepository = diInspection.get(); + + @override + void onInit() { + super.onInit(); + + getCaptcha(); + } + + @override + void onClose() { + textController.clear(); + textController.dispose(); + super.onClose(); + } + + Future getCaptcha() async { + change(null, status: RxStatus.loading()); + textController.clear(); + formKey.currentState?.reset(); + await Future.delayed(Duration(milliseconds: 200)); + await safeCall( + call: () async => authRepository.captcha(), + onSuccess: (result) { + if (result == null) { + change(null, status: RxStatus.error('Failed to load captcha')); + return; + } + captchaKey.value = result.captchaKey; + change(result, status: RxStatus.success()); + }, + onError: (error, stackTrace) {}, + ); + + change(value, status: RxStatus.success()); + } +} diff --git a/packages/inspection/lib/presentation/widget/captcha/view.dart b/packages/inspection/lib/presentation/widget/captcha/view.dart new file mode 100644 index 0000000..d66d57a --- /dev/null +++ b/packages/inspection/lib/presentation/widget/captcha/view.dart @@ -0,0 +1,112 @@ +import 'dart:convert'; +import 'dart:math'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/pages/auth/logic.dart'; + + +import 'logic.dart'; + +class CaptchaWidget extends GetView { + const CaptchaWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: controller.getCaptcha, + child: Container( + width: 135, + height: 50, + clipBehavior: Clip.antiAliasWithSaveLayer, + decoration: BoxDecoration( + color: AppColor.whiteNormalHover, + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(8), + ), + child: controller.obx( + (state) => + Image.memory(base64Decode(state?.captchaImage ?? ''), fit: BoxFit.cover), + onLoading: const Center( + child: CupertinoActivityIndicator(color: AppColor.blueNormal), + ), + onError: (error) { + return Center( + child: Text('خطا ', style: AppFonts.yekan13.copyWith(color: Colors.red)), + ); + }, + ), + ), + ), + + const SizedBox(width: 8), + Expanded( + child: Form( + key: controller.formKey, + autovalidateMode: AutovalidateMode.disabled, + child: RTextField( + label: 'کد امنیتی', + controller: controller.textController, + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide(color: AppColor.textColor, width: 1), + ), + keyboardType: TextInputType.numberWithOptions(decimal: false, signed: false), + maxLines: 1, + maxLength: 6, + suffixIcon: (controller.textController.text + .trim() + .isNotEmpty ?? false) + ? clearButton(() => controller.textController.clear()) + : null, + + validator: (value) { + if (value == null || value.isEmpty) { + return 'کد امنیتی را وارد کنید'; + } + return null; + }, + onChanged: (pass) { + if (pass.length == 6) { + if (controller.formKey.currentState?.validate() ?? false) { + Get + .find() + .isDisabled + .value = false; + } + } + }, + style: AppFonts.yekan13, + ), + ), + ), + ], + ); + } +} + +class _CaptchaLinePainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + final random = Random(); + final paint1 = Paint() + ..color = Colors.deepOrange + ..strokeWidth = 2; + final paint2 = Paint() + ..color = Colors.blue + ..strokeWidth = 2; + + // First line: top-left to bottom-right + canvas.drawLine(Offset(0, 0), Offset(size.width, size.height), paint1); + + // Second line: bottom-left to top-right + canvas.drawLine(Offset(0, size.height), Offset(size.width, 0), paint2); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} diff --git a/packages/inspection/lib/presentation/widget/cluster_marker.dart b/packages/inspection/lib/presentation/widget/cluster_marker.dart new file mode 100644 index 0000000..4c8d82a --- /dev/null +++ b/packages/inspection/lib/presentation/widget/cluster_marker.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; + +class AnimatedClusterMarker extends StatefulWidget { + final int count; + + const AnimatedClusterMarker({super.key, required this.count}); + + @override + State createState() => _AnimatedClusterMarkerState(); +} + +class _AnimatedClusterMarkerState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; + + @override + void initState() { + super.initState(); + + _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 300), + )..forward(); // start animation + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ScaleTransition( + scale: CurvedAnimation(parent: _controller, curve: Curves.easeOutBack), + child: Opacity( + opacity: _controller.value, + child: Container( + width: 40, + height: 40, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.blueAccent, + shape: BoxShape.circle, + border: Border.all(color: Colors.white, width: 2), + ), + child: Text( + widget.count.toString(), + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ); + } +} diff --git a/packages/inspection/lib/presentation/widget/custom_chips.dart b/packages/inspection/lib/presentation/widget/custom_chips.dart new file mode 100644 index 0000000..07e4a4b --- /dev/null +++ b/packages/inspection/lib/presentation/widget/custom_chips.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +Widget customChip({ + bool isSelected = false, + required String title, + required int index, + required Function(int) onTap, +}) { + return GestureDetector( + onTap: () { + onTap.call(index); + }, + child: Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 8.h), + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + color: AppColor.whiteGreyNormal, + borderRadius: BorderRadius.circular(8), + border: Border.all( + width: 1, + color: isSelected ? AppColor.blueNormal : AppColor.blackLightActive, + ), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + + children: [ + SizedBox( + width: 12.w, + height: 12.h, + child: Transform.scale( + scale: 0.70, + child: Checkbox( + value: isSelected, + side: BorderSide(color: AppColor.whiteDarkHover, width: 1), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity.compact, + overlayColor: WidgetStateProperty.all(AppColor.blueNormal), + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { + return AppColor.blueNormal; + } else { + return AppColor.whiteGreyNormal; + } + }), + + onChanged: (value) { + onTap.call(index); + }, + ), + ), + ), + SizedBox(width: 8.w), + Text( + title, + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: isSelected ? AppColor.blueNormal : AppColor.whiteDarkHover, + ), + ), + ], + ), + ), + ); +} diff --git a/packages/inspection/lib/presentation/widget/search.dart b/packages/inspection/lib/presentation/widget/search.dart new file mode 100644 index 0000000..9c72439 --- /dev/null +++ b/packages/inspection/lib/presentation/widget/search.dart @@ -0,0 +1,81 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart'; + + +class SearchWidget extends StatefulWidget { + const SearchWidget({super.key, this.onSearchChanged}); + + final void Function(String?)? onSearchChanged; + + @override + State createState() => _SearchWidgetState(); +} + +class _SearchWidgetState extends State { + late final BaseLogic controller; + final TextEditingController textEditingController = TextEditingController(); + + @override + void initState() { + super.initState(); + controller = Get.find(); + controller.setSearchCallback(widget.onSearchChanged); + } + + @override + Widget build(BuildContext context) { + return ObxValue((data) { + return AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + height: data.value ? 40 : 0, + child: Visibility( + visible: data.value, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: RTextField( + height: 40, + borderColor: AppColor.blackLight, + suffixIcon: ObxValue( + (data) => Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: (data.value == null) + ? Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ) + : IconButton( + onPressed: () { + textEditingController.clear(); + controller.searchValue.value = null; + controller.isSearchSelected.value = false; + widget.onSearchChanged?.call(null); + }, + enableFeedback: true, + padding: EdgeInsets.zero, + iconSize: 24, + splashRadius: 50, + icon: Assets.vec.closeCircleSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + ), + controller.searchValue, + ), + hintText: 'جستجو کنید ...', + hintStyle: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), + filledColor: Colors.white, + filled: true, + controller: textEditingController, + onChanged: (val) => controller.searchValue.value = val, + ), + ), + ), + ); + }, controller.isSearchSelected); + } +} diff --git a/packages/inspection/pubspec.lock b/packages/inspection/pubspec.lock new file mode 100644 index 0000000..dda8513 --- /dev/null +++ b/packages/inspection/pubspec.lock @@ -0,0 +1,1606 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + android_intent_plus: + dependency: transitive + description: + name: android_intent_plus + sha256: dfc1fd3a577205ae8f11e990fb4ece8c90cceabbee56fcf48e463ecf0bd6aae3 + url: "https://pub.dev" + source: hosted + version: "5.3.0" + animated_stack_widget: + dependency: transitive + description: + name: animated_stack_widget + sha256: ce4788dd158768c9d4388354b6fb72600b78e041a37afc4c279c63ecafcb9408 + url: "https://pub.dev" + source: hosted + version: "0.0.4" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" + url: "https://pub.dev" + source: hosted + version: "1.6.5" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d + url: "https://pub.dev" + source: hosted + version: "2.6.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 + url: "https://pub.dev" + source: hosted + version: "9.2.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62" + url: "https://pub.dev" + source: hosted + version: "8.11.0" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + color: + dependency: transitive + description: + name: color + sha256: ddcdf1b3badd7008233f5acffaf20ca9f5dc2cd0172b75f68f24526a5f5725cb + url: "https://pub.dev" + source: hosted + version: "3.0.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.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" + cupertino_icons: + dependency: transitive + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_earcut: + dependency: transitive + description: + name: dart_earcut + sha256: e485001bfc05dcbc437d7bfb666316182e3522d4c3f9668048e004d0eb2ce43b + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + dartx: + dependency: transitive + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + device_info_plus: + dependency: transitive + description: + name: device_info_plus + sha256: "98f28b42168cc509abc92f88518882fd58061ea372d7999aecc424345c7bff6a" + url: "https://pub.dev" + source: hosted + version: "11.5.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f + url: "https://pub.dev" + source: hosted + version: "7.0.3" + dio: + dependency: transitive + description: + name: dio + sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" + url: "https://pub.dev" + source: hosted + version: "5.8.0+1" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + encrypt: + dependency: transitive + description: + name: encrypt + sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "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_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: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" + url: "https://pub.dev" + source: hosted + version: "0.9.4+3" + 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" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_gen_core: + dependency: transitive + description: + name: flutter_gen_core + sha256: eda54fdc5de08e7eeea663eb8442aafc8660b5a13fda4e0c9e572c64e50195fb + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_gen_runner: + dependency: transitive + description: + name: flutter_gen_runner + sha256: "669bf8b7a9b4acbdcb7fcc5e12bf638aca19acedf43341714cbca3bf3a219521" + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_map: + dependency: transitive + description: + name: flutter_map + sha256: "2ecb34619a4be19df6f40c2f8dce1591675b4eff7a6857bd8f533706977385da" + url: "https://pub.dev" + source: hosted + version: "7.0.2" + flutter_map_animations: + dependency: transitive + description: + name: flutter_map_animations + sha256: "08233f89919049a3601e785d32e9d1d9e1faac6578190150f1d7495fc1050d36" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + flutter_map_marker_cluster: + dependency: transitive + description: + name: flutter_map_marker_cluster + sha256: "2c1fb4d7a2105c4bbeb89be215320507f4b71b2036df4341fab9d2aa677d3ae9" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + flutter_map_marker_popup: + dependency: transitive + description: + name: flutter_map_marker_popup + sha256: a7540538114b5d1627ab67b498273d66bc36090385412ae49ef215af4a2861c5 + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e + url: "https://pub.dev" + source: hosted + version: "2.0.28" + flutter_rating_bar: + dependency: transitive + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + flutter_screenutil: + dependency: transitive + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.dev" + source: hosted + version: "5.9.3" + flutter_secure_storage: + dependency: transitive + description: + name: flutter_secure_storage + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + flutter_slidable: + dependency: transitive + description: + name: flutter_slidable + sha256: ab7dbb16f783307c9d7762ede2593ce32c220ba2ba0fd540a3db8e9a3acba71a + url: "https://pub.dev" + source: hosted + version: "4.0.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + 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" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c + url: "https://pub.dev" + source: hosted + version: "3.2.0" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + geoclue: + dependency: transitive + description: + name: geoclue + sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f + url: "https://pub.dev" + source: hosted + version: "0.1.1" + geolocator: + dependency: transitive + description: + name: geolocator + sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516" + url: "https://pub.dev" + source: hosted + version: "14.0.2" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 + url: "https://pub.dev" + source: hosted + version: "2.3.13" + geolocator_linux: + dependency: transitive + description: + name: geolocator_linux + sha256: c4e966f0a7a87e70049eac7a2617f9e16fd4c585a26e4330bdfc3a71e6a721f3 + url: "https://pub.dev" + source: hosted + version: "0.2.3" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" + url: "https://pub.dev" + source: hosted + version: "4.2.6" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172 + url: "https://pub.dev" + source: hosted + version: "4.1.3" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" + url: "https://pub.dev" + source: hosted + version: "0.2.5" + get: + dependency: transitive + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.dev" + source: hosted + version: "4.7.2" + get_it: + dependency: transitive + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" + get_test: + dependency: "direct dev" + description: + name: get_test + sha256: "558c39cb35fb37bd501f337dc143de60a4314d5ef3b75f4b0551d6741634995b" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + gsettings: + dependency: transitive + description: + name: gsettings + sha256: "1b0ce661f5436d2db1e51f3c4295a49849f03d304003a7ba177d01e3a858249c" + url: "https://pub.dev" + source: hosted + version: "0.2.8" + hashcodes: + dependency: transitive + description: + name: hashcodes + sha256: "80f9410a5b3c8e110c4b7604546034749259f5d6dcca63e0d3c17c9258f1a651" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + hive_ce: + dependency: transitive + description: + name: hive_ce + sha256: "708bb39050998707c5d422752159f91944d3c81ab42d80e1bd0ee37d8e130658" + url: "https://pub.dev" + source: hosted + version: "2.11.3" + hive_ce_flutter: + dependency: transitive + description: + name: hive_ce_flutter + sha256: a0989670652eab097b47544f1e5a4456e861b1b01b050098ea0b80a5fabe9909 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + hive_ce_generator: + dependency: "direct dev" + description: + name: hive_ce_generator + sha256: a169feeff2da9cc2c417ce5ae9bcebf7c8a95d7a700492b276909016ad70a786 + url: "https://pub.dev" + source: hosted + version: "1.9.3" + http: + dependency: transitive + description: + name: http + sha256: "85ab0074f9bf2b24625906d8382bbec84d3d6919d285ba9c106b07b65791fb99" + url: "https://pub.dev" + source: hosted + version: "1.5.0-beta.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + image_picker: + dependency: transitive + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "6fae381e6af2bbe0365a5e4ce1db3959462fa0c4d234facf070746024bb80c8d" + url: "https://pub.dev" + source: hosted + version: "0.8.12+24" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + 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" + image_size_getter: + dependency: transitive + description: + name: image_size_getter + sha256: "9a299e3af2ebbcfd1baf21456c3c884037ff524316c97d8e56035ea8fdf35653" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + isolate_channel: + dependency: transitive + description: + name: isolate_channel + sha256: f3d36f783b301e6b312c3450eeb2656b0e7d1db81331af2a151d9083a3f6b18d + url: "https://pub.dev" + source: hosted + version: "0.2.2+1" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: ce2cf974ccdee13be2a510832d7fba0b94b364e0b0395dee42abaa51b855be27 + url: "https://pub.dev" + source: hosted + version: "6.10.0" + latlong2: + dependency: transitive + description: + name: latlong2 + sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" + url: "https://pub.dev" + source: hosted + version: "0.9.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + url: "https://pub.dev" + source: hosted + version: "10.0.9" + 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" + lints: + dependency: "direct dev" + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + logger: + dependency: transitive + description: + name: logger + sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lottie: + dependency: transitive + description: + name: lottie + sha256: c5fa04a80a620066c15cf19cc44773e19e9b38e989ff23ea32e5903ef1015950 + url: "https://pub.dev" + source: hosted + version: "3.3.1" + 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" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: transitive + description: + name: mockito + sha256: "2314cbe9165bcd16106513df9cf3c3224713087f09723b128928dc11a4379f99" + url: "https://pub.dev" + source: hosted + version: "5.5.0" + mocktail: + dependency: "direct dev" + description: + name: mocktail + sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" + url: "https://pub.dev" + source: hosted + version: "8.3.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + 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: transitive + 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: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 + url: "https://pub.dev" + source: hosted + version: "2.2.17" + 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" + permission_handler: + dependency: transitive + description: + name: permission_handler + sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1 + url: "https://pub.dev" + source: hosted + version: "12.0.1" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6" + url: "https://pub.dev" + source: hosted + version: "13.0.1" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023 + url: "https://pub.dev" + source: hosted + version: "9.4.7" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.dev" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 + url: "https://pub.dev" + source: hosted + version: "4.3.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + persian_datetime_picker: + dependency: transitive + description: + name: persian_datetime_picker + sha256: "7ccbfd3a68dc89d405550f624e9fa590c914fed2aa2d48973c4f4400baab2e06" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.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" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.dev" + source: hosted + version: "3.9.1" + polylabel: + dependency: transitive + description: + name: polylabel + sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.dev" + source: hosted + version: "6.0.3" + pretty_dio_logger: + dependency: transitive + description: + name: pretty_dio_logger + sha256: "36f2101299786d567869493e2f5731de61ce130faa14679473b26905a92b6407" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + proj4dart: + dependency: transitive + description: + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + url: "https://pub.dev" + source: hosted + version: "2.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" + url: "https://pub.dev" + source: hosted + version: "6.1.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + rasadyar_core: + dependency: "direct main" + description: + path: "../core" + relative: true + source: path + version: "1.2.0+2" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + shamsi_date: + dependency: transitive + description: + name: shamsi_date + sha256: "0383fddc9bce91e9e08de0c909faf93c3ab3a0e532abd271fb0dcf5d0617487b" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + shimmer: + dependency: transitive + description: + name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc787b1f89ceac9580c3616f899c9a447413cbdac1df071302127764c023a134 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1" + url: "https://pub.dev" + source: hosted + version: "1.3.6" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test: + dependency: "direct dev" + description: + name: test + sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e" + url: "https://pub.dev" + source: hosted + version: "1.25.15" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + test_core: + dependency: transitive + description: + name: test_core + sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa" + url: "https://pub.dev" + source: hosted + version: "0.6.8" + time: + dependency: transitive + description: + name: time + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 + url: "https://pub.dev" + source: hosted + version: "1.1.19" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331" + url: "https://pub.dev" + source: hosted + version: "1.1.17" + 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: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 + url: "https://pub.dev" + source: hosted + version: "15.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + win32: + dependency: transitive + description: + name: win32 + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" + url: "https://pub.dev" + source: hosted + version: "5.14.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + 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" + yaml_writer: + dependency: transitive + description: + name: yaml_writer + sha256: "69651cd7238411179ac32079937d4aa9a2970150d6b2ae2c6fe6de09402a5dc5" + url: "https://pub.dev" + source: hosted + version: "2.1.0" +sdks: + dart: ">=3.8.1 <4.0.0" + flutter: ">=3.29.0" diff --git a/packages/inspection/pubspec.yaml b/packages/inspection/pubspec.yaml new file mode 100644 index 0000000..0a3d2b2 --- /dev/null +++ b/packages/inspection/pubspec.yaml @@ -0,0 +1,31 @@ +name: rasadyar_inspection +description: "inspection module for rasadyar" +publish_to: 'none' +version: 1.2.0 + +environment: + sdk: ^3.8.1 + +dependencies: + flutter: + sdk: flutter + rasadyar_core: + path: ../core + ##code generation + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + lints: ^6.0.0 + test: ^1.25.15 + ##code generation + build_runner: ^2.6.0 + hive_ce_generator: ^1.9.3 + freezed: ^3.2.0 + json_serializable: ^6.10.0 + + ##test + mocktail: ^1.0.4 + get_test: ^4.0.1 diff --git a/packages/livestock/.gitignore b/packages/livestock/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/packages/livestock/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/livestock/CHANGELOG.md b/packages/livestock/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/packages/livestock/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/packages/livestock/README.md b/packages/livestock/README.md new file mode 100644 index 0000000..8831761 --- /dev/null +++ b/packages/livestock/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/livestock/analysis_options.yaml b/packages/livestock/analysis_options.yaml new file mode 100644 index 0000000..dee8927 --- /dev/null +++ b/packages/livestock/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/packages/livestock/lib/livestock.dart b/packages/livestock/lib/livestock.dart new file mode 100644 index 0000000..6289ca5 --- /dev/null +++ b/packages/livestock/lib/livestock.dart @@ -0,0 +1,6 @@ +/// Support for doing something awesome. +/// +/// More dartdocs go here. +library; + + diff --git a/packages/livestock/lib/presentation/page/map/logic.dart b/packages/livestock/lib/presentation/page/map/logic.dart new file mode 100644 index 0000000..04370f3 --- /dev/null +++ b/packages/livestock/lib/presentation/page/map/logic.dart @@ -0,0 +1,8 @@ +import 'package:rasadyar_core/core.dart'; + +class MapLogic extends GetxController { + + var ss = Get.find(); + + +} diff --git a/packages/livestock/lib/presentation/page/map/view.dart b/packages/livestock/lib/presentation/page/map/view.dart new file mode 100644 index 0000000..6935217 --- /dev/null +++ b/packages/livestock/lib/presentation/page/map/view.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/map/view.dart'; +import 'logic.dart'; + +class MapPage extends GetView { + MapPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + MapWidget( + markerWidget: Icon(Icons.pin_drop_rounded), + initOnTap: () { + + }, + initMarkerWidget: Assets.vec.mapMarkerSvg.svg( + width: 30, + height: 30, + ), + ), + + ], + ), + ); + } +} + diff --git a/packages/livestock/lib/presentation/page/profile/logic.dart b/packages/livestock/lib/presentation/page/profile/logic.dart new file mode 100644 index 0000000..811d534 --- /dev/null +++ b/packages/livestock/lib/presentation/page/profile/logic.dart @@ -0,0 +1,5 @@ +import 'package:rasadyar_core/core.dart'; + +class ProfileLogic extends GetxController { + +} diff --git a/packages/livestock/lib/presentation/page/profile/view.dart b/packages/livestock/lib/presentation/page/profile/view.dart new file mode 100644 index 0000000..1819ff5 --- /dev/null +++ b/packages/livestock/lib/presentation/page/profile/view.dart @@ -0,0 +1,13 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class ProfilePage extends GetView { + ProfilePage({super.key}); + + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/packages/livestock/lib/presentation/page/request_tagging/logic.dart b/packages/livestock/lib/presentation/page/request_tagging/logic.dart new file mode 100644 index 0000000..de94cdb --- /dev/null +++ b/packages/livestock/lib/presentation/page/request_tagging/logic.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_livestock/presentation/page/root/logic.dart'; + +class RequestTaggingLogic extends GetxController { + +final TextEditingController phoneController = TextEditingController(); + @override + void onReady() { + super.onReady(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/packages/livestock/lib/presentation/page/request_tagging/view.dart b/packages/livestock/lib/presentation/page/request_tagging/view.dart new file mode 100644 index 0000000..0ff57ed --- /dev/null +++ b/packages/livestock/lib/presentation/page/request_tagging/view.dart @@ -0,0 +1,109 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; + +import 'logic.dart'; + +class RequestTaggingPage extends GetView { + const RequestTaggingPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: RAppBar( + title: 'درخواست پلاک کوبی', + leadingWidth: 40, + leading: Assets.vec.messageAddSvg.svg(width: 12, height: 12), + ), + body: Padding( + padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 15), + child: Column( + children: [ + RTextField( + controller: controller.phoneController, + label: 'تلفن دامدار', + ), + + SizedBox( + width: Get.width, + height: 356, + child: Card( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Expanded( + child: Container( + width: Get.width, + + decoration: BoxDecoration( + color: AppColor.lightGreyNormal, + borderRadius: BorderRadius.circular(8), + ), + child: Center( + child: Assets.images.placeHolder.image( + height: 150, + width: 200, + ), + ), + ), + ), + SizedBox(height: 15), + Container( + width: Get.width, + height: 40, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: AppColor.blueNormal, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + ' تصویر گله', + style: AppFonts.yekan14.copyWith( + color: Colors.white, + ), + ), + Icon( + CupertinoIcons.arrow_up_doc, + color: Colors.white, + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + + Spacer(), + + + + RElevated( + text: 'ارسال تصویر گله', + onPressed: () { + Get.toNamed(LiveStockRoutes.tagging); + }, + height: 40, + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), + ), + ); + } +} diff --git a/packages/livestock/lib/presentation/page/requests/logic.dart b/packages/livestock/lib/presentation/page/requests/logic.dart new file mode 100644 index 0000000..bf98dd3 --- /dev/null +++ b/packages/livestock/lib/presentation/page/requests/logic.dart @@ -0,0 +1,9 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_livestock/presentation/page/root/logic.dart'; + +class RequestsLogic extends GetxController { + RxList filterSelected = [].obs; + + RxBool isFilterShowed = false.obs; + +} diff --git a/packages/livestock/lib/presentation/page/requests/view.dart b/packages/livestock/lib/presentation/page/requests/view.dart new file mode 100644 index 0000000..2b73f22 --- /dev/null +++ b/packages/livestock/lib/presentation/page/requests/view.dart @@ -0,0 +1,302 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; + +import 'logic.dart'; + +class RequestsPage extends GetView { + RequestsPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: RAppBar(title: 'لیست درخواست‌ها', hasBack: false, centerTitle: true), + body: Column( + children: [ + SizedBox(height: 8), + _buildSearchAndFilter(), + _buildFilterWidget(), + _buildListOfContent(), + RElevated( + text: '+ ایجاد درخواست', + width: Get.width - 36, + height: 40, + textStyle: AppFonts.yekan18.copyWith(color: Colors.white), + onPressed: () { + //TODO + }, + ), + SizedBox(height: 10), + ], + ), + ); + } + + Expanded _buildListOfContent() { + return Expanded( + child: ListView.separated( + shrinkWrap: true, + itemCount: 10, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 50), + separatorBuilder: (context, index) => SizedBox(height: 6), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + Get.toNamed(LiveStockRoutes.requestTagging); + }, + child: Container( + width: Get.width, + height: 75, + decoration: BoxDecoration( + color: + index < 3 + ? AppColor.yellowNormal + : index < 7 + ? AppColor.greenLightActive + : AppColor.blueLight, + borderRadius: BorderRadius.circular(8), + ), + child: Stack( + children: [ + Row( + children: [ + SizedBox(width: 5), + Expanded( + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + border: Border.all( + color: + index < 3 + ? AppColor.yellowNormal + : index < 7 + ? AppColor.greenLightActive + : AppColor.blueLight, + width: 2, + ), + ), + child: Row( + children: [ + SizedBox(width: 10), + Text( + 'محمد احمدی', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith( + color: AppColor.blueNormal, + fontWeight: FontWeight.w600, + ), + ), + SizedBox(width: 20), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + + children: [ + Text( + 'پنج شنبه 14 اردیبهشت', + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyNormal), + ), + Text( + ' همدان - نهاوند - روستای - همدان - نهاوند - روستای ', + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyNormal), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ], + ), + ), + SizedBox(width: 20), + GestureDetector( + onTap: () { + // controller.onTapMap(); + }, + child: SizedBox( + width: 50, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Assets.vec.mapSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + SizedBox(height: 8), + Text( + 'مسیریابی', + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + ), + + SizedBox(width: 20), + ], + ), + ), + ), + + Container( + width: 20, + child: Center( + child: RotatedBox( + quarterTurns: 3, + child: Text( + index < 3 + ? ' بازرسی' + : index < 7 + ? 'اطلاعات' + : 'ارجاع به تعاونی', + style: AppFonts.yekan8, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + Positioned( + top: 5, + right: 10, + + child:Container( + padding: EdgeInsets.all(4), + alignment: AlignmentDirectional.center, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.black54,), + child: Text((index*20).toString(),style: AppFonts.yekan12.copyWith(color: Colors.white),), + ), + ), + ], + ), + ), + ); + }, + ), + ); + } + + Row _buildSearchAndFilter() { + return Row( + children: [ + Padding( + padding: const EdgeInsets.only(right: 10.0), + child: IconButton( + onPressed: () { + controller.isFilterShowed.value = !controller.isFilterShowed.value; + }, + + style: IconButton.styleFrom( + backgroundColor: AppColor.blueNormal, + fixedSize: Size(40, 40), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + icon: Assets.vec.filterSvg.svg(), + ), + ), + Expanded(child: _searchWidget()), + ], + ); + } + + ObxValue _buildFilterWidget() { + return ObxValue((data) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + padding: EdgeInsets.only(top: 5), + curve: Curves.easeInOut, + height: data.value ? 45 : 0, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + padding: EdgeInsets.symmetric(horizontal: 12), + child: ObxValue((data) { + return Row( + spacing: 12, + children: [ + CustomChip( + title: 'انتخاب فیلتر', + index: 0, + isSelected: true, + selectedColor: AppColor.blueNormal, + onTap: (index) {}, + ), + + RFilterChips( + title: 'درخواست‌های من', + index: 1, + isSelected: data.contains(1), + selectedColor: AppColor.yellowNormal, + onTap: (index) { + if (data.contains(1)) { + data.remove(1); + } else { + data.add(1); + } + }, + ), + + RFilterChips( + title: 'در انتظار ثبت ', + index: 2, + selectedColor: AppColor.greenLightActive, + isSelected: data.contains(2), + onTap: (index) { + if (data.contains(2)) { + data.remove(2); + } else { + data.add(2); + } + }, + ), + + RFilterChips( + title: 'ارجاع به تعاونی', + index: 3, + selectedColor: AppColor.blueLightHover, + isSelected: data.contains(3), + onTap: (index) { + if (data.contains(3)) { + data.remove(3); + } else { + data.add(3); + } + }, + ), + ], + ); + }, controller.filterSelected), + ), + ); + }, controller.isFilterShowed); + } + + Widget _searchWidget() { + return Padding( + padding: const EdgeInsets.only(right: 8.0, left: 20.0), + child: RTextField( + suffixIcon: Padding( + padding: const EdgeInsets.all(12.0), + child: Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + hintText: 'جستجو', + onChanged: (value) { + //controller.search(value); + }, + controller: TextEditingController(), + ), + ); + } +} diff --git a/packages/livestock/lib/presentation/page/root/logic.dart b/packages/livestock/lib/presentation/page/root/logic.dart new file mode 100644 index 0000000..0aed723 --- /dev/null +++ b/packages/livestock/lib/presentation/page/root/logic.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_livestock/presentation/page/map/view.dart'; +import 'package:rasadyar_livestock/presentation/page/profile/view.dart'; +import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart'; +import 'package:rasadyar_livestock/presentation/page/requests/view.dart'; +import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; + +class RootLogic extends GetxController { + List pages = [ + Navigator( + key: Get.nestedKey(0), + initialRoute: LiveStockRoutes.requests, + onGenerateRoute: (settings) { + switch (settings.name) { + case LiveStockRoutes.requests: + return GetPageRoute(page: () => RequestsPage()); + case LiveStockRoutes.requestTagging: + return GetPageRoute(page: () => RequestTaggingPage()); + default: + return GetPageRoute(page: () => RequestsPage()); + } + }, + ), + MapPage(), + ProfilePage(), + ]; + RxInt currentIndex = 1.obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + void changePage(int i) => currentIndex.value = i; +} diff --git a/packages/livestock/lib/presentation/page/root/view.dart b/packages/livestock/lib/presentation/page/root/view.dart new file mode 100644 index 0000000..1951ca1 --- /dev/null +++ b/packages/livestock/lib/presentation/page/root/view.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class RootPage extends GetView { + const RootPage({super.key}); + + @override + Widget build(BuildContext context) { + return ObxValue((currentIndex) { + + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + final navigatorKey = Get.nestedKey(currentIndex); + eLog('Pop invoked with result: $result, didPop: $didPop'); + navigatorKey?.currentState?.pop(); + + /*eLog('Pop invoked with result: $result, didPop: $didPop'); + iLog(Get.currentRoute); + iLog(Get.previousRoute); + + final navigatorKey = Get.nestedKey(currentIndex); + + if (currentIndex.value == 0 && + navigatorKey != null && + navigatorKey.currentState != null) { + if (navigatorKey.currentState!.canPop()) { + navigatorKey.currentState!.pop(); + return; + } + + if (!didPop) { + return; + } + }*/ + }, + + child: Scaffold( + body: IndexedStack( + children: [...controller.pages], + index: currentIndex.value, + sizing: StackFit.expand, + ), + extendBody: true, + bottomNavigationBar: RBottomNavigation( + items: [ + RBottomNavigationItem( + icon: Assets.vec.filterSvg.path, + label: 'درخواست‌ها', + isSelected: currentIndex.value == 0, + onTap: () => controller.changePage(0), + ), + + RBottomNavigationItem( + icon: Assets.vec.mapSvg.path, + label: 'نقشه', + isSelected: currentIndex.value == 1, + onTap: () => controller.changePage(1), + ), + + RBottomNavigationItem( + icon: Assets.vec.profileUserSvg.path, + label: 'پروفایل', + isSelected: currentIndex.value == 2, + onTap: () => controller.changePage(2), + ), + ], + ), + ), + ); + }, controller.currentIndex); + } +} diff --git a/packages/livestock/lib/presentation/page/tagging/logic.dart b/packages/livestock/lib/presentation/page/tagging/logic.dart new file mode 100644 index 0000000..30e8316 --- /dev/null +++ b/packages/livestock/lib/presentation/page/tagging/logic.dart @@ -0,0 +1,20 @@ +import 'package:rasadyar_core/core.dart'; + +class TaggingLogic extends GetxController { + RxInt selectedSegment = 0.obs; + RxBool searchIsSelected = false.obs; + RxBool filterIsSelected = false.obs; + RxList filterSelected = [].obs; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/packages/livestock/lib/presentation/page/tagging/view.dart b/packages/livestock/lib/presentation/page/tagging/view.dart new file mode 100644 index 0000000..6e21741 --- /dev/null +++ b/packages/livestock/lib/presentation/page/tagging/view.dart @@ -0,0 +1,764 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; + +import 'logic.dart'; + +class TaggingPage extends GetView { + const TaggingPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: RAppBar( + title: 'پلاک کوبی', + leadingWidth: 40, + leading: Assets.vec.messageAddSvg.svg(width: 12, height: 12), + additionalActions: [ + GestureDetector( + onTap: () { + if (controller.searchIsSelected.value) { + controller.searchIsSelected.value = !controller.searchIsSelected.value; + } + controller.filterIsSelected.value = !controller.filterIsSelected.value; + }, + child: Assets.icons.filter.svg(width: 20, height: 20), + ), + SizedBox(width: 16), + GestureDetector( + onTap: () { + if (controller.filterIsSelected.value) { + controller.filterIsSelected.value = !controller.filterIsSelected.value; + } + controller.searchIsSelected.value = !controller.searchIsSelected.value; + }, + child: Assets.icons.search.svg(width: 20, height: 20), + ), + ], + ), + body: Stack( + children: [ + Column( + children: [ + _buildFilterWidget(), + _buildSearchWidget(), + _buildInfoDetails(), + _buildListContent(), + SizedBox(height: 10), + + Padding( + padding: const EdgeInsets.fromLTRB(35, 0, 35, 20), + child: RElevated( + text: 'ثبت نهایی و ارسال به اتحادیه', + textStyle: AppFonts.yekan18, + height: 40, + backgroundColor: AppColor.greenNormal, + onPressed: () {}, + isFullWidth: true, + ), + ), + ], + ), + Positioned( + right: 10, + bottom: 75, + child: RFab.add( + onPressed: () { + Get.bottomSheet(_buildBottomSheet(), isScrollControlled: true); + }, + ), + ), + ], + ), + ); + } + + Container _buildInfoDetails() { + return Container( + height: 40, + margin: EdgeInsets.fromLTRB(15, 10, 15, 2), + decoration: BoxDecoration( + color: AppColor.greenLightHover, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight), + ), + alignment: Alignment.center, + child: Text('پلاک شده : سبک 5 و سنگین 8 راس'), + ); + } + + Expanded _buildListContent() { + return Expanded( + child: ListView.separated( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), + itemCount: 20, + physics: BouncingScrollPhysics(), + cacheExtent: 280, + addRepaintBoundaries: true, + itemBuilder: (context, index) { + return _buildItemList(index); + }, + separatorBuilder: (BuildContext context, int index) => SizedBox(height: 6), + ), + ); + } + + Stack _buildItemList(int index) { + return Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: Get.width, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + width: 2, + color: + index < 5 + ? AppColor.yellowNormal + : index < 12 + ? AppColor.greenLightActive + : AppColor.blueLight, + ), + ), + child: Row( + children: [ + SizedBox(width: 30), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.bottomSheet(_buildInfoBottomSheet(), isScrollControlled: true); + }, + child: Stack( + clipBehavior: Clip.none, + children: [ + Text('123456789012346', style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal)), + Positioned(top: -20, right: -10, child: Assets.icons.virtual.svg(width: 20, height: 20)), + ], + ), + ), + Spacer(), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('گوسفند ماده', style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal)), + SizedBox(height: 4), + Text('نوع نژاد', style: AppFonts.yekan14.copyWith(color: AppColor.bgDark)), + ], + ), + Spacer(), + Text('18 ماه', style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark)), + Spacer(), + Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Assets.vec.editSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + Assets.vec.trashSvg.svg( + width: 20, + height: 20, + colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn), + ), + ], + ), + ), + SizedBox(width: 8), + ], + ), + ), + Positioned( + right: -12, + top: 0, + bottom: 0, + child: Container( + width: 30, + height: 30, + child: Stack( + alignment: Alignment.center, + children: [ + Assets.vec.tagLabelSvg.svg(width: 30, height: 30), + Positioned( + bottom: 25, + right: 2, + left: 2, + child: Text( + (index > 10 ? index * 1000 : index + 1).toString(), + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith( + fontSize: ((index > 10 ? index * 1000 : index + 1).toString()).length > 3 ? 6 : 8, + color: AppColor.blueDarkActive, + ), + textScaler: TextScaler.linear(1.5), + ), + ), + ], + ), + ), + ), + ], + ); + } + + Widget _buildOldPage() { + return Expanded( + child: Card( + clipBehavior: Clip.hardEdge, + color: Colors.white, + child: GridView.builder( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + itemCount: 20, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 12, + mainAxisSpacing: 8, + ), + itemBuilder: (context, index) { + return Container( + decoration: ShapeDecoration( + color: AppColor.lightGreyLightHover, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blackLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Assets.vec.editSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + Assets.vec.trashSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn), + ), + ], + ), + Text( + 'گوسفند ماده', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + SizedBox(height: 10), + Text( + 'سن : 18 ماه', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyNormal), + ), + Text( + 'نوع نژاد', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + Text( + '1212115112512', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + Text( + 'نوع پلاک', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + ), + ); + }, + ), + ), + ); + } + + Widget _buildBottomSheet() { + return BaseBottomSheet( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 8, + children: [ + _buildLiveStockSpecies(), + _buildLivestockBirthday(), + _buildLivestockGender(), + + _buildLivestockBreed(), + + _buildMotherTagNumber(), + _buildFatherTagNumber(), + _buildTagNumber(), + _buildTagType(), + + _buildLiveStockImage(), + + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: RElevated( + text: 'افزودن دام به گله', + textStyle: AppFonts.yekan18.copyWith(color: Colors.white), + width: Get.width, + backgroundColor: AppColor.greenNormal, + height: 40, + onPressed: () { + Get.back(); + }, + ), + ), + ], + ), + ); + } + + Widget _buildInfoBottomSheet() { + return BaseBottomSheet( + height: Get.height * 0.5, + bgColor: const Color(0xFFF5F5F5), + child: Card( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Assets.vec.editSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + Text('محمد احمدی', style: AppFonts.yekan14), + + GestureDetector( + onTap: () { + _buildDeleteDialog(onConfirm: () { + + }); + }, + child: Assets.vec.trashSvg.svg( + width: 16, + height: 16, + colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn), + ), + ), + ], + ), + Container( + height: 32, + padding: EdgeInsets.all(8), + decoration: BoxDecoration(color: AppColor.blueLightHover), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ ثبت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + '1404/2/2', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'شماره پلاک', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + '123456789012346', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'جنسیت ', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + 'ماده', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'نوع نژاد', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + 'افشاری', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'نوع گله', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + 'روستایی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'شهر', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + 'کرج', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'سن', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + Text( + '18 ماه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark), + ), + ], + ), + ], + ), + ), + ), + ); + } + + void _buildDeleteDialog({required VoidCallback onConfirm}) { + Get.defaultDialog( + title: 'حذف دام', + middleText: 'آیا از حذف این دام مطمئن هستید؟', + confirm: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: AppColor.error, foregroundColor: Colors.white), + onPressed: onConfirm, + child: Text('بله'), + ), + cancel: ElevatedButton( + onPressed: () { + Get.back(); + }, + child: Text('خیر'), + ), + ); + } + + SizedBox _buildLiveStockImage() { + return SizedBox( + width: Get.width, + height: 350, + child: Card( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Expanded( + child: Container( + width: Get.width, + decoration: BoxDecoration(color: AppColor.lightGreyNormal, borderRadius: BorderRadius.circular(8)), + child: Center(child: Assets.images.placeHolder.image(height: 150, width: 200)), + ), + ), + SizedBox(height: 15), + Container( + width: Get.width, + height: 40, + clipBehavior: Clip.antiAlias, + decoration: ShapeDecoration( + color: AppColor.blueNormal, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('تصویر دام', style: AppFonts.yekan14.copyWith(color: Colors.white)), + Icon(CupertinoIcons.arrow_up_doc, color: Colors.white), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } + + OverlayDropdownWidget _buildTagType() { + return OverlayDropdownWidget( + items: ['نوع پلاک 1', 'نوع پلاک 2', 'نوع پلاک 3'], + onChanged: (value) { + print('Selected Breed: $value'); + }, + itemBuilder: (item) => Text(item), + labelBuilder: (item) => Text(item ?? 'نوع پلاک'), + ); + } + + TextFiledFixedHint _buildTagNumber() { + return TextFiledFixedHint( + inputType: InputType.number, + hintText: 'پلاک دام', + onChanged: (String value) { + eLog('father Tag: $value'); + }, + ); + } + + TextFiledFixedHint _buildFatherTagNumber() { + return TextFiledFixedHint( + inputType: InputType.number, + hintText: 'پلاک پدر ', + onChanged: (String value) { + eLog('father Tag: $value'); + }, + ); + } + + TextFiledFixedHint _buildMotherTagNumber() { + return TextFiledFixedHint( + inputType: InputType.number, + hintText: 'پلاک مادر ', + onChanged: (String value) { + eLog('Mother Tag: $value'); + }, + ); + } + + OverlayDropdownWidget _buildLivestockBreed() { + return OverlayDropdownWidget( + items: ['نوع نژاد 1', 'نوع نژاد 2', 'نوع نژاد 3'], + onChanged: (value) { + print('Selected Breed: $value'); + }, + itemBuilder: (item) => Text(item), + labelBuilder: (item) => Text(item ?? 'نژاد'), + ); + } + + ObxValue _buildLivestockGender() { + return ObxValue( + (data) => CupertinoSlidingSegmentedControl( + children: { + 0: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12), + child: Text( + 'نر', + style: AppFonts.yekan14.copyWith( + color: data.value == 0 ? AppColor.whiteGreyLight : AppColor.darkGreyNormalActive, + ), + ), + ), + 1: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Text( + 'ماده', + style: AppFonts.yekan14.copyWith( + color: data.value == 1 ? AppColor.whiteGreyLight : AppColor.darkGreyNormalActive, + ), + ), + ), + }, + onValueChanged: (int? value) { + if (value != null) { + controller.selectedSegment.value = value; + } + }, + + proportionalWidth: true, + groupValue: data.value, + thumbColor: AppColor.blueNormal, + backgroundColor: CupertinoColors.systemGrey6, + ), + controller.selectedSegment, + ); + } + + Container _buildLivestockBirthday() { + return Container( + height: 40, + width: Get.width, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + border: Border.all(color: AppColor.darkGreyLight), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('تاریخ تولد', style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyNormalActive)), + Text('1404/5/5', style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyNormalActive)), + ], + ), + ); + } + + OverlayDropdownWidget _buildLiveStockSpecies() { + return OverlayDropdownWidget( + items: ['گوسفند ماده', 'گوسفند نر', 'بز ماده', 'بز نر', 'گوساله ماده', 'گوساله نر'], + onChanged: (value) { + print('Selected: $value'); + }, + itemBuilder: (item) => Text(item), + labelBuilder: (item) => Text(item ?? 'گونه دام'), + ); + } + + ObxValue _buildFilterWidget() { + return ObxValue((data) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + padding: EdgeInsets.only(top: 5), + curve: Curves.easeInOut, + height: data.value ? 50 : 0, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + padding: EdgeInsets.symmetric(horizontal: 12), + child: ObxValue((data) { + return Row( + spacing: 12, + children: [ + CustomChip( + title: 'انتخاب فیلتر', + index: 0, + isSelected: true, + selectedColor: AppColor.blueNormal, + onTap: (index) {}, + ), + + RFilterChips( + title: 'درخواست‌های من', + index: 1, + isSelected: data.contains(1), + selectedColor: AppColor.yellowNormal, + onTap: (index) { + if (data.contains(1)) { + data.remove(1); + } else { + data.add(1); + } + }, + ), + + RFilterChips( + title: 'در انتظار ثبت ', + index: 2, + selectedColor: AppColor.greenLightActive, + isSelected: data.contains(2), + onTap: (index) { + if (data.contains(2)) { + data.remove(2); + } else { + data.add(2); + } + }, + ), + + RFilterChips( + title: 'ارجاع به تعاونی', + index: 3, + selectedColor: AppColor.blueLightHover, + isSelected: data.contains(3), + onTap: (index) { + if (data.contains(3)) { + data.remove(3); + } else { + data.add(3); + } + }, + ), + ], + ); + }, controller.filterSelected), + ), + ); + }, controller.filterIsSelected); + } + + ObxValue _buildSearchWidget() { + return ObxValue((data) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + padding: EdgeInsets.only(top: 5), + curve: Curves.easeInOut, + height: data.value ? 50 : 0, + child: Visibility( + visible: data.value, + child: Padding( + padding: const EdgeInsets.only(right: 8.0, left: 20.0), + child: RTextField( + suffixIcon: Padding( + padding: const EdgeInsets.all(12.0), + child: Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + ), + hintText: 'جستجو', + onChanged: (value) { + //controller.search(value); + }, + controller: TextEditingController(), + ), + ), + ), + ); + }, controller.searchIsSelected); + } +} diff --git a/packages/livestock/lib/presentation/routes/app_pages.dart b/packages/livestock/lib/presentation/routes/app_pages.dart new file mode 100644 index 0000000..d7840fd --- /dev/null +++ b/packages/livestock/lib/presentation/routes/app_pages.dart @@ -0,0 +1,61 @@ +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/map/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/map/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/profile/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/request_tagging/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart'; +import 'package:rasadyar_livestock/presentation/page/requests/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/root/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/root/view.dart'; +import 'package:rasadyar_livestock/presentation/page/tagging/logic.dart'; +import 'package:rasadyar_livestock/presentation/page/tagging/view.dart'; + +part 'app_routes.dart'; + +sealed class LiveStockPages { + LiveStockPages._(); + + static final pages = [ + GetPage( + name: LiveStockRoutes.init, + page: () => RootPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.put(RootLogic()); + Get.lazyPut(() => RequestsLogic()); + Get.lazyPut(() => MapLogic()); + Get.lazyPut(() => ProfileLogic()); + Get.lazyPut(() => ProfileLogic()); + Get.lazyPut(() => MapWidgetLogic()); + Get.lazyPut(() => DraggableBottomSheetController()); + }), + children: [ + /*GetPage( + name: LiveStockRoutes.requestTagging, + page: () => RequestTaggingPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => RequestTaggingLogic()); + }), + ),*/ + ], + ), + + GetPage( + name: LiveStockRoutes.requestTagging, + page: () => RequestTaggingPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => RequestTaggingLogic()); + }), + ), + GetPage( + name: LiveStockRoutes.tagging, + page: () => TaggingPage(), + middlewares: [AuthMiddleware()], + binding: BindingsBuilder(() { + Get.lazyPut(() => TaggingLogic()); + }), + ), + ]; +} diff --git a/packages/livestock/lib/presentation/routes/app_routes.dart b/packages/livestock/lib/presentation/routes/app_routes.dart new file mode 100644 index 0000000..58e206f --- /dev/null +++ b/packages/livestock/lib/presentation/routes/app_routes.dart @@ -0,0 +1,14 @@ +part of 'app_pages.dart'; + +sealed class LiveStockRoutes { + LiveStockRoutes._(); + + static const auth = '/AuthLiveStock'; + static const init = '/liveStock'; + static const requests = '/requests'; + static const profile = '/profile'; + + //static const requestTagging = '$init/tagging'; + static const requestTagging = '$requests/tagging'; + static const tagging = '/tagging'; +} diff --git a/packages/livestock/pubspec.yaml b/packages/livestock/pubspec.yaml new file mode 100644 index 0000000..a15d59a --- /dev/null +++ b/packages/livestock/pubspec.yaml @@ -0,0 +1,36 @@ +name: rasadyar_livestock +description: A starting point for Dart libraries or applications. +version: 1.0.0 +publish_to: 'none' +# repository: https://github.com/my_org/my_repo + +environment: + sdk: ^3.8.1 + + +dependencies: + flutter: + sdk: flutter + rasadyar_core: + path: ../core + + ##code generation + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + lints: ^6.0.0 + test: ^1.25.15 + ##code generation + build_runner: ^2.6.0 + hive_ce_generator: ^1.9.3 + freezed: ^3.2.0 + json_serializable: ^6.10.0 + + ##test + mocktail: ^1.0.4 + get_test: ^4.0.1 + + diff --git a/packages/livestock/test/livestock_test.dart b/packages/livestock/test/livestock_test.dart new file mode 100644 index 0000000..534cb37 --- /dev/null +++ b/packages/livestock/test/livestock_test.dart @@ -0,0 +1,5 @@ + + +void main() { + +} diff --git a/pubspec.lock b/pubspec.lock index c2c57f7..b93bb67 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,14 +1,70 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + android_intent_plus: + dependency: transitive + description: + name: android_intent_plus + sha256: dfc1fd3a577205ae8f11e990fb4ece8c90cceabbee56fcf48e463ecf0bd6aae3 + url: "https://pub.dev" + source: hosted + version: "5.3.0" + animated_stack_widget: + dependency: transitive + description: + name: animated_stack_widget + sha256: ce4788dd158768c9d4388354b6fb72600b78e041a37afc4c279c63ecafcb9408 + url: "https://pub.dev" + source: hosted + version: "0.0.4" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" + url: "https://pub.dev" + source: hosted + version: "1.6.5" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -17,6 +73,78 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d + url: "https://pub.dev" + source: hosted + version: "2.6.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 + url: "https://pub.dev" + source: hosted + version: "9.2.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62" + url: "https://pub.dev" + source: hosted + version: "8.11.0" + change_app_package_name: + dependency: "direct dev" + description: + name: change_app_package_name + sha256: "8e43b754fe960426904d77ed4c62fa8c9834deaf6e293ae40963fa447482c4c5" + url: "https://pub.dev" + source: hosted + version: "1.5.0" characters: dependency: transitive description: @@ -25,6 +153,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" clock: dependency: transitive description: @@ -33,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" collection: dependency: transitive description: @@ -41,6 +193,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + color: + dependency: transitive + description: + name: color + sha256: ddcdf1b3badd7008233f5acffaf20ca9f5dc2cd0172b75f68f24526a5f5725cb + url: "https://pub.dev" + source: hosted + version: "3.0.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + 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" cupertino_icons: dependency: "direct main" description: @@ -49,40 +233,658 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dart_earcut: + dependency: transitive + description: + name: dart_earcut + sha256: e485001bfc05dcbc437d7bfb666316182e3522d4c3f9668048e004d0eb2ce43b + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + dartx: + dependency: transitive + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + device_info_plus: + dependency: transitive + description: + name: device_info_plus + sha256: "98f28b42168cc509abc92f88518882fd58061ea372d7999aecc424345c7bff6a" + url: "https://pub.dev" + source: hosted + version: "11.5.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f + url: "https://pub.dev" + source: hosted + version: "7.0.3" + dio: + dependency: transitive + description: + name: dio + sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" + url: "https://pub.dev" + source: hosted + version: "5.8.0+1" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + encrypt: + dependency: transitive + description: + name: encrypt + sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" + url: "https://pub.dev" + source: hosted + version: "5.0.3" fake_async: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" + 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_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: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" + url: "https://pub.dev" + source: hosted + version: "0.9.4+3" + 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" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_gen_core: + dependency: transitive + description: + name: flutter_gen_core + sha256: eda54fdc5de08e7eeea663eb8442aafc8660b5a13fda4e0c9e572c64e50195fb + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_gen_runner: + dependency: "direct dev" + description: + name: flutter_gen_runner + sha256: "669bf8b7a9b4acbdcb7fcc5e12bf638aca19acedf43341714cbca3bf3a219521" + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_launcher_icons: + dependency: "direct main" + description: + name: flutter_launcher_icons + sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7" + url: "https://pub.dev" + source: hosted + version: "0.14.4" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_map: + dependency: transitive + description: + name: flutter_map + sha256: "2ecb34619a4be19df6f40c2f8dce1591675b4eff7a6857bd8f533706977385da" + url: "https://pub.dev" + source: hosted + version: "7.0.2" + flutter_map_animations: + dependency: transitive + description: + name: flutter_map_animations + sha256: "08233f89919049a3601e785d32e9d1d9e1faac6578190150f1d7495fc1050d36" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + flutter_map_marker_cluster: + dependency: transitive + description: + name: flutter_map_marker_cluster + sha256: "2c1fb4d7a2105c4bbeb89be215320507f4b71b2036df4341fab9d2aa677d3ae9" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + flutter_map_marker_popup: + dependency: transitive + description: + name: flutter_map_marker_popup + sha256: a7540538114b5d1627ab67b498273d66bc36090385412ae49ef215af4a2861c5 + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e + url: "https://pub.dev" + source: hosted + version: "2.0.28" + flutter_rating_bar: + dependency: transitive + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + flutter_screenutil: + dependency: transitive + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.dev" + source: hosted + version: "5.9.3" + flutter_secure_storage: + dependency: transitive + description: + name: flutter_secure_storage + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + flutter_slidable: + dependency: transitive + description: + name: flutter_slidable + sha256: ab7dbb16f783307c9d7762ede2593ce32c220ba2ba0fd540a3db8e9a3acba71a + url: "https://pub.dev" + source: hosted + version: "4.0.0" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 + url: "https://pub.dev" + source: hosted + version: "2.2.0" 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" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c + url: "https://pub.dev" + source: hosted + version: "3.2.0" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + geoclue: + dependency: transitive + description: + name: geoclue + sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f + url: "https://pub.dev" + source: hosted + version: "0.1.1" + geolocator: + dependency: transitive + description: + name: geolocator + sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516" + url: "https://pub.dev" + source: hosted + version: "14.0.2" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 + url: "https://pub.dev" + source: hosted + version: "2.3.13" + geolocator_linux: + dependency: transitive + description: + name: geolocator_linux + sha256: c4e966f0a7a87e70049eac7a2617f9e16fd4c585a26e4330bdfc3a71e6a721f3 + url: "https://pub.dev" + source: hosted + version: "0.2.3" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" + url: "https://pub.dev" + source: hosted + version: "4.2.6" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172 + url: "https://pub.dev" + source: hosted + version: "4.1.3" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" + url: "https://pub.dev" + source: hosted + version: "0.2.5" + get: + dependency: transitive + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.dev" + source: hosted + version: "4.7.2" + get_it: + dependency: transitive + description: + name: get_it + sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + url: "https://pub.dev" + source: hosted + version: "8.0.3" + get_test: + dependency: "direct dev" + description: + name: get_test + sha256: "558c39cb35fb37bd501f337dc143de60a4314d5ef3b75f4b0551d6741634995b" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + gsettings: + dependency: transitive + description: + name: gsettings + sha256: "1b0ce661f5436d2db1e51f3c4295a49849f03d304003a7ba177d01e3a858249c" + url: "https://pub.dev" + source: hosted + version: "0.2.8" + hashcodes: + dependency: transitive + description: + name: hashcodes + sha256: "80f9410a5b3c8e110c4b7604546034749259f5d6dcca63e0d3c17c9258f1a651" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + hive_ce: + dependency: transitive + description: + name: hive_ce + sha256: "708bb39050998707c5d422752159f91944d3c81ab42d80e1bd0ee37d8e130658" + url: "https://pub.dev" + source: hosted + version: "2.11.3" + hive_ce_flutter: + dependency: transitive + description: + name: hive_ce_flutter + sha256: a0989670652eab097b47544f1e5a4456e861b1b01b050098ea0b80a5fabe9909 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + hive_ce_generator: + dependency: "direct dev" + description: + name: hive_ce_generator + sha256: a169feeff2da9cc2c417ce5ae9bcebf7c8a95d7a700492b276909016ad70a786 + url: "https://pub.dev" + source: hosted + version: "1.9.3" + http: + dependency: transitive + description: + name: http + sha256: "85ab0074f9bf2b24625906d8382bbec84d3d6919d285ba9c106b07b65791fb99" + url: "https://pub.dev" + source: hosted + version: "1.5.0-beta.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + image_picker: + dependency: transitive + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "6fae381e6af2bbe0365a5e4ce1db3959462fa0c4d234facf070746024bb80c8d" + url: "https://pub.dev" + source: hosted + version: "0.8.12+24" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + 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" + image_size_getter: + dependency: transitive + description: + name: image_size_getter + sha256: "9a299e3af2ebbcfd1baf21456c3c884037ff524316c97d8e56035ea8fdf35653" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + isolate_channel: + dependency: transitive + description: + name: isolate_channel + sha256: f3d36f783b301e6b312c3450eeb2656b0e7d1db81331af2a151d9083a3f6b18d + url: "https://pub.dev" + source: hosted + version: "0.2.2+1" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: ce2cf974ccdee13be2a510832d7fba0b94b364e0b0395dee42abaa51b855be27 + url: "https://pub.dev" + source: hosted + version: "6.10.0" + latlong2: + dependency: transitive + description: + name: latlong2 + sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe" + url: "https://pub.dev" + source: hosted + version: "0.9.1" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -103,10 +905,42 @@ packages: dependency: transitive description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "6.0.0" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + logger: + dependency: transitive + description: + name: logger + sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lottie: + dependency: transitive + description: + name: lottie + sha256: c5fa04a80a620066c15cf19cc44773e19e9b38e989ff23ea32e5903ef1015950 + url: "https://pub.dev" + source: hosted + version: "3.3.1" matcher: dependency: transitive description: @@ -131,6 +965,70 @@ packages: url: "https://pub.dev" source: hosted version: "1.16.0" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: transitive + description: + name: mockito + sha256: "2314cbe9165bcd16106513df9cf3c3224713087f09723b128928dc11a4379f99" + url: "https://pub.dev" + source: hosted + version: "5.5.0" + mocktail: + dependency: "direct dev" + description: + name: mocktail + sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" + url: "https://pub.dev" + source: hosted + version: "8.3.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" + url: "https://pub.dev" + source: hosted + version: "3.2.0" path: dependency: transitive description: @@ -139,11 +1037,303 @@ packages: 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: transitive + 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: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 + url: "https://pub.dev" + source: hosted + version: "2.2.17" + 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" + permission_handler: + dependency: transitive + description: + name: permission_handler + sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1 + url: "https://pub.dev" + source: hosted + version: "12.0.1" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6" + url: "https://pub.dev" + source: hosted + version: "13.0.1" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023 + url: "https://pub.dev" + source: hosted + version: "9.4.7" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.dev" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 + url: "https://pub.dev" + source: hosted + version: "4.3.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + persian_datetime_picker: + dependency: transitive + description: + name: persian_datetime_picker + sha256: "7ccbfd3a68dc89d405550f624e9fa590c914fed2aa2d48973c4f4400baab2e06" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.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" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.dev" + source: hosted + version: "3.9.1" + polylabel: + dependency: transitive + description: + name: polylabel + sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.dev" + source: hosted + version: "6.0.3" + pretty_dio_logger: + dependency: transitive + description: + name: pretty_dio_logger + sha256: "36f2101299786d567869493e2f5731de61ce130faa14679473b26905a92b6407" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + proj4dart: + dependency: transitive + description: + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + url: "https://pub.dev" + source: hosted + version: "2.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" + url: "https://pub.dev" + source: hosted + version: "6.1.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + rasadyar_chicken: + dependency: "direct main" + description: + path: "packages/chicken" + relative: true + source: path + version: "1.2.1+2" + rasadyar_core: + dependency: "direct main" + description: + path: "packages/core" + relative: true + source: path + version: "1.2.0+2" + rasadyar_inspection: + dependency: "direct main" + description: + path: "packages/inspection" + relative: true + source: path + version: "1.2.0" + rasadyar_livestock: + dependency: "direct main" + description: + path: "packages/livestock" + relative: true + source: path + version: "1.0.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + shamsi_date: + dependency: transitive + description: + name: shamsi_date + sha256: "0383fddc9bce91e9e08de0c909faf93c3ab3a0e532abd271fb0dcf5d0617487b" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + shimmer: + dependency: transitive + description: + name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" + url: "https://pub.dev" + source: hosted + version: "3.0.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc787b1f89ceac9580c3616f899c9a447413cbdac1df071302127764c023a134 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1" + url: "https://pub.dev" + source: hosted + version: "1.3.6" source_span: dependency: transitive description: @@ -152,6 +1342,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: @@ -168,6 +1366,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" string_scanner: dependency: transitive description: @@ -192,6 +1398,70 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.4" + time: + dependency: transitive + description: + name: time + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 + url: "https://pub.dev" + source: hosted + version: "1.1.19" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331" + url: "https://pub.dev" + source: hosted + version: "1.1.17" vector_math: dependency: transitive description: @@ -204,10 +1474,98 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + win32: + dependency: transitive + description: + name: win32 + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" + url: "https://pub.dev" + source: hosted + version: "5.14.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + 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" + yaml_writer: + dependency: transitive + description: + name: yaml_writer + sha256: "69651cd7238411179ac32079937d4aa9a2970150d6b2ae2c6fe6de09402a5dc5" + url: "https://pub.dev" + source: hosted + version: "2.1.0" sdks: - dart: ">=3.7.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.8.1 <4.0.0" + flutter: ">=3.29.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2ee5c3c..5472dd0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,89 +1,79 @@ name: rasadyar_app 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 +publish_to: 'none' +version: 1.3.6+4 environment: - sdk: ^3.7.0 + sdk: ^3.8.1 -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. + #UI cupertino_icons: ^1.0.8 + flutter_launcher_icons: ^0.14.4 + #rasadyar packages + rasadyar_core: + path: ./packages/core + + rasadyar_inspection: + path: ./packages/inspection + + rasadyar_livestock: + path: ./packages/livestock + + rasadyar_chicken: + path: ./packages/chicken + + + ##code generation + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 + ##code generation + build_runner: ^2.6.0 + hive_ce_generator: ^1.9.3 + freezed: ^3.2.0 + json_serializable: ^6.10.0 + flutter_gen_runner: ^5.11.0 + change_app_package_name: ^1.5.0 + + ##test + mocktail: ^1.0.4 + get_test: ^4.0.1 + - # 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: ^5.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: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images + assets: + - assets/icons/ + - assets/images/ + - assets/logos/ + - assets/vec/ + - assets/anim/ - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/to/font-from-package + fonts: + - family: yekan + fonts: + - asset: fonts/iranyekanregularfanum.ttf + + +flutter_gen: + output: packages/core/lib/presentation/common + line_length: 120 + # Optional + integrations: + image: true + flutter_svg: true + lottie: true + rive: false diff --git a/tools/copyAssets.sh b/tools/copyAssets.sh new file mode 100644 index 0000000..a32ff95 --- /dev/null +++ b/tools/copyAssets.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +SOURCE_FILE="lib/presentation/common/assets.dart" +TARGET_DIR="packages/core/lib/presentation/common/assets.dart" + +echo "--- Starting File Operations ---" + +echo " 💀 Attempting to delete '$FILE_PATH_TO_DELETE'..." +rm -fv "$FILE_PATH_TO_DELETE" +echo "✅ Deletion step complete (file removed if it existed)." + + + + +echo "Attempting to copy source(s) to '$TARGET_DIR'..." + diff --git a/tools/package_builder.sh b/tools/package_builder.sh new file mode 100644 index 0000000..369f0a5 --- /dev/null +++ b/tools/package_builder.sh @@ -0,0 +1,2 @@ +#!/bin/bash +dart create --template=package ../packages/chicken \ No newline at end of file diff --git a/tools/pubspecAll.sh b/tools/pubspecAll.sh new file mode 100644 index 0000000..9c22f36 --- /dev/null +++ b/tools/pubspecAll.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Navigate to the project root (assuming tools is one level below root) +cd "$(dirname "$0")/.." + +# Find all pubspec.yaml files, print their directories, and run flutter pub get +#find . -name "pubspec.yaml" -exec sh -c 'echo "Running flutter pub get in $(dirname {}) 🙂🙂🙂🙂🙂"; cd $(dirname {}) ; flutter pub get' \; + +find . -name "pubspec.yaml" -exec sh -c 'echo "Running flutter pub get in $(dirname {}) ⬆️🆙🆙🆙⬆️"; cd $(dirname {}) ; flutter pub upgrade' \; \ No newline at end of file diff --git a/tools/runner.sh b/tools/runner.sh new file mode 100644 index 0000000..ad699f9 --- /dev/null +++ b/tools/runner.sh @@ -0,0 +1,2 @@ +cd ../ +dart run build_runner build --delete-conflicting-outputs diff --git a/tools/vecGeneratoe.sh b/tools/vecGeneratoe.sh new file mode 100644 index 0000000..0e52b5d --- /dev/null +++ b/tools/vecGeneratoe.sh @@ -0,0 +1,81 @@ +##!/bin/bash +# +# +## Relative path to the package +#PACKAGE_PATH="../packages/core" +# +## Get absolute path to the package +#SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +#PACKAGE_ABS_PATH="$SCRIPT_DIR/$PACKAGE_PATH" +# +#echo "🗃️ package path: $PACKAGE_ABS_PATH" +# +## Directory to read files from +#sourcePath="../assets/icons" +#targetPath="../assets/vec" +#echo "🗃️ sourcePath path: $sourcePath" +#echo "🗃️ targetPath path: $targetPath" +# +# +#if [ ! -e "$targetPath" ]; then +# echo "📁 Directory does not exist. Creating: $targetPath" +# mkdir -p "$targetPath" +#fi +# +# +## Loop and delete old vec file +#for file in "$targetPath"/* +#do +# if [ -f "$file" ]; then +# +# echo "Delete old ===> $file" +# rm "$file" +# fi +#done +## Loop through all files in the directory +#for file in "$sourcePath"/* +#do +# if [ -f "$file" ]; then +# echo "Generate Vec file ===> $file" +# fileName=$(basename -- "$file") +# echo "Generate Vec file ===> $fileName" +# dart run vector_graphics_compiler -i "$file" -o "$targetPath/$fileName.vec" +# git add . +# fi +#done + + +PACKAGE_PATH="../packages/core" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PACKAGE_ABS_PATH="$SCRIPT_DIR/$PACKAGE_PATH" + +echo "🗃️ package path: $PACKAGE_ABS_PATH" + +sourcePath="../assets/icons" +targetPath="../assets/vec" +echo "🗃️ sourcePath: $sourcePath" +echo "🗃️ targetPath: $targetPath" + +mkdir -p "$targetPath" + +# Delete old .vec files +echo "🧹 Deleting old .vec files..." +find "$targetPath" -type f -name "*.vec" -exec rm {} \; + +# Generate .vec files in parallel +echo "⚙️ Generating .vec files in parallel..." + +# shellcheck disable=SC2016 +find "$sourcePath" -type f | xargs -P 10 -I {} bash -c ' + input="{}" + filename=$(basename "$input") + output="'$targetPath'/$filename.vec" + echo "➡️ Generating: $filename" + dart run vector_graphics_compiler -i "$input" -o "$output" +' + +git add . + +cd ../ + +dart run build_runner build --delete-conflicting-outputs