I've got this test:

test(
    'Form is Edit, and value is different to form value, sets form type to Add, and sets hasFormTypeChanged to true',
    () async {
  manageVgnItmStore = MockManageVgnItmStore();
  final formVm = MockManageVgnItmsFormStore();
  when(formVm.hasFormTypeChanged).thenReturn(false);
  when(manageVgnItmStore?.lastSelectedVgnItm).thenReturn(
      const VgnItm.groceryItm(companyName: 'Cadbury', name: 'Chocolate'));
  when(manageVgnItmStore?.stateNotifiersVm)
      .thenReturn(ManageVgnItmsStateNotifiersStore(manageVgnItmStore!));
  when(manageVgnItmStore?.formVm).thenReturn(formVm);
  when(manageVgnItmStore?.formVm.hasFormTypeChanged).thenReturn(false);
  when(manageVgnItmStore?.formType).thenReturn(const Edit(name: 'Edit'));

  underTest = VgnItmFormEvents(manageVgnItmStore!);

  underTest?.onNameChanged('fasdfsdfsdf', form!);
  verify(underTest?.manageVgnItmStore.formType = const Add(name: 'Add'));
  verify(underTest?.manageVgnItmStore.formVm.hasFormTypeChanged = true);
});

The last verify call produces the error:

UnimplementedError: hasFormTypeChanged

package:test_api
Fake.noSuchMethod

package:vepo/src/presentation/stores/manage_vegan_items/form_store.dart 19:8 _FakeManageVgnItmsFormStore_0.hasFormTypeChanged

As you can see I have set it multiple times:

when(formVm.hasFormTypeChanged).thenReturn(false);
when(manageVgnItmStore?.formVm.hasFormTypeChanged).thenReturn(false);

Why is this error occurring?