-
-
Notifications
You must be signed in to change notification settings - Fork 320
Open
Description
In this case the setter works correctly if the parameter is null , so the initial value of the Observable class is null , but if it is initialised by a value , it will not change to null , in my case im deselect the option and the value still not null
Even if I change the value by passing null directly without a variable or parameter
part 'duty_officer_search_controller.g.dart';
@injectable
class DutyOfficerSearchController extends DutyOfficerSearchControllerBase with _$DutyOfficerSearchController {
DutyOfficerSearchController(
@factoryParam super.preselectedDutyOfficer,
);
}
abstract class DutyOfficerSearchControllerBase extends BaseController with SearchingMixin, Store {
final EmployeeModel? preselectedDutyOfficer;
DutyOfficerSearchControllerBase(
this.preselectedDutyOfficer,
);
@observable
late EmployeeModel? selectedDutyOfficer=preselectedDutyOfficer;
@action
void changeSelectedDutyOfficer(final EmployeeModel? value) {
selectedDutyOfficer = value;
if(value==null) {
print('here null');
selectedDutyOfficer=null;
}
print(' $selectedDutyOfficer $value');
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels