We generate our database entities with moor. We have an database service as an facade for all database access. There we have the method
Future<DatabaseEntry?> getDatabaseEntry(String entryId)
. DatabaseEntry is generated from moor.
In our test we have this
@GenerateMocks([DatabaseService])
void main() {...
In the mock from mockito we find this:
@override
_i10.Future<dynamic> getDatabaseEntry(String? entryId) =>
and android studio is telling us correctly that
'MockDatabaseService.getDatabaseEntry' ('Future<dynamic> Function(String?)') isn't a valid override of 'DatabaseService.getDatabaseEntry' ('Future<DatabaseEntry?> Function(String)').
We think that this happens because Mockito generates the mocks before the DatabaseEntry class is generated from moor. How can we change the order of the build runners or is the problem somewhere else?