我实现的一堆没有空安全性的类(用于模拟目的)现在有编译错误。举个例子:
class MockProvider extends Mock implements Provider<String>{}
这会引发错误:
'Object.toString' ('String Function()') isn't a valid concrete implementation of
'Diagnosticable.toString' ('String Function({DiagnosticLevel minLevel})').
dart(invalid_implementation_override)
模拟 Firestore 做了类似的事情:
class MockFirestore extends Mock implements FirebaseFirestore {}
这会产生以下错误:
'Object.==' ('bool Function(Object)') isn't a valid concrete
implementation of 'FirebaseFirestore.==' ('bool Function(dynamic)')
我怎样才能解决这个问题?