diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d77a86b..50bea74 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } android { - namespace = "com.hoshomandsazan.rasadyar_app" + namespace = "ir.mnpc.rasadyar" compileSdk = flutter.compileSdkVersion ndkVersion = "27.0.12077973" @@ -19,13 +19,19 @@ android { } defaultConfig { - applicationId = "com.hoshomandsazan.rasadyar_app" + applicationId = "ir.mnpc.rasadyar" minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } + packaging { + resources { + excludes += "META-INF/DEPENDENCIES" + } + } + buildTypes { release { signingConfig = signingConfigs.getByName("debug") diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 83fb7fb..96504e7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,33 +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/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/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/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/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/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_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/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/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/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/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/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 index c5a263d..5fdbcf7 100644 --- a/assets/icons/logout.svg +++ b/assets/icons/logout.svg @@ -1,5 +1,4 @@ - - - + + 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/place_holder.svg b/assets/icons/place_holder.svg index cfd772b..5a0c1d4 100644 --- a/assets/icons/place_holder.svg +++ b/assets/icons/place_holder.svg @@ -1 +1,33 @@ - \ No newline at end of file +ث + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/search.svg b/assets/icons/search.svg index 4a4e42d..e12b6da 100644 --- a/assets/icons/search.svg +++ b/assets/icons/search.svg @@ -1,6 +1,4 @@ - - - + + + 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/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/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 index af27d7c..b60b7b7 100644 --- a/assets/icons/user.svg +++ b/assets/icons/user.svg @@ -1,4 +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/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/place_holder.png b/assets/images/place_holder.png index fe12c5a..48c509e 100644 Binary files a/assets/images/place_holder.png 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/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/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/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/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_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/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/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/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/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/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 index 8ea1d5f..a8a9e2b 100644 Binary files a/assets/vec/logout.svg.vec and b/assets/vec/logout.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/place_holder.svg.vec b/assets/vec/place_holder.svg.vec index caeb6bf..caefba3 100644 Binary files a/assets/vec/place_holder.svg.vec and b/assets/vec/place_holder.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/search.svg.vec b/assets/vec/search.svg.vec index da0271d..2e7b5e0 100644 Binary files a/assets/vec/search.svg.vec and b/assets/vec/search.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/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/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 index 9455e63..cdbe8af 100644 Binary files a/assets/vec/user.svg.vec 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/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/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/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/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 index b7107fb..c1aebef 100644 --- a/lib/infrastructure/di/di.dart +++ b/lib/infrastructure/di/di.dart @@ -1,13 +1,18 @@ - import 'package:rasadyar_auth/auth.dart'; +import 'package:rasadyar_chicken/data/di/chicken_di.dart'; import 'package:rasadyar_core/core.dart'; final di = GetIt.instance; -Future setupInjection() async{ - await setupAuthDI(); +Future setupPreInjection() async { await setupAllCoreProvider(); - + await setupAuthDI(); + di.registerSingleton( + DioRemote(baseUrl: 'https://everestacademy.ir/'), + instanceName: 'baseRemote', + ); } - +Future setupInjection() async { + await setupChickenDI(); +} diff --git a/lib/infrastructure/service/app_navigation_observer.dart b/lib/infrastructure/service/app_navigation_observer.dart new file mode 100644 index 0000000..9ad7b38 --- /dev/null +++ b/lib/infrastructure/service/app_navigation_observer.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_app/infrastructure/di/di.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_core/core.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) { + _isWorkDone = true; + await setupInjection(); + } + 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/auth_service.dart b/lib/infrastructure/service/auth_service.dart index 9a4a12f..6ad04fa 100644 --- a/lib/infrastructure/service/auth_service.dart +++ b/lib/infrastructure/service/auth_service.dart @@ -25,7 +25,7 @@ class AuthService extends GetxService { everAll([accessRes, refAccessRes], (_) { if (accessRes.value && refAccessRes.value) { var targetPage = getTargetPage(tokenService.appModule.value); - Get.offAndToNamed(targetPage); + Get.offAllNamed(targetPage); } }); } diff --git a/lib/main.dart b/lib/main.dart index 395decd..3fdd903 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,21 +1,24 @@ 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_auth/auth.dart'; import 'package:rasadyar_auth/data/services/token_storage_service.dart'; import 'package:rasadyar_core/core.dart'; + import 'infrastructure/di/di.dart'; import 'infrastructure/service/auth_service.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - await setupInjection(); + await setupPreInjection(); + Get.put(TokenStorageService()); - var tokenService = Get.find(); - await tokenService.init(); + await Get.find().init(); + Get.put(AuthMiddleware()); Get.put(AuthService()); - runApp(MyApp()); + // runApp(DevicePreview(builder: (context) => ForDevicePreview(),)); } @@ -44,23 +47,29 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return GetMaterialApp( - title: 'رصدیار', - theme: ThemeData( - fontFamily: 'yekan', - colorScheme: ColorScheme.fromSeed(seedColor: AppColor.blueNormal), + 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, + ], ), - initialRoute: AppPages.initRoutes, - getPages: AppPages.pages, - locale: const Locale("fa", "IR"), - supportedLocales: const [Locale("fa", "IR")], - localizationsDelegates: [ - PersianMaterialLocalizations.delegate, - PersianCupertinoLocalizations.delegate, - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], ); } } diff --git a/lib/presentation/pages/splash/logic.dart b/lib/presentation/pages/splash/logic.dart index 8f26018..4c779be 100644 --- a/lib/presentation/pages/splash/logic.dart +++ b/lib/presentation/pages/splash/logic.dart @@ -1,4 +1,8 @@ -import 'package:flutter/animation.dart'; +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_auth/data/services/token_storage_service.dart'; import 'package:rasadyar_core/core.dart'; @@ -8,8 +12,14 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin { 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() { @@ -24,15 +34,9 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin { duration: const Duration(milliseconds: 8000), ); - scaleAnimation.value = Tween( - begin: 0.8, - end: 1.2, - ).animate(scaleController); + scaleAnimation.value = Tween(begin: 0.8, end: 1.2).animate(scaleController); - rotationAnimation.value = Tween( - begin: 0.0, - end: 1, - ).animate(rotateController); + rotationAnimation.value = Tween(begin: 0.0, end: 1).animate(rotateController); rotateController.forward(); rotateController.addStatusListener((status) { @@ -51,14 +55,111 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin { 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(seconds: 1), () async { - var module = tokenService.appModule.value; - Get.offAndToNamed(getTargetPage(module)); + + Future.delayed(const Duration(milliseconds: 250), () async { + try { + final isUpdateNeeded = await checkVersion(); + if (isUpdateNeeded) return; + + final module = tokenService.appModule.value; + final target = getTargetPage(module); + Get.offAndToNamed(target); + } catch (e, st) { + debugPrint("onReady error: $e\n$st"); + } }); } @@ -68,4 +169,76 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin { 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 index 4cd5ce8..140ed32 100644 --- a/lib/presentation/pages/splash/view.dart +++ b/lib/presentation/pages/splash/view.dart @@ -15,6 +15,7 @@ class SplashPage extends GetView { child: Stack( alignment: Alignment.center, children: [ + ObxValue((data) { return ScaleTransition( scale: data.value!, diff --git a/lib/presentation/routes/app_pages.dart b/lib/presentation/routes/app_pages.dart index 8e5f373..049b90d 100644 --- a/lib/presentation/routes/app_pages.dart +++ b/lib/presentation/routes/app_pages.dart @@ -4,6 +4,8 @@ import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart import 'package:rasadyar_auth/auth.dart'; import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart'; import 'package:rasadyar_auth/presentation/routes/pages.dart'; +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/presentation/routes/pages.dart'; import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_inspection/inspection.dart'; import 'package:rasadyar_livestock/presentation/routes/app_pages.dart'; @@ -27,17 +29,19 @@ sealed class AppPages { ...InspectionPages.pages, ...AuthPages.pages, ...LiveStockPages.pages, + ...ChickenPages.pages, ]; } String getTargetPage(Module? value) { - eLog('getTargetPage: $value'); switch (value) { case Module.inspection: return InspectionRoutes.inspection; case Module.liveStocks: return LiveStockRoutes.init; + case Module.chicken: + return ChickenRoutes.init; default: - return InspectionRoutes.inspection; + return ChickenRoutes.init; } -} \ No newline at end of file +} diff --git a/lib/presentations/common/assets.dart b/lib/presentations/common/assets.dart deleted file mode 100644 index 2ee3b2b..0000000 --- a/lib/presentations/common/assets.dart +++ /dev/null @@ -1,43 +0,0 @@ -///This file is automatically generated. DO NOT EDIT, all your changes would be lost. -class Assets { - Assets._(); - - static const String iconsAdd = 'assets/icons/add.svg'; - static const String iconsArrowLeft = 'assets/icons/arrow_left.svg'; - static const String iconsArrowRight = 'assets/icons/arrow_right.svg'; - static const String iconsBgHeaderUserProfile = 'assets/icons/bg_header_user_profile.svg'; - static const String iconsCalendar = 'assets/icons/calendar.svg'; - static const String iconsCalendarSearch = 'assets/icons/calendar_search.svg'; - static const String iconsCall = 'assets/icons/call.svg'; - static const String iconsDiagram = 'assets/icons/diagram.svg'; - static const String iconsDownload = 'assets/icons/download.svg'; - static const String iconsEdit = 'assets/icons/edit.svg'; - static const String iconsExcelDownload = 'assets/icons/excel_download.svg'; - static const String iconsFilter = 'assets/icons/filter.svg'; - static const String iconsGps = 'assets/icons/gps.svg'; - static const String iconsInformation = 'assets/icons/information.svg'; - static const String iconsInspection = 'assets/icons/inspection.svg'; - static const String iconsKey = 'assets/icons/key.svg'; - static const String iconsLiveStock = 'assets/icons/liveStock.svg'; - static const String iconsLogout = 'assets/icons/logout.svg'; - static const String iconsMap = 'assets/icons/map.svg'; - static const String iconsMapMarker = 'assets/icons/map_marker.svg'; - static const String iconsMessageAdd = 'assets/icons/message_add.svg'; - static const String iconsPdfDownload = 'assets/icons/pdf_download.svg'; - static const String iconsPictureFrame = 'assets/icons/picture_frame.svg'; - static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; - static const String iconsProfileUser = 'assets/icons/profile_user.svg'; - static const String iconsReceiptDiscount = 'assets/icons/receipt_discount.svg'; - static const String iconsScan = 'assets/icons/scan.svg'; - static const String iconsScanBarcode = 'assets/icons/scan_barcode.svg'; - static const String iconsSearch = 'assets/icons/search.svg'; - static const String iconsSecurityTime = 'assets/icons/security_time.svg'; - static const String iconsSetting = 'assets/icons/setting.svg'; - static const String iconsTagUser = 'assets/icons/tag_user.svg'; - static const String iconsTrash = 'assets/icons/trash.svg'; - static const String iconsUser = 'assets/icons/user.svg'; - static const String iconsUserSquare = 'assets/icons/user_square.svg'; - static const String imagesInnerSplash = 'assets/images/inner_splash.webp'; - static const String imagesOutterSplash = 'assets/images/outter_splash.webp'; - -} diff --git a/packages/auth/lib/data/common/dio_error_handler.dart b/packages/auth/lib/data/common/dio_error_handler.dart index 963707c..57f29bc 100644 --- a/packages/auth/lib/data/common/dio_error_handler.dart +++ b/packages/auth/lib/data/common/dio_error_handler.dart @@ -5,10 +5,14 @@ class DioErrorHandler { void handle(DioException error) { switch (error.response?.statusCode) { case 401: - _handle401(); + _handleGeneric(error); break; case 403: - _handle403(); + _handleGeneric(error); + break; + + case 410: + _handle410(); break; default: _handleGeneric(error); @@ -16,21 +20,22 @@ class DioErrorHandler { } //wrong password/user name => "detail": "No active account found with the given credentials" - 401 - void _handle401() { - Get.showSnackbar( - _errorSnackBar('نام کاربری یا رمز عبور اشتباه است'), - ); + void _handle410() { + Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است')); } //wrong captcha => "detail": "Captcha code is incorrect" - 403 - void _handle403() { - Get.showSnackbar( - _errorSnackBar('کد امنیتی اشتباه است'), - ); - } + void _handle403() {} void _handleGeneric(DioException error) { - // General error handling + Get.showSnackbar( + _errorSnackBar( + error.response?.data.keys.first == 'is_user' + ? 'کاربر با این شماره تلفن وجود ندارد' + : error.response?.data[error.response?.data.keys.first] ?? + 'خطا در برقراری ارتباط با سرور', + ), + ); } GetSnackBar _errorSnackBar(String message) { diff --git a/packages/auth/lib/data/common/dio_manager.dart b/packages/auth/lib/data/common/dio_manager.dart index 441485a..bbc17b5 100644 --- a/packages/auth/lib/data/common/dio_manager.dart +++ b/packages/auth/lib/data/common/dio_manager.dart @@ -4,15 +4,21 @@ import 'package:rasadyar_core/core.dart'; import '../di/auth_di.dart'; import 'constant.dart'; +/* class DioRemoteManager { DioRemote? _currentClient; ApiEnvironment? _currentEnv; - Future setEnvironment([ - ApiEnvironment env = ApiEnvironment.dam, - ]) async { + Future setEnvironment([ApiEnvironment env = ApiEnvironment.dam]) async { if (_currentEnv != env) { - _currentClient = DioRemote(env.baseUrl); + _currentClient = DioRemote( + baseUrl: env.baseUrl, + interceptors: AppInterceptor( + refreshTokenCallback: () async{ + return null; + }, + ), + ); await _currentClient?.init(); _currentEnv = env; } @@ -39,7 +45,6 @@ Future switchAuthEnvironment(ApiEnvironment env) async { await diAuth.unregister(); } - diAuth.registerLazySingleton( - () => AuthRepositoryImpl(dioRemote), - ); + diAuth.registerLazySingleton(() => AuthRepositoryImpl(dioRemote)); } +*/ diff --git a/packages/auth/lib/data/di/auth_di.dart b/packages/auth/lib/data/di/auth_di.dart index 190715f..3cb2747 100644 --- a/packages/auth/lib/data/di/auth_di.dart +++ b/packages/auth/lib/data/di/auth_di.dart @@ -1,5 +1,5 @@ -import 'package:rasadyar_auth/data/common/constant.dart'; import 'package:rasadyar_auth/data/common/dio_error_handler.dart'; +import 'package:rasadyar_auth/data/models/response/auth/auth_response_model.dart'; import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart'; import 'package:rasadyar_auth/data/services/token_storage_service.dart'; import 'package:rasadyar_core/core.dart'; @@ -9,13 +9,54 @@ import '../common/dio_manager.dart'; GetIt diAuth = GetIt.instance; Future setupAuthDI() async { - diAuth.registerLazySingleton(() => DioRemoteManager()); + diAuth.registerLazySingleton( + () => AppInterceptor( + refreshTokenCallback: () async { + var tokenService = Get.find(); + final authRepo = diAuth.get(); - final manager = diAuth.get(); - final dioRemote = await manager.setEnvironment(ApiEnvironment.dam); - diAuth.registerCachedFactory( - () => AuthRepositoryImpl(dioRemote), + final refreshToken = tokenService.refreshToken.value; + if (refreshToken == null) return null; + + final result = await authRepo.loginWithRefreshToken( + authRequest: {"refresh_token": refreshToken}, + ); + + if (result is AuthResponseModel) { + await tokenService.saveAccessToken(result.access!); + return result.access; + } + return null; + }, + saveTokenCallback: (String newToken) async { + // + }, + clearTokenCallback: () async { + //await tokenService.clearTokens(); // حذف همه توکن‌ها + }, + ), ); + + diAuth.registerLazySingleton( + () => DioRemote(interceptors: diAuth.get()), + ); + + final dioRemote = diAuth.get(); + await dioRemote.init(); + diAuth.registerSingleton(AuthRepositoryImpl(dioRemote)); diAuth.registerLazySingleton(() => DioErrorHandler()); } + +Future newSetupAuthDI(String newUrl) async { + diAuth.registerLazySingleton( + () => DioRemote(baseUrl: newUrl, interceptors: diAuth.get()), + instanceName: 'newRemote', + ); + final dioRemote = diAuth.get(instanceName: 'newRemote'); + await dioRemote.init(); + diAuth.registerSingleton( + AuthRepositoryImpl(dioRemote), + instanceName: 'newUrl', + ); +} diff --git a/packages/auth/lib/data/models/local/user_local/user_local_model.dart b/packages/auth/lib/data/models/local/user_local/user_local_model.dart index c14addc..beb08f2 100644 --- a/packages/auth/lib/data/models/local/user_local/user_local_model.dart +++ b/packages/auth/lib/data/models/local/user_local/user_local_model.dart @@ -1,9 +1,9 @@ -import 'package:rasadyar_auth/auth.dart'; import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/utils/local/local_utils.dart'; part 'user_local_model.g.dart'; -@HiveType(typeId: 0) +@HiveType(typeId: authUserLocalModelTypeId) class UserLocalModel extends HiveObject { @HiveField(0) String? username; @@ -19,6 +19,12 @@ class UserLocalModel extends HiveObject { @HiveField(5) Module? module; + @HiveField(6) + String? backend; + + @HiveField(7) + String? apiKey; + UserLocalModel({ this.username, this.password, @@ -26,6 +32,8 @@ class UserLocalModel extends HiveObject { this.refreshToken, this.name, this.module, + this.backend, + this.apiKey, }); UserLocalModel copyWith({ @@ -35,6 +43,8 @@ class UserLocalModel extends HiveObject { String? refreshToken, String? name, Module? module, + String? backend, + String? apiKey, }) { return UserLocalModel( username: username ?? this.username, @@ -43,14 +53,18 @@ class UserLocalModel extends HiveObject { refreshToken: refreshToken ?? this.refreshToken, name: name ?? this.name, module: module ?? this.module, + backend: backend ?? this.backend, + apiKey: apiKey ?? this.apiKey, ); } } -@HiveType(typeId: 1) +@HiveType(typeId: authModuleTypeId) enum Module { @HiveField(0) liveStocks, @HiveField(1) inspection, + @HiveField(2) + chicken, } diff --git a/packages/auth/lib/data/models/local/user_local/user_local_model.g.dart b/packages/auth/lib/data/models/local/user_local/user_local_model.g.dart index efaac19..93e49af 100644 --- a/packages/auth/lib/data/models/local/user_local/user_local_model.g.dart +++ b/packages/auth/lib/data/models/local/user_local/user_local_model.g.dart @@ -23,13 +23,15 @@ class UserLocalModelAdapter extends TypeAdapter { 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(6) + ..writeByte(8) ..writeByte(0) ..write(obj.username) ..writeByte(1) @@ -41,7 +43,11 @@ class UserLocalModelAdapter extends TypeAdapter { ..writeByte(4) ..write(obj.name) ..writeByte(5) - ..write(obj.module); + ..write(obj.module) + ..writeByte(6) + ..write(obj.backend) + ..writeByte(7) + ..write(obj.apiKey); } @override @@ -66,6 +72,8 @@ class ModuleAdapter extends TypeAdapter { return Module.liveStocks; case 1: return Module.inspection; + case 2: + return Module.chicken; default: return Module.liveStocks; } @@ -78,6 +86,8 @@ class ModuleAdapter extends TypeAdapter { writer.writeByte(0); case Module.inspection: writer.writeByte(1); + case Module.chicken: + writer.writeByte(2); } } diff --git a/packages/auth/lib/data/models/response/user_info/user_info_model.dart b/packages/auth/lib/data/models/response/user_info/user_info_model.dart new file mode 100644 index 0000000..e1a94ea --- /dev/null +++ b/packages/auth/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/auth/lib/data/models/response/user_info/user_info_model.freezed.dart b/packages/auth/lib/data/models/response/user_info/user_info_model.freezed.dart new file mode 100644 index 0000000..bbb225d --- /dev/null +++ b/packages/auth/lib/data/models/response/user_info/user_info_model.freezed.dart @@ -0,0 +1,157 @@ +// dart format width=80 +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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?, + )); +} + +} + + +/// @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/auth/lib/data/models/response/user_info/user_info_model.g.dart b/packages/auth/lib/data/models/response/user_info/user_info_model.g.dart new file mode 100644 index 0000000..2c8f1c4 --- /dev/null +++ b/packages/auth/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/auth/lib/data/models/response/user_profile_model/user_profile_model.dart b/packages/auth/lib/data/models/response/user_profile_model/user_profile_model.dart new file mode 100644 index 0000000..70a9a40 --- /dev/null +++ b/packages/auth/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/auth/lib/data/models/response/user_profile_model/user_profile_model.freezed.dart b/packages/auth/lib/data/models/response/user_profile_model/user_profile_model.freezed.dart new file mode 100644 index 0000000..0f5e570 --- /dev/null +++ b/packages/auth/lib/data/models/response/user_profile_model/user_profile_model.freezed.dart @@ -0,0 +1,201 @@ +// dart format width=80 +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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?, + )); +} + +} + + +/// @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/auth/lib/data/models/response/user_profile_model/user_profile_model.g.dart b/packages/auth/lib/data/models/response/user_profile_model/user_profile_model.g.dart new file mode 100644 index 0000000..df72e0e --- /dev/null +++ b/packages/auth/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/auth/lib/data/repositories/auth_repository.dart b/packages/auth/lib/data/repositories/auth_repository.dart index eb68705..2f5464c 100644 --- a/packages/auth/lib/data/repositories/auth_repository.dart +++ b/packages/auth/lib/data/repositories/auth_repository.dart @@ -1,12 +1,11 @@ - +import 'package:rasadyar_auth/data/models/response/user_info/user_info_model.dart'; import '../models/response/auth/auth_response_model.dart'; import '../models/response/captcha/captcha_response_model.dart'; +import '../models/response/user_profile_model/user_profile_model.dart'; abstract class AuthRepository { - Future login({ - required Map authRequest, - }); + Future login({required Map authRequest}); Future captcha(); @@ -14,10 +13,9 @@ abstract class AuthRepository { Future hasAuthenticated(); - Future loginWithRefreshToken({ required Map authRequest, }); - + Future getUserInfo(String phoneNumber); } diff --git a/packages/auth/lib/data/repositories/auth_repository_imp.dart b/packages/auth/lib/data/repositories/auth_repository_imp.dart index 6f03fc0..c2ef5d1 100644 --- a/packages/auth/lib/data/repositories/auth_repository_imp.dart +++ b/packages/auth/lib/data/repositories/auth_repository_imp.dart @@ -1,3 +1,5 @@ +import 'package:rasadyar_auth/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_auth/data/models/response/user_profile_model/user_profile_model.dart'; import 'package:rasadyar_core/core.dart'; import '../models/response/auth/auth_response_model.dart'; @@ -11,13 +13,13 @@ class AuthRepositoryImpl implements AuthRepository { AuthRepositoryImpl(this._httpClient); @override - Future login({ + Future login({ required Map authRequest, }) async { - var res = await _httpClient.post( - '$_BASE_URL/login/', + var res = await _httpClient.post( + '/api/login/', data: authRequest, - fromJson: AuthResponseModel.fromJson, + fromJson: UserProfileModel.fromJson, headers: {'Content-Type': 'application/json'}, ); return res.data; @@ -59,4 +61,19 @@ class AuthRepositoryImpl implements AuthRepository { 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/auth/lib/data/services/auth_middelware.dart b/packages/auth/lib/data/services/auth_middelware.dart index ba907ce..14b6227 100644 --- a/packages/auth/lib/data/services/auth_middelware.dart +++ b/packages/auth/lib/data/services/auth_middelware.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:rasadyar_auth/data/di/auth_di.dart'; +import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart'; import 'package:rasadyar_auth/data/services/token_storage_service.dart'; import 'package:rasadyar_core/core.dart'; @@ -14,7 +14,7 @@ class AuthMiddleware extends GetMiddleware { final accessToken = tokenService.accessToken.value; if (refreshToken == null || accessToken == null) { - return RouteSettings(name: AuthPaths.moduleList); + return RouteSettings(name: AuthPaths.auth, arguments: Module.chicken); } return super.redirect(route); } diff --git a/packages/auth/lib/data/services/token_storage_service.dart b/packages/auth/lib/data/services/token_storage_service.dart index 0c56166..d81c591 100644 --- a/packages/auth/lib/data/services/token_storage_service.dart +++ b/packages/auth/lib/data/services/token_storage_service.dart @@ -5,9 +5,12 @@ import 'package:rasadyar_auth/hive_registrar.g.dart'; import 'package:rasadyar_core/core.dart'; class TokenStorageService extends GetxService { - static const String _boxName = 'secureBox'; + 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(); @@ -15,6 +18,7 @@ class TokenStorageService extends GetxService { RxnString accessToken = RxnString(); RxnString refreshToken = RxnString(); + RxnString baseurl = RxnString(); Rxn appModule = Rxn(null); Future init() async { @@ -22,41 +26,61 @@ class TokenStorageService extends GetxService { Hive.registerAdapters(); final String? encryptedKey = await _secureStorage.read(key: 'hive_enc_key'); - final encryptionKey = encryptedKey != null ? base64Url.decode(encryptedKey) : Hive.generateSecureKey(); + 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(_boxName, encryptionCipher: HiveAesCipher(encryptionKey)); + await _localStorage.openBox(_tokenBoxName, encryptionCipher: HiveAesCipher(encryptionKey)); + await _localStorage.openBox(_appBoxName); - accessToken.value = _localStorage.read(boxName: _boxName, key: _accessTokenKey); - refreshToken.value = _localStorage.read(boxName: _boxName, key: _refreshTokenKey); - appModule.value = _localStorage.read(boxName: _boxName, key: _moduleKey); + accessToken.value = _localStorage.read(boxName: _tokenBoxName, key: _accessTokenKey); + refreshToken.value = _localStorage.read(boxName: _tokenBoxName, key: _refreshTokenKey); + appModule.value = _localStorage.read(boxName: _appBoxName, key: _moduleKey); + baseurl.value = _localStorage.read(boxName: _appBoxName, key: _baseUrlKey); } Future saveAccessToken(String token) async { - await _localStorage.save(boxName: _boxName, key: _accessTokenKey, value: token); + await _localStorage.save(boxName: _tokenBoxName, key: _accessTokenKey, value: token); accessToken.value = token; accessToken.refresh(); } Future saveRefreshToken(String token) async { - await _localStorage.save(boxName: _boxName, key: _refreshTokenKey, value: token); + await _localStorage.save(boxName: _tokenBoxName, key: _refreshTokenKey, value: token); refreshToken.value = token; refreshToken.refresh(); } Future saveModule(Module input) async { - await _localStorage.save(boxName: _boxName, key: _moduleKey, value: input); + await _localStorage.save(boxName: _tokenBoxName, key: _moduleKey, value: input); appModule.value = input; appModule.refresh(); } Future deleteTokens() async { - await _localStorage.clear(_boxName); + 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/auth/lib/data/utils/safe_call.dart b/packages/auth/lib/data/utils/safe_call.dart index 6d08637..f850990 100644 --- a/packages/auth/lib/data/utils/safe_call.dart +++ b/packages/auth/lib/data/utils/safe_call.dart @@ -1,12 +1,6 @@ -import 'package:flutter/foundation.dart'; -import 'package:rasadyar_auth/auth.dart'; -import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart'; import 'package:rasadyar_core/core.dart'; -import '../models/response/auth/auth_response_model.dart'; -import '../services/token_storage_service.dart'; - -Future safeCall({ +Future safeCall({ required AppAsyncCallback call, Function(T result)? onSuccess, ErrorCallback? onError, @@ -18,13 +12,8 @@ Future safeCall({ bool showSnackBar = false, Function()? onShowLoading, Function()? onHideLoading, - Function()? onShowSuccessMessage, - Function()? onShowErrorMessage, }) { - final authRepository = diAuth.get(); - TokenStorageService tokenStorageService = Get.find(); - - return gSafeCall( + return gSafeCall( call: call, onSuccess: onSuccess, onError: onError, @@ -32,30 +21,7 @@ Future safeCall({ showLoading: showLoading, showError: showError, showSuccess: showSuccess, - showToast: showToast, - showSnackBar: showSnackBar, onShowLoading: onShowLoading, onHideLoading: onHideLoading, - onShowSuccessMessage: onShowSuccessMessage, - onShowErrorMessage: onShowErrorMessage, - retryOnAuthError: true, - onTokenRefresh: () { - var token = tokenStorageService.refreshToken.value; - authRepository - .loginWithRefreshToken(authRequest: {"refresh_token": token}) - .then((value) async { - if (value is AuthResponseModel) { - await tokenStorageService.saveAccessToken(value.access!); - } else { - throw Exception("Failed to refresh token"); - } - }) - .catchError((error) { - if (kDebugMode) { - print('Error during token refresh: $error'); - } - throw error; - }); - }, ); -} +} \ No newline at end of file diff --git a/packages/auth/lib/hive_registrar.g.dart b/packages/auth/lib/hive_registrar.g.dart index b46fdff..166b5cb 100644 --- a/packages/auth/lib/hive_registrar.g.dart +++ b/packages/auth/lib/hive_registrar.g.dart @@ -7,9 +7,8 @@ import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart extension HiveRegistrar on HiveInterface { void registerAdapters() { - registerAdapter(UserLocalModelAdapter()); registerAdapter(ModuleAdapter()); - + registerAdapter(UserLocalModelAdapter()); } } diff --git a/packages/auth/lib/presentation/pages/auth/logic.dart b/packages/auth/lib/presentation/pages/auth/logic.dart index 68fc5eb..a339239 100644 --- a/packages/auth/lib/presentation/pages/auth/logic.dart +++ b/packages/auth/lib/presentation/pages/auth/logic.dart @@ -4,7 +4,8 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_auth/auth.dart'; import 'package:rasadyar_auth/data/common/dio_error_handler.dart'; import 'package:rasadyar_auth/data/models/request/login_request/login_request_model.dart'; -import 'package:rasadyar_auth/data/models/response/auth/auth_response_model.dart'; +import 'package:rasadyar_auth/data/models/response/user_info/user_info_model.dart'; +import 'package:rasadyar_auth/data/models/response/user_profile_model/user_profile_model.dart'; import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart'; import 'package:rasadyar_auth/data/services/token_storage_service.dart'; import 'package:rasadyar_auth/data/utils/safe_call.dart'; @@ -26,14 +27,14 @@ class AuthLogic extends GetxController { Rx> formKeySentOtp = GlobalKey().obs; Rx usernameController = TextEditingController().obs; Rx passwordController = TextEditingController().obs; - Rx phoneOtpNumberController = - 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; @@ -70,15 +71,11 @@ class AuthLogic extends GetxController { return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}'; } - @override - void onInit() { - super.onInit(); - } @override void onReady() { super.onReady(); - iLog('module111 : ${_module.toString()}'); + iLog('module selected : ${_module.toString()}'); } @override @@ -88,8 +85,7 @@ class AuthLogic extends GetxController { } bool _isFormValid() { - final isCaptchaValid = - captchaController.formKey.currentState?.validate() ?? false; + final isCaptchaValid = captchaController.formKey.currentState?.validate() ?? false; final isFormValid = formKey.currentState?.validate() ?? false; return isCaptchaValid && isFormValid; } @@ -108,7 +104,7 @@ class AuthLogic extends GetxController { ); } - Future submitLoginForm() async { + /*Future submitLoginForm() async { if (!_isFormValid()) return; iLog('module222 : ${_module.toString()}'); final loginRequestModel = _buildLoginRequest(); @@ -128,5 +124,52 @@ class AuthLogic extends GetxController { }, ); 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": phoneNumberController.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/auth/lib/presentation/pages/auth/view.dart b/packages/auth/lib/presentation/pages/auth/view.dart index aae44e6..80215ad 100644 --- a/packages/auth/lib/presentation/pages/auth/view.dart +++ b/packages/auth/lib/presentation/pages/auth/view.dart @@ -27,28 +27,31 @@ class AuthPage extends GetView { } }, controller.authType), - SizedBox(height: 50), + SizedBox(height: 20), RichText( text: TextSpan( children: [ TextSpan( text: 'مطالعه بیانیه ', - style: AppFonts.yekan14.copyWith( - color: AppColor.darkGreyDark, - ), + style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark), ), TextSpan( recognizer: TapGestureRecognizer() - ..onTap = () {}, + ..onTap = () { + Get.bottomSheet( + privacyPolicyWidget(), + isScrollControlled: true, + enableDrag: true, + ignoreSafeArea: false, + ); + }, text: 'حریم خصوصی', - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), + style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal), ), ], ), ), - SizedBox(height: 18), + /* SizedBox(height: 18), ObxValue((types) { return RichText( @@ -80,7 +83,7 @@ class AuthPage extends GetView { ], ), ); - }, controller.authType), + }, controller.authType),*/ ], ), ), @@ -92,120 +95,201 @@ class AuthPage extends GetView { padding: EdgeInsets.symmetric(horizontal: 30, vertical: 50), child: Form( key: controller.formKey, - child: Column( - children: [ - ObxValue( - (phoneController) => - RTextField( - label: 'نام کاربری', - maxLength: 11, - maxLines: 1, - controller: phoneController.value, - keyboardType: TextInputType.text, - initText: phoneController.value.text, - onChanged: (value) { - phoneController.value.text = value; - phoneController.refresh(); - }, - prefixIcon: Padding( - padding: const EdgeInsets.fromLTRB(0, 8, 6, 8), - child: Assets.vec.callSvg.svg( - width: 12, - height: 12, - ), - ), - suffixIcon: - phoneController.value.text - .trim() - .isNotEmpty - ? clearButton(() { - phoneController.value.clear(); - phoneController.refresh(); - }) - : null, - validator: (value) { - if (value == null || value.isEmpty) { - return '⚠️ شماره موبایل را وارد کنید'; - } - /*else if (value.length < 11) { - 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, - ), - ), - controller.usernameController, - ), - const SizedBox(height: 26), - ObxValue( - (passwordController) => - RTextField( - label: 'رمز عبور', - filled: false, - controller: passwordController.value, - 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), - ObxValue((data) { - return RElevated( - text: 'ورود', - isLoading: data.value, - onPressed: () async { - await controller.submitLoginForm(); + child: AutofillGroup( + child: Column( + children: [ + RTextField( + label: 'نام کاربری', + maxLength: 11, + maxLines: 1, + controller: controller.phoneNumberController.value, + keyboardType: TextInputType.number, + initText: controller.phoneNumberController.value.text, + autofillHints: [AutofillHints.username], + onChanged: (value) async { + controller.phoneNumberController.value.text = value; + controller.phoneNumberController.refresh(); + if (value.length == 11) { + await controller.getUserInfo(value); + } }, - width: Get.width, - height: 48, - ); - }, controller.isLoading), - ], + prefixIcon: Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 6, 8), + child: Assets.vec.callSvg.svg(width: 12, height: 12), + ), + suffixIcon: controller.phoneNumberController.value.text.trim().isNotEmpty + ? clearButton(() { + controller.phoneNumberController.value.clear(); + controller.phoneNumberController.refresh(); + }) + : null, + validator: (value) { + if (value == null || value.isEmpty) { + return '⚠️ شماره موبایل را وارد کنید'; + } else if (value.length < 11) { + 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, + 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.submitLoginForm2(); + }, + 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( diff --git a/packages/auth/lib/presentation/pages/modules/logic.dart b/packages/auth/lib/presentation/pages/modules/logic.dart index bf9692c..56637e5 100644 --- a/packages/auth/lib/presentation/pages/modules/logic.dart +++ b/packages/auth/lib/presentation/pages/modules/logic.dart @@ -7,6 +7,7 @@ class ModulesLogic extends GetxController { 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), ]; diff --git a/packages/auth/lib/presentation/widget/captcha/logic.dart b/packages/auth/lib/presentation/widget/captcha/logic.dart index 6a89f38..7a5ebcf 100644 --- a/packages/auth/lib/presentation/widget/captcha/logic.dart +++ b/packages/auth/lib/presentation/widget/captcha/logic.dart @@ -1,15 +1,17 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; import 'package:rasadyar_auth/data/di/auth_di.dart'; import 'package:rasadyar_auth/data/models/response/captcha/captcha_response_model.dart'; import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart'; -import 'package:rasadyar_auth/data/utils/safe_call.dart'; import 'package:rasadyar_core/core.dart'; class CaptchaWidgetLogic extends GetxController with StateMixin { - Rx textController = TextEditingController().obs; + TextEditingController textController = TextEditingController(); RxnString captchaKey = RxnString(); GlobalKey formKey = GlobalKey(); AuthRepositoryImpl authRepository = diAuth.get(); + final Random random = Random(); @override void onInit() { @@ -20,22 +22,17 @@ class CaptchaWidgetLogic extends GetxController with StateMixin getCaptcha() async { change(null, status: RxStatus.loading()); - textController.value.clear(); - safeCall( - call: () async => await authRepository.captcha(), - onSuccess: (value) { - captchaKey.value = value?.captchaKey; - change(value, status: RxStatus.success()); - }, - onError: (error, stackTrace) { - change(null, status: RxStatus.error(error.toString())); - }, - ); + textController.clear(); + await Future.delayed(Duration(milliseconds: 800)); + captchaKey.value = (random.nextInt(900000)+100000).toString(); + change(value, status: RxStatus.success()); + } } diff --git a/packages/auth/lib/presentation/widget/captcha/view.dart b/packages/auth/lib/presentation/widget/captcha/view.dart index d606b7b..4b66206 100644 --- a/packages/auth/lib/presentation/widget/captcha/view.dart +++ b/packages/auth/lib/presentation/widget/captcha/view.dart @@ -1,7 +1,8 @@ -import 'dart:convert'; +import 'dart:math'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:rasadyar_auth/presentation/pages/auth/logic.dart'; import 'package:rasadyar_auth/presentation/widget/clear_button.dart'; import 'package:rasadyar_core/core.dart'; @@ -16,73 +17,93 @@ class CaptchaWidget extends GetView { 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), + 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) => Center( + child: Text( + controller.captchaKey.value ?? 'دوباره سعی کنید', + style: AppFonts.yekan24Bold, ), - onError: (error) { - return const Center( - child: Text( - 'خطا در بارگذاری کد امنیتی', - style: AppFonts.yekan13, - ), - ); - }, ), - )), + 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: ObxValue((data) { - return RTextField( - label: 'کد امنیتی', - controller: data.value, - keyboardType: TextInputType.numberWithOptions( - decimal: false, - signed: false, - ), - maxLines: 1, - maxLength: 6, - suffixIcon: - (data.value.text - .trim() - .isNotEmpty ?? false) - ? clearButton( - () => controller.textController.value.clear(), - ) - : null, + child: RTextField( + label: 'کد امنیتی', + controller: controller.textController, + keyboardType: TextInputType.numberWithOptions(decimal: false, signed: false), + maxLines: 1, + maxLength: 6, + suffixIcon: (controller.textController.text.trim().isNotEmpty ?? false) + ? clearButton(() => controller.textController.clear()) + : null, - onSubmitted: (data) {}, - validator: (value) { - if (value == null || value.isEmpty) { - return 'کد امنیتی را وارد کنید'; + validator: (value) { + if (value == null || value.isEmpty) { + return 'کد امنیتی را وارد کنید'; + } else if (controller.captchaKey.value != null && + controller.captchaKey.value != value) { + return 'کد امنیتی اشتباه است'; + } + return null; + }, + onChanged: (pass) { + if (pass.length == 6) { + if (controller.formKey.currentState?.validate() ?? false) { + Get.find().isDisabled.value = false; } - return null; - }, - style: AppFonts.yekan13, - ); - }, controller.textController), + } + }, + 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/auth/pubspec.yaml b/packages/auth/pubspec.yaml index 09c3e4f..15678f6 100644 --- a/packages/auth/pubspec.yaml +++ b/packages/auth/pubspec.yaml @@ -1,6 +1,6 @@ name: rasadyar_auth description: "A new Flutter project." -version: 1.0.2 +version: 1.0.3 publish_to: 'none' @@ -15,17 +15,17 @@ dependencies: rasadyar_core: path: ../core ##code generation - freezed_annotation: ^3.0.0 + freezed_annotation: ^3.1.0 json_annotation: ^4.9.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 ##code generation - build_runner: ^2.4.15 - hive_ce_generator: ^1.9.1 - freezed: ^3.0.6 - json_serializable: ^6.9.4 + 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 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/common/dio_manager.dart b/packages/chicken/lib/data/common/dio_manager.dart new file mode 100644 index 0000000..3b1a566 --- /dev/null +++ b/packages/chicken/lib/data/common/dio_manager.dart @@ -0,0 +1,33 @@ +import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart'; +import 'package:rasadyar_core/core.dart'; + +import '../di/chicken_di.dart'; +import 'constant.dart'; + +/*class DioRemoteManager { + DioRemote? _currentClient; + ApiEnvironment? _currentEnv; + + Future setEnvironment([ + ApiEnvironment env = ApiEnvironment.dam, + ]) async { + if (_currentEnv != env) { + _currentClient = DioRemote(baseUrl: env.baseUrl); + await _currentClient?.init(); + _currentEnv = env; + } + return _currentClient!; + } + + DioRemote get currentClient { + if (_currentClient == null) { + throw Exception('Call setEnvironment() before accessing DioRemote.'); + } + + return _currentClient!; + } + + ApiEnvironment? get currentEnv => _currentEnv; +}*/ + + diff --git a/packages/chicken/lib/data/datasource/local/chicken_local.dart b/packages/chicken/lib/data/datasource/local/chicken_local.dart new file mode 100644 index 0000000..e02478a --- /dev/null +++ b/packages/chicken/lib/data/datasource/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/datasource/local/chicken_local_imp.dart b/packages/chicken/lib/data/datasource/local/chicken_local_imp.dart new file mode 100644 index 0000000..663af1f --- /dev/null +++ b/packages/chicken/lib/data/datasource/local/chicken_local_imp.dart @@ -0,0 +1,57 @@ +import 'package:rasadyar_chicken/chicken.dart'; +import 'package:rasadyar_chicken/data/datasource/local/chicken_local.dart'; +import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'; +import 'package:rasadyar_core/core.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/datasource/remote/chicken_remote.dart b/packages/chicken/lib/data/datasource/remote/chicken_remote.dart new file mode 100644 index 0000000..e6f04b8 --- /dev/null +++ b/packages/chicken/lib/data/datasource/remote/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/datasource/remote/chicken_remote_imp.dart b/packages/chicken/lib/data/datasource/remote/chicken_remote_imp.dart new file mode 100644 index 0000000..700f669 --- /dev/null +++ b/packages/chicken/lib/data/datasource/remote/chicken_remote_imp.dart @@ -0,0 +1,484 @@ +import 'package:rasadyar_chicken/data/datasource/remote/chicken_remote.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'; + +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..bf68d7b --- /dev/null +++ b/packages/chicken/lib/data/di/chicken_di.dart @@ -0,0 +1,57 @@ +import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart'; +import 'package:rasadyar_auth/data/services/token_storage_service.dart'; +import 'package:rasadyar_auth/presentation/routes/pages.dart'; +import 'package:rasadyar_chicken/data/datasource/local/chicken_local_imp.dart'; +import 'package:rasadyar_chicken/data/datasource/remote/chicken_remote_imp.dart'; +import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart'; +import 'package:rasadyar_chicken/hive_registrar.g.dart'; +import 'package:rasadyar_core/core.dart'; + +GetIt diChicken = GetIt.instance; + +Future setupChickenDI() async { + var tokenService = Get.find(); + Hive.registerAdapters(); + diChicken.registerLazySingleton(() => ChickenLocalDataSourceImp()); + diChicken.get().openBox(); + + diChicken.registerLazySingleton( + () => AppInterceptor( + //فعلا سامانه مرغ برای رفرش توکن چیزی ندارد + refreshTokenCallback: () async => null, + saveTokenCallback: (String newToken) async { + await tokenService.saveAccessToken(newToken); + }, + clearTokenCallback: () async { + await tokenService.deleteTokens(); + Get.offAllNamed(AuthPaths.auth, arguments: Module.chicken); + }, + authArguments: Module.chicken, + ), + instanceName: 'chickenInterceptor', + ); + + tokenService.getBaseUrl(); + + diChicken.registerLazySingleton(() { + return DioRemote( + baseUrl: tokenService.baseurl.value, + interceptors: diChicken.get(instanceName: 'chickenInterceptor'), + ); + }, instanceName: 'chickenDioRemote'); + + final dioRemote = diChicken.get(instanceName: 'chickenDioRemote'); + + await dioRemote.init(); + + diChicken.registerLazySingleton(() => ChickenRemoteDatasourceImp(dioRemote)); + + diChicken.registerLazySingleton( + () => ChickenRepositoryImp( + local: diChicken.get(), + remote: diChicken.get(), + ), + ); + + diChicken.registerSingleton(ImagePicker()); +} 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/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/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/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_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/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/chicken_repository.dart b/packages/chicken/lib/data/repositories/chicken_repository.dart new file mode 100644 index 0000000..1d0aee9 --- /dev/null +++ b/packages/chicken/lib/data/repositories/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_repository_imp.dart b/packages/chicken/lib/data/repositories/chicken_repository_imp.dart new file mode 100644 index 0000000..6eaf786 --- /dev/null +++ b/packages/chicken/lib/data/repositories/chicken_repository_imp.dart @@ -0,0 +1,335 @@ +import 'package:rasadyar_chicken/data/datasource/local/chicken_local_imp.dart'; +import 'package:rasadyar_chicken/data/datasource/remote/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/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..b9dfcef --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart @@ -0,0 +1,146 @@ +import 'package:rasadyar_auth/data/utils/safe_call.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_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..bb2586b --- /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'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; +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 ListItem2( + 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..c2efb00 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart @@ -0,0 +1,161 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:rasadyar_auth/data/utils/safe_call.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..d439b53 --- /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'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; +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 ListItem2( + 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..2defabc --- /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_auth/data/utils/safe_call.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..7b85d9b --- /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_chicken/presentation/widget/list_item/list_item.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.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 ListItem2( + 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..d1b89f9 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/home/logic.dart @@ -0,0 +1,70 @@ +import 'package:rasadyar_auth/data/utils/safe_call.dart'; +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..65b318f --- /dev/null +++ b/packages/chicken/lib/presentation/pages/profile/logic.dart @@ -0,0 +1,149 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_auth/data/utils/safe_call.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..78baaa6 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/profile/view.dart @@ -0,0 +1,644 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart'; +import 'package:rasadyar_auth/presentation/routes/pages.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/widget/list_row_item.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(AuthPaths.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..1994afc --- /dev/null +++ b/packages/chicken/lib/presentation/pages/root/logic.dart @@ -0,0 +1,161 @@ +import 'dart:async'; + +import 'package:flutter/widgets.dart'; +import 'package:rasadyar_auth/data/services/token_storage_service.dart'; +import 'package:rasadyar_auth/data/utils/safe_call.dart'; +import 'package:rasadyar_chicken/data/datasource/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_repository.dart'; +import 'package:rasadyar_chicken/data/repositories/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..6579a21 --- /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, 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..5f3ff7e --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sale/logic.dart @@ -0,0 +1,117 @@ +import 'package:rasadyar_auth/data/utils/safe_call.dart'; +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..27f86a7 --- /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_auth/data/utils/safe_call.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..7b5afb6 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart @@ -0,0 +1,832 @@ +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/list_item/list_item.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.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 ListItem2( + 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..53c3f3a --- /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_auth/data/utils/safe_call.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..8ee11f9 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart @@ -0,0 +1,527 @@ +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/list_item/list_item.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.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 ListItem2( + 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..39344b8 --- /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_auth/data/utils/safe_call.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..e04807c --- /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/list_item/list_item.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.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 ListItem2( + 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..944f546 --- /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_auth/data/utils/safe_call.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..6ea37ba --- /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'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart'; +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 ListItem2( + 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..7844168 --- /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_auth/data/utils/safe_call.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..b3b898d --- /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_chicken/presentation/widget/list_item/list_item.dart'; +import 'package:rasadyar_chicken/presentation/widget/list_row_item.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 ListItem2( + 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..531fa16 --- /dev/null +++ b/packages/chicken/lib/presentation/routes/pages.dart @@ -0,0 +1,138 @@ +import 'package:rasadyar_auth/auth.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/search/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +sealed class ChickenPages { + ChickenPages._(); + + static final pages = [ + 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..f880d94 --- /dev/null +++ b/packages/chicken/lib/presentation/routes/routes.dart @@ -0,0 +1,21 @@ +sealed class ChickenRoutes { + ChickenRoutes._(); + + 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..e3fd48d --- /dev/null +++ b/packages/chicken/lib/presentation/utils/utils.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart'; +import 'package:rasadyar_auth/presentation/routes/pages.dart'; +import 'package:rasadyar_core/core.dart'; + + + +const int timeDebounce = 1200; + + +void handleGeneric(DioException error,[void Function()? onError]) { + Get.showSnackbar(_errorSnackBar('اعتبار توکن شما منقضی شده است لطفا دوباره وارد شوید')); + + Get.offAllNamed(AuthPaths.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, + ); +} \ No newline at end of file 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/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/list_row_item.dart b/packages/chicken/lib/presentation/widget/list_row_item.dart new file mode 100644 index 0000000..cd6bdaf --- /dev/null +++ b/packages/chicken/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/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..ed00202 --- /dev/null +++ b/packages/chicken/pubspec.yaml @@ -0,0 +1,33 @@ +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 + rasadyar_auth: + path: ../auth + ##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/lib/core.dart b/packages/core/lib/core.dart index 0197984..c4a96f8 100644 --- a/packages/core/lib/core.dart +++ b/packages/core/lib/core.dart @@ -1,44 +1,54 @@ 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'; -export 'package:hive_ce_flutter/hive_flutter.dart'; //freezed export 'package:freezed_annotation/freezed_annotation.dart'; export 'package:geolocator/geolocator.dart'; -export 'package:get/get.dart'; +export 'package:get/get.dart' hide FormData, MultipartFile, Response; //di export 'package:get_it/get_it.dart'; -export 'injection/di.dart'; - //local storage export 'package:hive_ce_flutter/hive_flutter.dart'; -export 'package:flutter_secure_storage/flutter_secure_storage.dart'; -export 'infrastructure/local/hive_local_storage.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: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'; - -//network -export 'infrastructure/remote/dio_form_data.dart'; -export 'infrastructure/remote/dio_remote.dart'; -export 'infrastructure/remote/dio_response.dart'; -export 'package:dio/dio.dart' show DioException; - +//models +export 'data/model/pagination_model/pagination_model.dart'; +//infrastructure +export 'infrastructure/infrastructure.dart'; +export 'infrastructure/local/hive_local_storage.dart'; +export 'injection/di.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/safe_call_utils.dart'; +export 'utils/map_utils.dart'; +export 'utils/network/network.dart'; +export 'utils/route_utils.dart'; +export 'utils/separator_input_formatter.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..cb35b63 --- /dev/null +++ b/packages/core/lib/data/model/pagination_model/pagination_model.freezed.dart @@ -0,0 +1,165 @@ +// dart format width=80 +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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?, + )); +} + +} + + +/// @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/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 index 53b7b55..fb3142e 100644 --- a/packages/core/lib/infrastructure/local/hive_local_storage.dart +++ b/packages/core/lib/infrastructure/local/hive_local_storage.dart @@ -1,17 +1,15 @@ import 'package:flutter/foundation.dart'; import 'package:rasadyar_core/core.dart'; -import 'i_local_storage.dart'; - class HiveLocalStorage implements ILocalStorage { - HiveLocalStorage() { - Hive.initFlutter(); - } - - final Map _boxes = {}; - @override - Future init() async => await Hive.initFlutter(); + Future init() async { + if (kIsWeb) { + Hive.init('hive_storage_rasadyar'); + } else { + await Hive.initFlutter(); + } + } @override Future openBox( @@ -22,13 +20,13 @@ class HiveLocalStorage implements ILocalStorage { Uint8List? bytes, String? collection, }) async { - if (!_boxes.containsKey(boxName)) { - final box = await Hive.openBox( + var exist = await Hive.boxExists(boxName); + if (!exist || !Hive.isBoxOpen(boxName)) { + await Hive.openBox( boxName, encryptionCipher: encryptionCipher, crashRecovery: crashRecovery, ); - _boxes[boxName] = box; } } @@ -44,69 +42,62 @@ class HiveLocalStorage implements ILocalStorage { } @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'); + 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 clear(String boxName) async { - await _boxes[boxName]?.clear(); + Future add({required String boxName, required dynamic value}) async { + Box? box = getBox(boxName); + await box?.add(value); } @override - Future close(String boxName) async => await _boxes[boxName]?.close(); + 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 deleteValue({ - required String boxName, - required String key, - }) async { - Box? box = getBox(boxName); + 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); + 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); + 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); + 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 index 7cb4f49..55026de 100644 --- a/packages/core/lib/infrastructure/local/i_local_storage.dart +++ b/packages/core/lib/infrastructure/local/i_local_storage.dart @@ -15,30 +15,21 @@ abstract class ILocalStorage { T? read({required String boxName, required String key}); - Future deleteValue({required String boxName, required String key}); + List? readBox({required String boxName}); - Future add({required String boxName, required E value}); + Future deleteValue({required String boxName, required String key}); - Future addAll({required String boxName, required Iterable values}); + 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 save({required String boxName, required String key, required dynamic value}); - Future saveAt({ - required String boxName, - required int index, - required dynamic value, - }); + Future saveAt({required String boxName, required int index, required dynamic value}); - Future saveAll({ - required String boxName, - required Map entries, - }); + 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_remote.dart b/packages/core/lib/infrastructure/remote/dio_remote.dart index c8f0189..3cfcd98 100644 --- a/packages/core/lib/infrastructure/remote/dio_remote.dart +++ b/packages/core/lib/infrastructure/remote/dio_remote.dart @@ -1,28 +1,32 @@ -import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; -import 'package:pretty_dio_logger/pretty_dio_logger.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_core/infrastructure/remote/interfaces/i_form_data.dart'; - -import 'interfaces/i_http_client.dart'; class DioRemote implements IHttpClient { - final String baseUrl; - late final Dio _dio; + String? baseUrl; + late Dio dio; + AppInterceptor? interceptors; - DioRemote(this.baseUrl); + DioRemote({this.baseUrl, this.interceptors}); @override Future init() async { - final dio = Dio(BaseOptions(baseUrl: baseUrl)); - if (kDebugMode) { - dio.interceptors.add(PrettyDioLogger( - requestHeader: true, - responseHeader: true, - requestBody: true - )); + 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, + ), + ); } - _dio = dio; } @override @@ -31,13 +35,24 @@ class DioRemote implements IHttpClient { Map? queryParameters, Map? headers, ProgressCallback? onReceiveProgress, + T Function(Map json)? fromJson, + T Function(List json)? fromJsonList, }) async { - final response = await _dio.get( + final response = await dio.get( path, queryParameters: queryParameters, options: Options(headers: headers), onReceiveProgress: onReceiveProgress, + cancelToken: ApiHandler.globalCancelToken, ); + 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); } @@ -51,24 +66,24 @@ class DioRemote implements IHttpClient { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final response = await _dio.post( + 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; + final parsedData = rawData is Map ? fromJson(rawData) : null; response.data = parsedData; return DioResponse(response); } - return DioResponse(response ); + return DioResponse(response); } @override @@ -79,15 +94,22 @@ class DioRemote implements IHttpClient { Map? headers, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, + T Function(Map json)? fromJson, }) async { - final response = await _dio.put( + 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); } @@ -97,13 +119,21 @@ class DioRemote implements IHttpClient { dynamic data, Map? queryParameters, Map? headers, + T Function(Map json)? fromJson, }) async { - final response = await _dio.delete( + 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); } @@ -112,10 +142,11 @@ class DioRemote implements IHttpClient { String url, { ProgressCallback? onReceiveProgress, }) async { - final response = await _dio.get( + final response = await dio.get( url, options: Options(responseType: ResponseType.bytes), onReceiveProgress: onReceiveProgress, + cancelToken: ApiHandler.globalCancelToken, ); return DioResponse(response); } @@ -127,11 +158,12 @@ class DioRemote implements IHttpClient { Map? headers, ProgressCallback? onSendProgress, }) async { - final response = await _dio.post( + 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/injection/di.dart b/packages/core/lib/injection/di.dart index 8e1c1b2..9df3a5f 100644 --- a/packages/core/lib/injection/di.dart +++ b/packages/core/lib/injection/di.dart @@ -17,6 +17,7 @@ Future _setUpLogger() async{ Future _setupLocalStorage() async { diCore.registerSingleton(HiveLocalStorage()); + print('====> HiveLocalStorage registered'); } diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart index 8116ba2..f676d19 100644 --- a/packages/core/lib/presentation/common/app_color.dart +++ b/packages/core/lib/presentation/common/app_color.dart @@ -4,370 +4,175 @@ 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 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 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 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 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 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 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 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 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) + 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 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) + 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) + 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 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 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 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 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 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 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 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 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) //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 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 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); + //endregion //region --- category Colors --- static const Color confirm = greenNormalActive; - static const Color warning =yellowNormal; - static const Color error =redNormal; + 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 index c850c32..72c1d45 100644 --- a/packages/core/lib/presentation/common/app_fonts.dart +++ b/packages/core/lib/presentation/common/app_fonts.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class AppFonts { AppFonts._(); // Private constructor to prevent instantiation @@ -11,179 +12,196 @@ class AppFonts { static const FontWeight bold = FontWeight.w600; static const double _height = 1.20; - static const TextStyle yekan61 = TextStyle( + static TextStyle yekan61 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 61, + fontSize: 61.sp, height: _height, ); - static const TextStyle yekan49 = TextStyle( + static TextStyle yekan49 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 48, + fontSize: 48.sp, height: _height, ); - static const TextStyle yekan39 = TextStyle( + static TextStyle yekan39 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 39, + fontSize: 39.sp, height: _height, ); - static const TextStyle yekan31 = TextStyle( + static TextStyle yekan31 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 31, + fontSize: 31.sp, height: _height, ); - static const TextStyle yekan25 = TextStyle( + static TextStyle yekan25 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 25, + fontSize: 25.sp, height: _height, ); - static const TextStyle yekan24 = TextStyle( + static TextStyle yekan24 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 24, + fontSize: 24.sp, height: _height, ); - static const TextStyle yekan20 = TextStyle( + static TextStyle yekan20 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 20, + fontSize: 20.sp, height: _height, ); - static const TextStyle yekan18 = TextStyle( + static TextStyle yekan18 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 18, + fontSize: 18.sp, height: _height, ); - static const TextStyle yekan16 = TextStyle( + static TextStyle yekan16 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 16, + fontSize: 16.sp, height: _height, ); - static const TextStyle yekan14 = TextStyle( + static TextStyle yekan14 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 13, + fontSize: 13.sp, height: _height, ); - static const TextStyle yekan13 = TextStyle( + static TextStyle yekan13 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 13, + fontSize: 13.sp, height: _height, ); - static const TextStyle yekan12 = TextStyle( + static TextStyle yekan12 = TextStyle( fontFamily: yekan, fontWeight: regular, - fontSize: 12, + fontSize: 12.sp, height: _height, ); - static const TextStyle yekan10 = TextStyle( + static TextStyle yekan10 = TextStyle( // Rounded from 10.24 fontFamily: yekan, fontWeight: regular, - fontSize: 10, + fontSize: 10.sp, height: _height, ); - static const TextStyle yekan8= TextStyle( + static TextStyle yekan8= TextStyle( // Rounded from 10.24 fontFamily: yekan, fontWeight: regular, - fontSize: 8, + fontSize: 8.sp, height: _height, ); - static const TextStyle yekan61Bold = TextStyle( + static TextStyle yekan61Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 61, + fontSize: 61.sp, height: _height, ); - static const TextStyle yekan49Bold = TextStyle( + static TextStyle yekan49Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 48, + fontSize: 48.sp, height: _height, ); - static const TextStyle yekan39Bold = TextStyle( + static TextStyle yekan39Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 39, + fontSize: 39.sp, height: _height, ); - static const TextStyle yekan31Bold = TextStyle( + static TextStyle yekan31Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 31, + fontSize: 31.sp, height: _height, ); - static const TextStyle yekan25Bold = TextStyle( + static TextStyle yekan25Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 25, + fontSize: 25.sp, height: _height, ); - static const TextStyle yekan24Bold = TextStyle( + static TextStyle yekan24Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 24, + fontSize: 24.sp, height: _height, ); - static const TextStyle yekan20Bold = TextStyle( + static TextStyle yekan20Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 20, + fontSize: 20.sp, height: _height, ); - static const TextStyle yekan16Bold = TextStyle( + static TextStyle yekan16Bold = TextStyle( // Base size bold fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 16, + fontSize: 16.sp, height: _height, ); - static const TextStyle yekan13Bold = TextStyle( + + static TextStyle yekan14Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 13, + fontSize: 13.sp, height: _height, ); - static const TextStyle yekan10Bold = TextStyle( + + static TextStyle yekan13Bold = TextStyle( fontFamily: yekan, fontWeight: bold, // Use bold weight - fontSize: 10, + 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 index c289778..9eda0b7 100644 --- a/packages/core/lib/presentation/common/assets.gen.dart +++ b/packages/core/lib/presentation/common/assets.gen.dart @@ -1,3 +1,5 @@ +// dart format width=120 + /// GENERATED CODE - DO NOT MODIFY BY HAND /// ***************************************************** /// FlutterGen @@ -5,16 +7,33 @@ // coverage:ignore-file // ignore_for_file: type=lint -// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use +// 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'); @@ -27,6 +46,9 @@ class $AssetsIconsGen { /// 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'); @@ -36,6 +58,54 @@ class $AssetsIconsGen { /// 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/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/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_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'); @@ -45,18 +115,33 @@ class $AssetsIconsGen { /// 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'); @@ -66,6 +151,9 @@ class $AssetsIconsGen { /// 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'); @@ -78,6 +166,9 @@ class $AssetsIconsGen { /// 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'); @@ -96,6 +187,9 @@ class $AssetsIconsGen { /// 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'); @@ -111,70 +205,131 @@ class $AssetsIconsGen { /// File path: assets/icons/setting.svg SvgGenImage get setting => const SvgGenImage('assets/icons/setting.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, arrowLeft, arrowRight, bgHeaderUserProfile, + buy, calendar, calendarSearch, call, + check, + checkSquare, + chicken, + clipboardEye, + clipboardTask, + clock, + closeCircle, + closeSquare, + convertCube, + cube, + cubeBottomRotation, + 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, pictureFrame, placeHolder, profileCircle, profileUser, receiptDiscount, + sale, scan, scanBarcode, search, securityTime, setting, + 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'); @@ -185,12 +340,25 @@ class $AssetsImagesGen { AssetGenImage get placeHolder => const AssetGenImage('assets/images/place_holder.png'); /// List of all assets - List get values => [innerSplash, outterSplash, placeHolder]; + 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'); @@ -203,6 +371,9 @@ class $AssetsVecGen { /// 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'); @@ -212,6 +383,54 @@ class $AssetsVecGen { /// 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/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/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_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'); @@ -221,18 +440,33 @@ class $AssetsVecGen { /// 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'); @@ -242,6 +476,9 @@ class $AssetsVecGen { /// 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'); @@ -254,6 +491,9 @@ class $AssetsVecGen { /// 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'); @@ -272,6 +512,9 @@ class $AssetsVecGen { /// 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'); @@ -287,82 +530,143 @@ class $AssetsVecGen { /// File path: assets/vec/setting.svg.vec SvgGenImage get settingSvg => const SvgGenImage.vec('assets/vec/setting.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, arrowLeftSvg, arrowRightSvg, bgHeaderUserProfileSvg, + buySvg, calendarSvg, calendarSearchSvg, callSvg, + checkSvg, + checkSquareSvg, + chickenSvg, + clipboardEyeSvg, + clipboardTaskSvg, + clockSvg, + closeCircleSvg, + closeSquareSvg, + convertCubeSvg, + cubeSvg, + cubeBottomRotationSvg, + 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, pictureFrameSvg, placeHolderSvg, profileCircleSvg, profileUserSvg, receiptDiscountSvg, + saleSvg, scanSvg, scanBarcodeSvg, searchSvg, securityTimeSvg, settingSvg, + 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 {}}); + 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, @@ -426,6 +730,14 @@ class AssetGenImage { 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; @@ -450,6 +762,7 @@ class SvgGenImage { String? semanticsLabel, bool excludeFromSemantics = false, _svg.SvgTheme? theme, + _svg.ColorMapper? colorMapper, ColorFilter? colorFilter, Clip clipBehavior = Clip.hardEdge, @deprecated Color? color, @@ -460,7 +773,13 @@ class SvgGenImage { if (_isVecFormat) { loader = _vg.AssetBytesLoader(_assetName, assetBundle: bundle, packageName: package); } else { - loader = _svg.SvgAssetLoader(_assetName, assetBundle: bundle, packageName: package, theme: theme); + loader = _svg.SvgAssetLoader( + _assetName, + assetBundle: bundle, + packageName: package, + theme: theme, + colorMapper: colorMapper, + ); } return _svg.SvgPicture( loader, @@ -484,3 +803,69 @@ class SvgGenImage { 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/fonts.gen.dart b/packages/core/lib/presentation/common/fonts.gen.dart index 66ad118..5e86efd 100644 --- a/packages/core/lib/presentation/common/fonts.gen.dart +++ b/packages/core/lib/presentation/common/fonts.gen.dart @@ -1,3 +1,4 @@ +// dart format width=120 /// GENERATED CODE - DO NOT MODIFY BY HAND /// ***************************************************** /// FlutterGen @@ -5,7 +6,7 @@ // coverage:ignore-file // ignore_for_file: type=lint -// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use +// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import class FontFamily { FontFamily._(); 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 index 746a00c..b97cced 100644 --- a/packages/core/lib/presentation/utils/list_extensions.dart +++ b/packages/core/lib/presentation/utils/list_extensions.dart @@ -1,9 +1,9 @@ extension ListExtensions on List { void toggle(T item) { if (contains(item)) { - if (length > 1) { + remove(item); - } + } else { add(item); } diff --git a/packages/core/lib/presentation/utils/utils.dart b/packages/core/lib/presentation/utils/utils.dart index edfacc8..88258e2 100644 --- a/packages/core/lib/presentation/utils/utils.dart +++ b/packages/core/lib/presentation/utils/utils.dart @@ -1,2 +1,4 @@ -export 'color_utils.dart'; -export 'list_extensions.dart'; \ No newline at end of file +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 index 563a2c2..d6b921b 100644 --- a/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart +++ b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart @@ -1,11 +1,9 @@ -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/common/app_fonts.dart'; +import 'package:rasadyar_core/core.dart'; class RAppBar extends StatelessWidget implements PreferredSizeWidget { - final String title; + final String? title; + final String? iconTitle; final Color backgroundColor; final Color iconColor; final bool hasBack; @@ -15,24 +13,12 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { final List? additionalActions; final int? leadingWidth; final Widget? leading; - - const RAppBar.noBack({ - super.key, - required this.title, - this.backgroundColor = AppColor.blueNormal, - this.iconColor = Colors.white, - this.titleTextStyle, - this.onBackPressed, - this.additionalActions, - this.leading, - this.hasBack = false, - this.centerTitle = false, - this.leadingWidth, - }); + final PreferredSizeWidget? bottom; const RAppBar({ super.key, - required this.title, + this.title, + this.iconTitle, this.backgroundColor = AppColor.blueNormal, this.iconColor = Colors.white, this.titleTextStyle, @@ -42,6 +28,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { this.hasBack = true, this.centerTitle = false, this.leadingWidth, + this.bottom, }); @override @@ -54,24 +41,37 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { scrolledUnderElevation: 0, centerTitle: centerTitle, titleTextStyle: titleTextStyle ?? AppFonts.yekan16.copyWith(color: Colors.white), - title: Text(title), + 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: 16), child: leading) : null, + leading: leading != null ? Padding(padding: const EdgeInsets.only(right: 6), child: leading) : null, titleSpacing: 8, actions: [ if (additionalActions != null) ...additionalActions!, if (hasBack) ...{ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: IconButton( - onPressed: onBackPressed ?? () => Get.back(), - icon: const Icon(CupertinoIcons.chevron_back), - color: iconColor, + 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, ); } diff --git a/packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart b/packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart deleted file mode 100644 index b5c569e..0000000 --- a/packages/core/lib/presentation/widget/bottom_navigation/bottom_navigation_1.dart +++ /dev/null @@ -1,82 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:rasadyar_core/core.dart'; - -class BottomNavigation1 extends StatefulWidget { - const BottomNavigation1({super.key, required this.items}); - - final List items; - - @override - State createState() => _BottomNavigation1State(); -} - -class _BottomNavigation1State extends State { - @override - Widget build(BuildContext context) { - return Container( - height: 90, - padding: EdgeInsets.fromLTRB(50, 10, 50, 10), - decoration: BoxDecoration( - color: AppColor.blueNormal, - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(50), - topRight: Radius.circular(50), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget.items, - ), - ); - } -} - -class BottomNavigation1Item extends StatelessWidget { - final String icon; - final String label; - final bool isSelected; - final Function() onTap; - - const BottomNavigation1Item({ - super.key, - required this.icon, - required this.label, - required this.isSelected, - required this.onTap, - }); - - @override - Widget build(BuildContext context) { - return Container( - width: 80, - height: 80, - 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: 32, - height: 32, - colorFilter: ColorFilter.mode( - isSelected ? AppColor.blueNormal : Colors.white, - BlendMode.srcIn) - ), - const SizedBox(height: 5), - Text( - label, - style: AppFonts.yekan10.copyWith( - color: isSelected ? AppColor.blueNormal : Colors.white, - ), - ), - ], - ), - ), - ); - } -} 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..0d91e27 --- /dev/null +++ b/packages/core/lib/presentation/widget/bottom_navigation/r_bottom_navigation.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class RBottomNavigation extends StatefulWidget { + const RBottomNavigation({super.key, required this.items}); + + final List items; + + @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: 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 index f2b50b3..8c92900 100644 --- a/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart +++ b/packages/core/lib/presentation/widget/bottom_navigation/wave_bottom_navigation.dart @@ -9,21 +9,24 @@ class WaveBottomNavigationItem { } class WaveBottomNavigation extends StatefulWidget { - const WaveBottomNavigation({ - super.key, - required this.items, - required this.onPageChanged, - }); + 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 { - final PageController _controller = PageController(viewportFraction: 0.3); + late PageController _controller; + + @override + void initState() { + super.initState(); + _controller = PageController(viewportFraction: 0.3, initialPage: widget.initPage); + } @override void dispose() { @@ -85,23 +88,19 @@ class _WaveBottomNavigationState extends State { final WaveBottomNavigationItem item = widget.items[index]; return GestureDetector( onTap: () { - _controller.animateToPage( - index, - duration: Duration(milliseconds: 500), - curve: Curves.easeInOut, - ); + _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 ?? 0, index); - value = index - (_controller.page ?? 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 = -7 * (1 - value.abs() * 2); + offset = -15 * (1 - value.abs() * 2); } return Transform.scale( @@ -110,18 +109,11 @@ class _WaveBottomNavigationState extends State { offset: Offset(0, offset), child: Column( children: [ - Tooltip( - message: item.title, - child: item.icon - ), - - /* Visibility( + Tooltip(message: item.title, child: item.icon), + Visibility( visible: (_controller.page ?? 0) == index, - child: Text( - item.title, - style: AppFonts.yekan10.copyWith(color: Colors.white), - ), - ),*/ + 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 index cb646f0..7d921b7 100644 --- a/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart +++ b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart @@ -11,18 +11,18 @@ class BaseBottomSheet extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - height: height ?? MediaQuery.of(context).size.height * 0.85, - padding: EdgeInsets.symmetric(vertical: 15, horizontal: 20), - decoration: BoxDecoration( - color:bgColor?? Colors.white, - borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), - ), - child: SingleChildScrollView( + 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( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - spacing: 8, children: [ SizedBox( width: MediaQuery.of(context).size.width, @@ -33,11 +33,14 @@ class BaseBottomSheet extends StatelessWidget { Container( height: 3, width: 50, - decoration: BoxDecoration(color: AppColor.darkGreyDark, borderRadius: BorderRadius.circular(8)), + decoration: BoxDecoration( + color: AppColor.darkGreyDark, + borderRadius: BorderRadius.circular(8), + ), ), Positioned( - left: 0, + left: -10, child: IconButton( onPressed: () { Navigator.of(context).pop(); @@ -48,10 +51,8 @@ class BaseBottomSheet extends StatelessWidget { ], ), ), - SizedBox(height: 2), - - child, + Expanded(child: 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..bbb8a45 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/buttons.dart @@ -0,0 +1,7 @@ +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'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/buttons/fab.dart b/packages/core/lib/presentation/widget/buttons/fab.dart index 3a33df7..a9dda88 100644 --- a/packages/core/lib/presentation/widget/buttons/fab.dart +++ b/packages/core/lib/presentation/widget/buttons/fab.dart @@ -1,4 +1,5 @@ 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'; @@ -30,7 +31,7 @@ class RFab extends StatefulWidget { RFab.add({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, - icon: Assets.vec.addSvg.svg(width: 40, height: 40), + icon: Assets.vec.addSvg.svg(width: 56.w, height: 56.h), backgroundColor: AppColor.greenNormal, key: key, ); @@ -201,14 +202,11 @@ class _RFabState extends State { side: WidgetStateProperty.all(BorderSide.none), backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.pressed)) { - return widget.backgroundColor?.pressedColor ?? - AppColor.blueNormalActive; + return widget.backgroundColor?.pressedColor ?? AppColor.blueNormalActive; } else if (states.contains(WidgetState.hovered)) { - return widget.backgroundColor?.hoverColor ?? - AppColor.blueNormalHover; + return widget.backgroundColor?.hoverColor ?? AppColor.blueNormalHover; } else if (states.contains(WidgetState.disabled)) { - return widget.backgroundColor?.disabledColor ?? - AppColor.blueNormal.disabledColor; + return widget.backgroundColor?.disabledColor ?? AppColor.blueNormal.disabledColor; } return widget.backgroundColor ?? AppColor.blueNormal; }), @@ -222,24 +220,19 @@ class _RFabState extends State { shape: WidgetStatePropertyAll( CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)), ), - fixedSize: WidgetStatePropertyAll( - Size(widget.radius ?? 56, widget.radius ?? 56), - ), + 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, + 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/outline_elevated.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart index 3663161..92a109d 100644 --- a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:rasadyar_core/presentation/common/app_color.dart'; -import 'package:rasadyar_core/presentation/common/app_fonts.dart'; -import 'package:rasadyar_core/presentation/utils/color_utils.dart'; +import 'package:rasadyar_core/core.dart'; class ROutlinedElevated extends StatefulWidget { ROutlinedElevated({ @@ -16,19 +14,17 @@ class ROutlinedElevated extends StatefulWidget { this.radius, this.textStyle, this.child, - this.width = 150.0, - this.height = 56.0, + this.width, + this.height, }); final String? text; final VoidCallback? onPressed; - final double width; - final double height; + final double? width; + final double? height; Color? foregroundColor; Color? backgroundColor; - Color? borderColor; - Color? disabledBackgroundColor; Color? pressedBackgroundColor; double? radius; @@ -40,64 +36,92 @@ class ROutlinedElevated extends StatefulWidget { } 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 OutlinedButton( - 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 ?? 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 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.yekan24.copyWith(color: AppColor.blueNormal), - ), + 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: Text(widget.text ?? ''), ), - child: widget.child ?? Text(widget.text!, style: widget.textStyle), ); } } diff --git a/packages/core/lib/presentation/widget/buttons/text_button.dart b/packages/core/lib/presentation/widget/buttons/text_button.dart index 5c9bbb7..227e06a 100644 --- a/packages/core/lib/presentation/widget/buttons/text_button.dart +++ b/packages/core/lib/presentation/widget/buttons/text_button.dart @@ -67,7 +67,7 @@ class _RTextButtonState extends State { padding: WidgetStatePropertyAll(EdgeInsets.zero), textStyle: WidgetStatePropertyAll( widget.textStyle ?? - AppFonts.yekan24.copyWith(color: AppColor.blueNormal), + AppFonts.yekan16.copyWith(color: AppColor.blueNormal), ), ), onPressed:widget.onPressed, 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/draggable_bottom_sheet2.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet2.dart index 91826d5..8ba0671 100644 --- 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 @@ -20,7 +20,6 @@ class DraggableBottomSheet2 extends GetView { return ObxValue((data) { return Stack( children: [ - // پس‌زمینه تیره Positioned.fill( child: GestureDetector( onTap: () {}, 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/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 index 37ec8ff..cc98965 100644 --- a/packages/core/lib/presentation/widget/inputs/r_input.dart +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -1,5 +1,8 @@ +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 } @@ -21,6 +24,7 @@ class RTextField extends StatefulWidget { final RTextFieldVariant variant; final bool filled; final Color? filledColor; + final Color? borderColor; final bool showCounter; final bool isDense; final TextInputType? keyboardType; @@ -32,36 +36,74 @@ class RTextField extends StatefulWidget { 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; 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.suffixIcon, - this.prefixIcon, - this.boxConstraints, - this.variant = RTextFieldVariant.normal, - this.filled = false, - this.filledColor, - this.showCounter = false, - this.isDense = false, + 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, + + // 🎨 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.onChanged, - this.onSubmitted, + this.autoValidateMode, + this.inputFormatters, + this.showCounter = false, + this.isDense = false, }); @override @@ -73,16 +115,37 @@ class RTextField extends StatefulWidget { bool get _passwordNoBorder => variant == RTextFieldVariant.passwordNoBorder; - InputBorder get _inputBorder => _noBorder || _passwordNoBorder - ? InputBorder.none - : OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: BorderSide(color: AppColor.lightGreyDarkActive, width: 1), - ); + 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() { @@ -90,79 +153,108 @@ class _RTextFieldState extends State { if (widget.initText != null) { widget.controller.text = widget.initText!; } - if (widget._isPassword) { - obscure = true; - } else { - obscure = widget.obscure; - } + 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.initText != oldWidget.initText) { + if (widget.initText != null && widget.controller.text != widget.initText) { widget.controller.text = widget.initText!; } } - Widget _buildSuffixIcon() { - if (widget.suffixIcon != null) return widget.suffixIcon!; - if (!widget._isPassword) return const SizedBox.shrink(); + 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; + } - 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), + @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._inputBorder, + border: widget._inputBorder, + ), + ), ), ); } @override - Widget build(BuildContext context) { - return Padding( - padding: widget.padding ?? EdgeInsets.zero, - child: TextFormField( - controller: widget.controller, - readOnly: widget.readonly, - minLines: widget.minLines, - maxLines: widget.maxLines, - onChanged: widget.onChanged, - validator: widget.validator, - enabled: widget.enabled, - obscureText: obscure, - onTapOutside: (_) => FocusScope.of(context).unfocus(), - onFieldSubmitted: widget.onSubmitted, - maxLength: widget.maxLength, - textDirection: TextDirection.rtl, - style: widget.style, - keyboardType: widget.keyboardType, - decoration: InputDecoration( - contentPadding: const EdgeInsets.symmetric(horizontal: 16), - errorStyle: widget.errorStyle, - errorMaxLines: 1, - isDense: widget.isDense, - 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._inputBorder, - border: widget._inputBorder, - ), - ), - ); + 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_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/overlay_dropdown_widget/view.dart b/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart index 8d8496d..80394cc 100644 --- a/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart +++ b/packages/core/lib/presentation/widget/overlay_dropdown_widget/view.dart @@ -2,20 +2,20 @@ 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/common/app_fonts.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; - - const OverlayDropdownWidget({ + final bool isDisabled; + const OverlayDropdownWidget({ super.key, required this.items, required this.itemBuilder, @@ -23,7 +23,11 @@ class OverlayDropdownWidget extends StatefulWidget { this.initialValue, this.onChanged, this.selectedItem, - this.contentPadding + this.contentPadding, + this.height, + this.background, + this.hasDropIcon = true, + this.isDisabled = false, }); @override @@ -34,7 +38,7 @@ class _OverlayDropdownState extends State> { final GlobalKey _key = GlobalKey(); OverlayEntry? _overlayEntry; final RxBool _isOpen = false.obs; - T? selectedItem ; + T? selectedItem; @override void initState() { @@ -48,51 +52,56 @@ class _OverlayDropdownState extends State> { 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, + 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( - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: AppColor.darkGreyLight), - borderRadius: BorderRadius.circular(8), - ), - child: ListView( - padding: EdgeInsets.zero, - shrinkWrap: true, - 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(), - ), + ), + 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!); @@ -115,25 +124,30 @@ class _OverlayDropdownState extends State> { Widget build(BuildContext context) { return GestureDetector( key: _key, - onTap: () { - _isOpen.value ? _removeOverlay() : _showOverlay(); - }, + onTap: widget.isDisabled + ? null + : () { + _isOpen.value ? _removeOverlay() : _showOverlay(); + }, child: Container( - height: 40, + 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: [ - widget.labelBuilder(selectedItem), - Icon( - _isOpen.value - ? CupertinoIcons.chevron_up - : CupertinoIcons.chevron_down, + Expanded(child: widget.labelBuilder(selectedItem)), + Visibility( + visible: widget.hasDropIcon!, + child: Icon( + _isOpen.value ? CupertinoIcons.chevron_up : CupertinoIcons.chevron_down, + size: 14, + ), ), ], ), @@ -141,3 +155,197 @@ class _OverlayDropdownState extends State> { ); } } + +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/tabs/new_tab.dart b/packages/core/lib/presentation/widget/tabs/new_tab.dart index c6e73c4..308ebb2 100644 --- a/packages/core/lib/presentation/widget/tabs/new_tab.dart +++ b/packages/core/lib/presentation/widget/tabs/new_tab.dart @@ -14,9 +14,7 @@ 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, -); +const EdgeInsetsGeometry _kHorizontalItemPadding = EdgeInsets.symmetric(horizontal: 16.0); // Minimum height of the segmented control. const double _kMinSegmentedControlHeight = 28.0; @@ -52,15 +50,17 @@ class NewCupertinoSegmentedControl extends StatefulWidget { 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), + groupValue == null || children.keys.any((T child) => child == groupValue), 'The groupValue must be either null or one of the keys in the children map.', ); @@ -101,6 +101,11 @@ class NewCupertinoSegmentedControl extends StatefulWidget { /// 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. /// @@ -127,18 +132,25 @@ class NewCupertinoSegmentedControl extends StatefulWidget { /// 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(); + State> createState() => _SegmentedControlState(); } -class _SegmentedControlState - extends State> +class _SegmentedControlState extends State> with TickerProviderStateMixin> { T? _pressedKey; - final List _selectionControllers = - []; + final List _selectionControllers = []; final List _childTweens = []; late ColorTween _forwardBackgroundColorTween; @@ -148,74 +160,66 @@ class _SegmentedControlState 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 - }); + 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; + final Color disabledTextColor = widget.disabledTextColor ?? _kDisableTextColor; if (_disabledTextColor != disabledTextColor) { changed = true; _disabledTextColor = disabledTextColor; } - final Color selectedColor = - widget.selectedColor ?? CupertinoTheme.of(context).primaryColor; + 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; + 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; + 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 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); + 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, - ); + _forwardBackgroundColorTween = ColorTween(begin: _pressedColor, end: _selectedColor); + _reverseBackgroundColorTween = ColorTween(begin: _unselectedColor, end: _selectedColor); _textColorTween = ColorTween(begin: _selectedColor, end: _unselectedColor); return changed; } @@ -229,8 +233,7 @@ class _SegmentedControlState _childTweens.clear(); for (final T key in widget.children.keys) { - final AnimationController animationController = - createAnimationController(); + final AnimationController animationController = createAnimationController(); if (widget.groupValue == key) { _childTweens.add(_reverseBackgroundColorTween); animationController.value = 1.0; @@ -254,8 +257,7 @@ class _SegmentedControlState void didUpdateWidget(NewCupertinoSegmentedControl oldWidget) { super.didUpdateWidget(oldWidget); - if (_updateColors() || - oldWidget.children.length != widget.children.length) { + if (_updateColors() || oldWidget.children.length != widget.children.length) { _updateAnimationControllers(); } @@ -276,8 +278,7 @@ class _SegmentedControlState @override void dispose() { - for (final AnimationController animationController - in _selectionControllers) { + for (final AnimationController animationController in _selectionControllers) { animationController.dispose(); } super.dispose(); @@ -324,9 +325,7 @@ class _SegmentedControlState Color? getBackgroundColor(int index, T currentKey) { if (widget.disabledChildren.contains(currentKey)) { - return widget.groupValue == currentKey - ? _selectedDisabledColor - : _unselectedDisabledColor; + return widget.groupValue == currentKey ? _selectedDisabledColor : _unselectedDisabledColor; } if (_selectionControllers[index].isAnimating) { return _childTweens[index].evaluate(_selectionControllers[index]); @@ -350,13 +349,12 @@ class _SegmentedControlState 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 textStyle = DefaultTextStyle.of( - context, - ).style.copyWith(color: getTextColor(index, currentKey)); - final IconThemeData iconTheme = IconThemeData( - color: getTextColor(index, 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]); @@ -364,16 +362,12 @@ class _SegmentedControlState 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, + onTapDown: widget.disabledChildren.contains(currentKey) + ? null + : (TapDownDetails event) { + _onTapDown(currentKey); + }, + onTapCancel: widget.disabledChildren.contains(currentKey) ? null : _onTapCancel, onTap: () { _onTap(currentKey); }, @@ -402,6 +396,7 @@ class _SegmentedControlState pressedIndex: pressedIndex, backgroundColors: backgroundColors, borderColor: _borderColor!, + selectBorderColor: _selectedBorderColor ?? _borderColor!, children: gestureChildren, ); @@ -420,12 +415,14 @@ class _SegmentedControlRenderWidget extends MultiChildRenderObjectWidget { 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) { @@ -435,25 +432,23 @@ class _SegmentedControlRenderWidget extends MultiChildRenderObjectWidget { pressedIndex: pressedIndex, backgroundColors: backgroundColors, borderColor: borderColor, + selectBorderColor: selectBorderColor, ); } @override - void updateRenderObject( - BuildContext context, - _RenderSegmentedControl renderObject, - ) { + void updateRenderObject(BuildContext context, _RenderSegmentedControl renderObject) { renderObject ..textDirection = Directionality.of(context) ..selectedIndex = selectedIndex ..pressedIndex = pressedIndex ..backgroundColors = backgroundColors - ..borderColor = borderColor; + ..borderColor = borderColor + ..selectedItemBorderColor = selectBorderColor; } } -class _SegmentedControlContainerBoxParentData - extends ContainerBoxParentData { +class _SegmentedControlContainerBoxParentData extends ContainerBoxParentData { RRect? surroundingRect; } @@ -461,24 +456,20 @@ typedef _NextChild = RenderBox? Function(RenderBox child); class _RenderSegmentedControl extends RenderBox with - ContainerRenderObjectMixin< - RenderBox, - ContainerBoxParentData - >, - RenderBoxContainerDefaultsMixin< - RenderBox, - ContainerBoxParentData - > { + 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; @@ -536,6 +527,16 @@ class _RenderSegmentedControl extends RenderBox 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; @@ -604,11 +605,7 @@ class _RenderSegmentedControl extends RenderBox } } - void _layoutRects( - _NextChild nextChild, - RenderBox? leftChild, - RenderBox? rightChild, - ) { + void _layoutRects(_NextChild nextChild, RenderBox? leftChild, RenderBox? rightChild) { RenderBox? child = leftChild; double start = 0.0; while (child != null) { @@ -616,12 +613,7 @@ class _RenderSegmentedControl extends RenderBox 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 Rect childRect = Rect.fromLTWH(start, 0.0, child.size.width, child.size.height); final RRect rChildRect; if (child == leftChild) { rChildRect = RRect.fromRectAndCorners( @@ -649,10 +641,7 @@ class _RenderSegmentedControl extends RenderBox double childWidth = constraints.minWidth / childCount; RenderBox? child = firstChild; while (child != null) { - childWidth = math.max( - childWidth, - child.getMaxIntrinsicWidth(double.infinity), - ); + childWidth = math.max(childWidth, child.getMaxIntrinsicWidth(double.infinity)); child = childAfter(child); } childWidth = math.min(childWidth, constraints.maxWidth / childCount); @@ -666,25 +655,16 @@ class _RenderSegmentedControl extends RenderBox } Size _computeOverallSizeFromChildSize(Size childSize) { - return constraints.constrain( - Size(childSize.width * childCount, childSize.height), - ); + return constraints.constrain(Size(childSize.width * childCount, childSize.height)); } @override - double? computeDryBaseline( - covariant BoxConstraints constraints, - TextBaseline baseline, - ) { + 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) - ) { + for (RenderBox? child = firstChild; child != null; child = childAfter(child)) { baselineOffset = baselineOffset.minOf( BaselineOffset(child.getDryBaseline(childConstraints, baseline)), ); @@ -735,28 +715,29 @@ class _RenderSegmentedControl extends RenderBox } } - void _paintChild( - PaintingContext context, - Offset offset, - RenderBox child, - int childIndex, - ) { + 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( - childParentData.surroundingRect!.shift(offset), + rect, Paint() ..color = backgroundColors[childIndex] ..style = PaintingStyle.fill, ); - context.canvas.drawRRect( - childParentData.surroundingRect!.shift(offset), - Paint() - ..color = borderColor - ..strokeWidth = 1.0 - ..style = PaintingStyle.stroke, - ); + + + 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); } 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/widget.dart b/packages/core/lib/presentation/widget/widget.dart index 52c3f21..43077b5 100644 --- a/packages/core/lib/presentation/widget/widget.dart +++ b/packages/core/lib/presentation/widget/widget.dart @@ -1,22 +1,25 @@ export 'app_bar/r_app_bar.dart'; -export 'bottom_navigation/bottom_navigation_1.dart'; +export 'bottom_navigation/r_bottom_navigation.dart'; export 'bottom_navigation/wave_bottom_navigation.dart'; -export 'buttons/elevated.dart'; -export 'buttons/outline_elevated.dart'; -export 'buttons/outline_elevated_icon.dart'; -export 'buttons/text_button.dart'; +export 'bottom_sheet/base_bottom_sheet.dart'; +export 'bottom_sheet/date_picker_bottom_sheet.dart'; +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 'draggable_bottom_sheet/bottom_sheet_manger.dart'; -export 'inputs/r_input.dart'; +export 'empty_widget.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'; -export 'card/card_with_icon_with_border.dart'; -export 'chips/r_chips.dart'; -export 'overlay_dropdown_widget/view.dart'; -export 'inputs/input_fixed_hint.dart'; -export 'bottom_sheet/base_bottom_sheet.dart'; +//inputs +export 'inputs/inputs.dart'; 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..6e7062b --- /dev/null +++ b/packages/core/lib/utils/extension/string_utils.dart @@ -0,0 +1,42 @@ +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'), ''); + } + + + 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(".",'')); +} \ No newline at end of file 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 index 4edf8a0..8d83ded 100644 --- a/packages/core/lib/utils/logger_utils.dart +++ b/packages/core/lib/utils/logger_utils.dart @@ -8,6 +8,12 @@ void iLog(dynamic message) { } } +void wLog(dynamic message){ + if(kDebugMode){ + diCore.get().w(message.toString()); + } +} + void eLog(dynamic message) { if(kDebugMode){ diCore.get().e(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..a313a1e --- /dev/null +++ b/packages/core/lib/utils/map_utils.dart @@ -0,0 +1,55 @@ +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; +} 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..0ff8a3c --- /dev/null +++ b/packages/core/lib/utils/network/network.dart @@ -0,0 +1,2 @@ +export 'resource.dart'; +export 'safe_call_utils.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_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/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/safe_call_utils.dart b/packages/core/lib/utils/safe_call_utils.dart deleted file mode 100644 index c4baa0b..0000000 --- a/packages/core/lib/utils/safe_call_utils.dart +++ /dev/null @@ -1,97 +0,0 @@ -import 'package:flutter/foundation.dart'; - -import '../core.dart'; - -typedef AppAsyncCallback = Future Function(); -typedef ErrorCallback = void Function(dynamic error, StackTrace? stackTrace); -typedef VoidCallback = void Function(); - -/// this is global safe call function -/// A utility function to safely cal l an asynchronous function with error -/// handling and optional loading, success, and error messages. -/// -Future gSafeCall({ - 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, - bool retryOnAuthError = false, - Function()? onTokenRefresh, - Function()? onShowLoading, - Function()? onHideLoading, - Function()? onShowSuccessMessage, - Function()? onShowErrorMessage, -}) async { - try { - if (showLoading) { - (onShowLoading ?? _defaultShowLoading)(); - } - - final result = await call(); - - if (showSuccess) { - (onShowSuccessMessage ?? _defaultShowSuccessMessage)(); - } - - onSuccess?.call(result); - } catch (error, stackTrace) { - if (retryOnAuthError && isTokenExpiredError(error)) { - try { - await onTokenRefresh?.call(); - final retryResult = await call(); - if (showSuccess) { - (onShowSuccessMessage ?? _defaultShowSuccessMessage)(); - } - onSuccess?.call(retryResult); - return; - } catch (retryError, retryStackTrace) { - if (showError) { - (onShowErrorMessage ?? _defaultShowErrorMessage)(); - } - onError?.call(retryError, retryStackTrace); - if (kDebugMode) { - print('safeCall retry error: $retryError\n$retryStackTrace'); - } - } - } else { - if (showError) { - (onShowErrorMessage ?? _defaultShowErrorMessage)(); - } - onError?.call(error, stackTrace); - if (kDebugMode) { - print('safeCall error: $error\n$stackTrace'); - } - } - } finally { - if (showLoading) { - (onHideLoading ?? _defaultHideLoading)(); - } - - onComplete?.call(); - } -} - -void _defaultShowLoading() { - // پیاده‌سازی پیش‌فرض -} - -void _defaultHideLoading() { - // پیاده‌سازی پیش‌فرض -} - -void _defaultShowSuccessMessage() { - // پیاده‌سازی پیش‌فرض -} - -void _defaultShowErrorMessage() { - // پیاده‌سازی پیش‌فرض -} - -bool isTokenExpiredError(dynamic error) { - return error is DioException && error.response?.statusCode == 401; -} 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..064ac55 --- /dev/null +++ b/packages/core/lib/utils/utils.dart @@ -0,0 +1,17 @@ +export 'mixins/pagination_controller_mixin.dart'; + +export 'network/network.dart'; + +export 'extension/date_time_utils.dart'; +export 'extension/num_utils.dart'; +export 'extension/string_utils.dart'; + +export 'apk_updater.dart'; +export 'logger_utils.dart'; +export 'map_utils.dart'; +export 'route_utils.dart'; +export 'separator_input_formatter.dart'; + + +export 'local/local_utils.dart'; + diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock index 42a3880..ec15459 100644 --- a/packages/core/pubspec.lock +++ b/packages/core/pubspec.lock @@ -5,18 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f url: "https://pub.dev" source: hosted - version: "82.0.0" + version: "85.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0" + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" url: "https://pub.dev" source: hosted - version: "7.4.5" + 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" archive: dependency: transitive description: @@ -37,10 +45,10 @@ packages: dependency: transitive description: name: asn1lib - sha256: "0511d6be23b007e95105ae023db599aea731df604608978dada7f9faf2637623" + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" url: "https://pub.dev" source: hosted - version: "1.6.4" + version: "1.6.5" async: dependency: transitive description: @@ -61,10 +69,10 @@ packages: dependency: transitive description: name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "3.0.0" build_config: dependency: transitive description: @@ -85,26 +93,26 @@ packages: dependency: transitive description: name: build_resolvers - sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "3.0.0" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d url: "https://pub.dev" source: hosted - version: "2.4.15" + version: "2.6.0" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "9.2.0" built_collection: dependency: transitive description: @@ -117,10 +125,10 @@ packages: dependency: transitive description: name: built_value - sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27" + sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62" url: "https://pub.dev" source: hosted - version: "8.10.1" + version: "8.11.0" characters: dependency: transitive description: @@ -133,10 +141,10 @@ packages: dependency: transitive description: name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.4" clock: dependency: transitive description: @@ -177,6 +185,14 @@ packages: 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: @@ -201,14 +217,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + dart_polylabel2: + dependency: transitive + description: + name: dart_polylabel2 + sha256: "7eeab15ce72894e4bdba6a8765712231fc81be0bd95247de4ad9966abc57adc6" + url: "https://pub.dev" + source: hosted + version: "1.0.0" dart_style: dependency: transitive description: name: dart_style - sha256: "5b236382b47ee411741447c1f1e111459c941ea1b3f2b540dde54c210a3662af" + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" dartx: dependency: "direct main" description: @@ -217,6 +241,30 @@ packages: 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: @@ -265,6 +313,38 @@ packages: 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: @@ -282,26 +362,26 @@ packages: dependency: transitive description: name: flutter_gen_core - sha256: "3eaa2d3d8be58267ac4cd5e215ac965dd23cae0410dc073de2e82e227be32bfc" + sha256: eda54fdc5de08e7eeea663eb8442aafc8660b5a13fda4e0c9e572c64e50195fb url: "https://pub.dev" source: hosted - version: "5.10.0" + version: "5.11.0" flutter_gen_runner: dependency: "direct main" description: name: flutter_gen_runner - sha256: e74b4ead01df3e8f02e73a26ca856759dbbe8cb3fd60941ba9f4005cd0cd19c9 + sha256: "669bf8b7a9b4acbdcb7fcc5e12bf638aca19acedf43341714cbca3bf3a219521" url: "https://pub.dev" source: hosted - version: "5.10.0" + version: "5.11.0" 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: "direct main" description: flutter @@ -311,10 +391,10 @@ packages: dependency: "direct main" description: name: flutter_map - sha256: f7d0379477274f323c3f3bc12d369a2b42eb86d1e7bd2970ae1ea3cff782449a + sha256: df33e784b09fae857c6261a5521dd42bd4d3342cb6200884bb70730638af5fd5 url: "https://pub.dev" source: hosted - version: "8.1.1" + version: "8.2.1" flutter_map_animations: dependency: "direct main" description: @@ -323,6 +403,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.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: @@ -331,6 +419,14 @@ packages: 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: @@ -391,10 +487,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1 + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" flutter_test: dependency: "direct dev" description: flutter @@ -417,18 +513,18 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "6022db4c7bfa626841b2a10f34dd1e1b68e8f8f9650db6112dcdeeca45ca793c" + sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.2.0" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: c87ff004c8aa6af2d531668b46a4ea379f7191dc6dfa066acd53d506da6e044b + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" frontend_server_client: dependency: transitive description: @@ -437,22 +533,30 @@ packages: 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: ee2212a3df8292ec4c90b91183b8001d3f5a800823c974b570c5f9344ca320dc + sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516" url: "https://pub.dev" source: hosted - version: "14.0.1" + version: "14.0.2" geolocator_android: dependency: transitive description: name: geolocator_android - sha256: "114072db5d1dce0ec0b36af2697f55c133bc89a2c8dd513e137c0afe59696ed4" + sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a" url: "https://pub.dev" source: hosted - version: "5.0.1+1" + version: "5.0.2" geolocator_apple: dependency: transitive description: @@ -461,6 +565,14 @@ packages: 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: @@ -525,6 +637,14 @@ packages: 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: @@ -553,18 +673,18 @@ packages: dependency: "direct dev" description: name: hive_ce_generator - sha256: "609678c10ebee7503505a0007050af40a0a4f498b1fb7def3220df341e573a89" + sha256: a169feeff2da9cc2c417ce5ae9bcebf7c8a95d7a700492b276909016ad70a786 url: "https://pub.dev" source: hosted - version: "1.9.2" + version: "1.9.3" http: dependency: transitive description: name: http - sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" + sha256: "85ab0074f9bf2b24625906d8382bbec84d3d6919d285ba9c106b07b65791fb99" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.0-beta.2" http_multi_server: dependency: transitive description: @@ -581,6 +701,78 @@ packages: 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: @@ -633,10 +825,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + sha256: ce2cf974ccdee13be2a510832d7fba0b94b364e0b0395dee42abaa51b855be27 url: "https://pub.dev" source: hosted - version: "6.9.5" + version: "6.10.0" latlong2: dependency: "direct main" description: @@ -673,10 +865,10 @@ 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: @@ -689,10 +881,10 @@ packages: dependency: "direct main" description: name: logger - sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 + sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.1" logging: dependency: transitive description: @@ -701,6 +893,14 @@ packages: 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: @@ -745,10 +945,10 @@ packages: dependency: transitive description: name: mockito - sha256: "4546eac99e8967ea91bae633d2ca7698181d008e95fa4627330cf903d573277a" + sha256: "2314cbe9165bcd16106513df9cf3c3224713087f09723b128928dc11a4379f99" url: "https://pub.dev" source: hosted - version: "5.4.6" + version: "5.5.0" mocktail: dependency: "direct dev" description: @@ -765,6 +965,22 @@ packages: 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: @@ -782,7 +998,7 @@ packages: source: hosted version: "1.1.0" path_provider: - dependency: transitive + dependency: "direct main" description: name: path_provider sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" @@ -833,10 +1049,10 @@ packages: dependency: "direct main" description: name: permission_handler - sha256: "2d070d8684b68efb580a5997eb62f675e8a885ef0be6e754fb9ef489c177470f" + sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1 url: "https://pub.dev" source: hosted - version: "12.0.0+1" + version: "12.0.1" permission_handler_android: dependency: transitive description: @@ -917,14 +1133,6 @@ packages: 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: @@ -937,10 +1145,10 @@ packages: dependency: transitive description: name: posix - sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62 + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.0.3" pretty_dio_logger: dependency: "direct main" description: @@ -985,10 +1193,10 @@ packages: dependency: transitive description: name: shamsi_date - sha256: b6c79ff34ddfb1e9e4761347f18e30afdd7d16cc3db77defd5a40e2d93894c51 + sha256: "0383fddc9bce91e9e08de0c909faf93c3ab3a0e532abd271fb0dcf5d0617487b" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" shelf: dependency: transitive description: @@ -1005,6 +1213,14 @@ packages: 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 @@ -1014,18 +1230,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + sha256: fc787b1f89ceac9580c3616f899c9a447413cbdac1df071302127764c023a134 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.0" source_helper: dependency: transitive description: name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1" url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.6" source_span: dependency: transitive description: @@ -1134,10 +1350,10 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 url: "https://pub.dev" source: hosted - version: "1.1.18" + version: "1.1.19" vector_graphics_codec: dependency: transitive description: @@ -1174,10 +1390,10 @@ packages: dependency: transitive description: name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" web: dependency: transitive description: @@ -1206,10 +1422,18 @@ packages: dependency: transitive description: name: win32 - sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" url: "https://pub.dev" source: hosted - version: "5.13.0" + 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: @@ -1252,4 +1476,4 @@ packages: version: "2.1.0" sdks: dart: ">=3.8.1 <4.0.0" - flutter: ">=3.27.0" + flutter: ">=3.29.0" diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 346a62b..e064032 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -1,7 +1,7 @@ name: rasadyar_core description: "A new Flutter project." -publish_to: 'none' -version: 1.0.0+1 +publish_to: none +version: 1.2.0+2 environment: sdk: ^3.8.1 @@ -12,32 +12,43 @@ dependencies: 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.5.0 + logger: ^2.6.1 ## reactive dartx: ^1.2.0 rxdart: ^0.28.0 ## local storage - hive_ce: ^2.11.1 - hive_ce_flutter: ^2.3.0 + 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.0.17 + flutter_svg: ^2.2.0 font_awesome_flutter: ^10.8.0 + #Shimmer + shimmer: ^3.0.0 + #Generator - flutter_gen_runner: ^5.10.0 + flutter_gen_runner: ^5.11.0 ##state manger get: ^4.7.2 @@ -46,20 +57,22 @@ dependencies: get_it: ^8.0.3 #other - permission_handler: ^12.0.0+1 + 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: ^8.1.1 + flutter_map: ^8.2.1 flutter_map_animations: ^0.9.0 #location latlong2: ^0.9.1 - geolocator: ^14.0.0 + geolocator: ^14.0.2 #network dio: ^5.8.0+1 @@ -67,17 +80,17 @@ dependencies: pretty_dio_logger: ^1.4.0 ##code generation - freezed_annotation: ^3.0.0 + freezed_annotation: ^3.1.0 json_annotation: ^4.9.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 ##code generation - build_runner: ^2.4.15 - hive_ce_generator: ^1.9.1 - freezed: ^3.0.3 - json_serializable: ^6.9.4 + build_runner: ^2.6.0 + hive_ce_generator: ^1.9.3 + freezed: ^3.2.0 + json_serializable: ^6.10.0 ##test @@ -89,9 +102,5 @@ dev_dependencies: flutter: uses-material-design: true - assets: - - assets/ - - assets/vec/ - - assets/icons/ diff --git a/packages/core/test/infrastructure/local/hive_local_storage.dart b/packages/core/test/infrastructure/local/hive_local_storage.dart index 53b7b55..82fcc1b 100644 --- a/packages/core/test/infrastructure/local/hive_local_storage.dart +++ b/packages/core/test/infrastructure/local/hive_local_storage.dart @@ -1,8 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:rasadyar_core/core.dart'; -import 'i_local_storage.dart'; - class HiveLocalStorage implements ILocalStorage { HiveLocalStorage() { Hive.initFlutter(); @@ -44,16 +42,13 @@ class HiveLocalStorage implements ILocalStorage { } @override - Future add({required String boxName, required dynamic value}) async { + 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 { + Future addAll({required String boxName, required Iterable values}) async { Box? box = getBox(boxName); await box?.addAll(values); } @@ -69,44 +64,39 @@ class HiveLocalStorage implements ILocalStorage { @override Future clear(String boxName) async { - await _boxes[boxName]?.clear(); + 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); + 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); + 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); + 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); + 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/inspection/lib/presentation/root/logic.dart b/packages/inspection/lib/presentation/root/logic.dart index e95a9b3..31bd149 100644 --- a/packages/inspection/lib/presentation/root/logic.dart +++ b/packages/inspection/lib/presentation/root/logic.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/core.dart' ; import 'package:rasadyar_inspection/presentation/action/view.dart'; import 'package:rasadyar_inspection/presentation/filter/view.dart'; import 'package:rasadyar_inspection/presentation/profile/view.dart'; diff --git a/packages/livestock/lib/presentation/page/root/view.dart b/packages/livestock/lib/presentation/page/root/view.dart index f506375..1951ca1 100644 --- a/packages/livestock/lib/presentation/page/root/view.dart +++ b/packages/livestock/lib/presentation/page/root/view.dart @@ -44,23 +44,23 @@ class RootPage extends GetView { sizing: StackFit.expand, ), extendBody: true, - bottomNavigationBar: BottomNavigation1( + bottomNavigationBar: RBottomNavigation( items: [ - BottomNavigation1Item( + RBottomNavigationItem( icon: Assets.vec.filterSvg.path, label: 'درخواست‌ها', isSelected: currentIndex.value == 0, onTap: () => controller.changePage(0), ), - BottomNavigation1Item( + RBottomNavigationItem( icon: Assets.vec.mapSvg.path, label: 'نقشه', isSelected: currentIndex.value == 1, onTap: () => controller.changePage(1), ), - BottomNavigation1Item( + RBottomNavigationItem( icon: Assets.vec.profileUserSvg.path, label: 'پروفایل', isSelected: currentIndex.value == 2, diff --git a/packages/livestock/pubspec.yaml b/packages/livestock/pubspec.yaml index 3819913..5713c92 100644 --- a/packages/livestock/pubspec.yaml +++ b/packages/livestock/pubspec.yaml @@ -16,19 +16,19 @@ dependencies: rasadyar_auth: path: ../auth ##code generation - freezed_annotation: ^3.0.0 + freezed_annotation: ^3.1.0 json_annotation: ^4.9.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 - lints: ^5.0.0 - test: ^1.24.0 + flutter_lints: ^6.0.0 + lints: ^6.0.0 + test: ^1.25.15 ##code generation - build_runner: ^2.4.15 - hive_ce_generator: ^1.9.1 - freezed: ^3.0.6 - json_serializable: ^6.9.4 + 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 diff --git a/pubspec.lock b/pubspec.lock index 1b4461c..1877341 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f url: "https://pub.dev" source: hosted - version: "82.0.0" + version: "85.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0" + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" url: "https://pub.dev" source: hosted - version: "7.4.5" + 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" archive: dependency: transitive description: @@ -61,10 +69,10 @@ packages: dependency: transitive description: name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "3.0.0" build_config: dependency: transitive description: @@ -85,26 +93,26 @@ packages: dependency: transitive description: name: build_resolvers - sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "3.0.0" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d url: "https://pub.dev" source: hosted - version: "2.4.15" + version: "2.6.0" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "9.2.0" built_collection: dependency: transitive description: @@ -121,6 +129,14 @@ packages: url: "https://pub.dev" source: hosted version: "8.10.1" + 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: @@ -133,10 +149,18 @@ packages: dependency: transitive description: name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" url: "https://pub.dev" source: hosted - version: "2.0.3" + 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: @@ -177,6 +201,14 @@ packages: 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: @@ -201,6 +233,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + dart_polylabel2: + dependency: transitive + description: + name: dart_polylabel2 + sha256: "7eeab15ce72894e4bdba6a8765712231fc81be0bd95247de4ad9966abc57adc6" + url: "https://pub.dev" + source: hosted + version: "1.0.0" dart_style: dependency: transitive description: @@ -217,6 +257,30 @@ packages: 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: @@ -265,6 +329,38 @@ packages: 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: @@ -282,26 +378,34 @@ packages: dependency: transitive description: name: flutter_gen_core - sha256: "3eaa2d3d8be58267ac4cd5e215ac965dd23cae0410dc073de2e82e227be32bfc" + sha256: eda54fdc5de08e7eeea663eb8442aafc8660b5a13fda4e0c9e572c64e50195fb url: "https://pub.dev" source: hosted - version: "5.10.0" + version: "5.11.0" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - sha256: e74b4ead01df3e8f02e73a26ca856759dbbe8cb3fd60941ba9f4005cd0cd19c9 + sha256: "669bf8b7a9b4acbdcb7fcc5e12bf638aca19acedf43341714cbca3bf3a219521" url: "https://pub.dev" source: hosted - version: "5.10.0" + 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 @@ -311,10 +415,10 @@ packages: dependency: transitive description: name: flutter_map - sha256: f7d0379477274f323c3f3bc12d369a2b42eb86d1e7bd2970ae1ea3cff782449a + sha256: df33e784b09fae857c6261a5521dd42bd4d3342cb6200884bb70730638af5fd5 url: "https://pub.dev" source: hosted - version: "8.1.1" + version: "8.2.1" flutter_map_animations: dependency: transitive description: @@ -323,6 +427,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.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: @@ -331,6 +443,14 @@ packages: 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: @@ -391,10 +511,10 @@ packages: dependency: transitive description: name: flutter_svg - sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1 + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" flutter_test: dependency: "direct dev" description: flutter @@ -417,18 +537,18 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "6022db4c7bfa626841b2a10f34dd1e1b68e8f8f9650db6112dcdeeca45ca793c" + sha256: da32f8ba8cfcd4ec71d9decc8cbf28bd2c31b5283d9887eb51eb4a0659d8110c url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.2.0" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: c87ff004c8aa6af2d531668b46a4ea379f7191dc6dfa066acd53d506da6e044b + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" frontend_server_client: dependency: transitive description: @@ -437,14 +557,22 @@ packages: 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: ee2212a3df8292ec4c90b91183b8001d3f5a800823c974b570c5f9344ca320dc + sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516" url: "https://pub.dev" source: hosted - version: "14.0.1" + version: "14.0.2" geolocator_android: dependency: transitive description: @@ -461,6 +589,14 @@ packages: 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: @@ -525,6 +661,14 @@ packages: 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: @@ -553,18 +697,18 @@ packages: dependency: "direct dev" description: name: hive_ce_generator - sha256: "609678c10ebee7503505a0007050af40a0a4f498b1fb7def3220df341e573a89" + sha256: a169feeff2da9cc2c417ce5ae9bcebf7c8a95d7a700492b276909016ad70a786 url: "https://pub.dev" source: hosted - version: "1.9.2" + version: "1.9.3" http: dependency: transitive description: name: http - sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" + sha256: "85ab0074f9bf2b24625906d8382bbec84d3d6919d285ba9c106b07b65791fb99" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.0-beta.2" http_multi_server: dependency: transitive description: @@ -581,6 +725,78 @@ packages: 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: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb" + url: "https://pub.dev" + source: hosted + version: "0.8.12+23" + 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: @@ -633,10 +849,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + sha256: ce2cf974ccdee13be2a510832d7fba0b94b364e0b0395dee42abaa51b855be27 url: "https://pub.dev" source: hosted - version: "6.9.5" + version: "6.10.0" latlong2: dependency: transitive description: @@ -673,10 +889,10 @@ 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: @@ -689,10 +905,10 @@ packages: dependency: transitive description: name: logger - sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 + sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.1" logging: dependency: transitive description: @@ -701,6 +917,14 @@ packages: 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: @@ -745,10 +969,10 @@ packages: dependency: transitive description: name: mockito - sha256: "4546eac99e8967ea91bae633d2ca7698181d008e95fa4627330cf903d573277a" + sha256: "2314cbe9165bcd16106513df9cf3c3224713087f09723b128928dc11a4379f99" url: "https://pub.dev" source: hosted - version: "5.4.6" + version: "5.5.0" mocktail: dependency: "direct dev" description: @@ -765,6 +989,22 @@ packages: 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: @@ -833,10 +1073,10 @@ packages: dependency: transitive description: name: permission_handler - sha256: "2d070d8684b68efb580a5997eb62f675e8a885ef0be6e754fb9ef489c177470f" + sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1 url: "https://pub.dev" source: hosted - version: "12.0.0+1" + version: "12.0.1" permission_handler_android: dependency: transitive description: @@ -917,14 +1157,6 @@ packages: 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: @@ -979,14 +1211,21 @@ packages: path: "packages/auth" relative: true source: path - version: "0.0.1" + version: "1.0.3" + 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.0.0+1" + version: "1.2.0+2" rasadyar_inspection: dependency: "direct main" description: @@ -1033,6 +1272,14 @@ packages: 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 @@ -1042,18 +1289,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + sha256: fc787b1f89ceac9580c3616f899c9a447413cbdac1df071302127764c023a134 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.0" source_helper: dependency: transitive description: name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1" url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.6" source_span: dependency: transitive description: @@ -1162,10 +1409,10 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 url: "https://pub.dev" source: hosted - version: "1.1.18" + version: "1.1.19" vector_graphics_codec: dependency: transitive description: @@ -1202,10 +1449,10 @@ packages: dependency: transitive description: name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" web: dependency: transitive description: @@ -1234,10 +1481,18 @@ packages: dependency: transitive description: name: win32 - sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" url: "https://pub.dev" source: hosted - version: "5.13.0" + 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: @@ -1280,4 +1535,4 @@ packages: version: "2.1.0" sdks: dart: ">=3.8.1 <4.0.0" - flutter: ">=3.27.0" + flutter: ">=3.29.0" diff --git a/pubspec.yaml b/pubspec.yaml index 189dc00..6d047e1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: rasadyar_app description: "A new Flutter project." publish_to: 'none' -version: 1.2.0+2 +version: 1.3.6+4 environment: sdk: ^3.8.1 @@ -12,7 +12,7 @@ dependencies: #UI cupertino_icons: ^1.0.8 - + flutter_launcher_icons: ^0.14.4 #rasadyar packages rasadyar_core: @@ -27,21 +27,26 @@ dependencies: rasadyar_livestock: path: ./packages/livestock + rasadyar_chicken: + path: ./packages/chicken + + ##code generation - freezed_annotation: ^3.0.0 + freezed_annotation: ^3.1.0 json_annotation: ^4.9.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 ##code generation - build_runner: ^2.4.15 - hive_ce_generator: ^1.9.1 - freezed: ^3.0.6 - json_serializable: ^6.9.4 - flutter_gen_runner: ^5.10.0 + 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 @@ -59,6 +64,7 @@ flutter: - assets/images/ - assets/logos/ - assets/vec/ + - assets/anim/ fonts: @@ -74,5 +80,5 @@ flutter_gen: integrations: image: true flutter_svg: true + lottie: true rive: false - lottie: false diff --git a/tools/package_builder.sh b/tools/package_builder.sh index c14cc59..369f0a5 100644 --- a/tools/package_builder.sh +++ b/tools/package_builder.sh @@ -1,2 +1,2 @@ #!/bin/bash -dart create --template=package ../packages/livestock \ No newline at end of file +dart create --template=package ../packages/chicken \ No newline at end of file diff --git a/tools/runner.sh b/tools/runner.sh index 1931741..ad699f9 100644 --- a/tools/runner.sh +++ b/tools/runner.sh @@ -1,4 +1,2 @@ cd ../ dart run build_runner build --delete-conflicting-outputs - - diff --git a/tools/vecGeneratoe.sh b/tools/vecGeneratoe.sh index 4c6cf89..178436a 100644 --- a/tools/vecGeneratoe.sh +++ b/tools/vecGeneratoe.sh @@ -1,45 +1,76 @@ -#!/bin/bash +##!/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 -# 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" +echo "🗃️ sourcePath: $sourcePath" +echo "🗃️ targetPath: $targetPath" +mkdir -p "$targetPath" -if [ ! -e "$targetPath" ]; then - echo "📁 Directory does not exist. Creating: $targetPath" - mkdir -p "$targetPath" -fi +# 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..." -# Loop and delete old vec file -for file in "$targetPath"/* -do - if [ -f "$file" ]; then +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" +' - 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 \ No newline at end of file +git add .