Questions tagged [flutter-mockito]
19 questions
0
votes
1 answer
How to mock a StateNotifier in flutter / Riverpod
I wrote a simple provider in flutter that should provide the current date/time (clock.now() is from the clock package):
final clockProvider = StateNotifierProvider((ref) {
return Clock();
});
class Clock extends…

Olf
- 25
- 4
0
votes
2 answers
Where to store mock files in a flutter project?
Is there any best practice for where to store mock files in Flutter?
Particularly, the auto-generated mock files, since I'm using @generateMocks annotation from Mockito package.
Should I, for example, create a package dedicated for storing all…

sharbel okzan
- 60
- 7
0
votes
1 answer
Flutter secure storage unit test
Hey as a part of project I would like to test my classes like the one below but I have a little problem. Impossible for me to test, I always encounter the same errors "type 'Null' is not a subtype of type 'Future'" or "Null check…
user11820495
0
votes
1 answer
Flutter test with mockito and dartz fails
I'm testing a repository implementation but the test fails and I can't find where the error is.
This is the repository:
class ProductRepositoryImpl implements ProductRepository {
final ProductRemoteDataSource remoteDataSource;
final NetworkInfo…

Hewerton
- 29
- 5