GenerateMocker class Null safety
the annotation should be placed on your global mock method:
@GenerateMocker
T mock<T extends Object>({bool relaxed = false} => _$mock<T>(relaxed: relaxed)
}
Constructors
-
GenerateMocker(List<
Type> types, {bool useMockitoGeneratedTypes = true, bool generateMockitoAnnotation = true, bool generateMockExtensions = true, bool generateRelaxedVoidParameter = false, GenerateMocktailFallbackValues? generateMocktailFallbackValues}) -
default constructor for
mockito
const -
GenerateMocker.mocktail(List<
Type> types, {bool useMockitoGeneratedTypes = false, bool generateMockitoAnnotation = false, bool generateMockExtensions = false, bool generateRelaxedVoidParameter = false, GenerateMocktailFallbackValues? generateMocktailFallbackValues}) -
default constructor for mocktail
const
Properties
- generateMockExtensions → bool
-
Generate an
asMock
extension method for all types which casts it as the generated mock type. Due to null safety we can only use theany
matcher on non null params when using the mocked type. Please read Mockito's Null Safety README for more info.final - generateMockitoAnnotation → bool
-
if true, Mockito's own
@GenerateMocks
annotation will be added to the generated mock method. useMockitoGeneratedTypes must be true as well.final - generateMocktailFallbackValues → GenerateMocktailFallbackValues?
-
options for mocktail.
final
- generateRelaxedVoidParameter → bool
-
Add optional
relaxedVoid
parameter to_$mock
method formocktail
.final - hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
-
types
→ List<
Type> -
the types to generate
Mock
classes forfinal - useMockitoGeneratedTypes → bool
-
if true, no mocks will be generated by this builder
but will use the names of classes generated by Mockito.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited