@@ -89,6 +89,8 @@ class OperationsCubit extends Cubit<OperationsState> {
|
||||
void initOperationForm({
|
||||
OperationModel? existingOperation,
|
||||
String? operationId,
|
||||
String? staffId,
|
||||
String? staffDisplayName,
|
||||
}) async {
|
||||
if (existingOperation != null) {
|
||||
emit(
|
||||
@@ -219,6 +221,8 @@ class OperationsCubit extends Cubit<OperationsState> {
|
||||
int? quantity,
|
||||
String? modelId,
|
||||
String? modelDisplayName,
|
||||
String? staffId,
|
||||
String? staffDisplayName,
|
||||
// Aggiungiamo questi flag per forzare la pulizia dei campi quando cambi tipo
|
||||
bool clearProvider = false,
|
||||
bool clearType = false,
|
||||
@@ -262,6 +266,8 @@ class OperationsCubit extends Cubit<OperationsState> {
|
||||
modelDisplayName: clearModel
|
||||
? null
|
||||
: (modelDisplayName ?? current.modelDisplayName),
|
||||
staffId: staffId ?? current.staffId,
|
||||
staffDisplayName: staffDisplayName ?? current.staffDisplayName,
|
||||
);
|
||||
|
||||
emit(state.copyWith(currentOperation: updated));
|
||||
|
||||
Reference in New Issue
Block a user