GenerateFake class
Annotation to trigger fake factory generation via build_runner.
Add this annotation to any freezed model to automatically generate
a .fake() extension method.
Example:
@freezed
@generateFake
class User with _$User {
factory User({int? id, String? name}) = _User;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}
// After running build_runner, you can use:
final user = UserFake.fake();
Constructors
- GenerateFake()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited