FakeUtils class
Utility class for generating fake data based on field names.
Uses intelligent field name matching to generate appropriate fake values.
Example:
FakeUtils.fakeForKey('email'); // -> "john@example.com"
FakeUtils.fakeForKey('firstName'); // -> "John"
FakeUtils.fakeForKey('age'); // -> 42
Constructors
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
Static Methods
-
create<
T> (T emptyFactory(), T fromJson(Map< String, dynamic> )) → T - Generate fake model from template instance + fromJson factory.
-
fakeForKey(
String key, {String? dartType}) → dynamic - Generate fake value based on field name.
-
fakeJson(
) → Map< String, dynamic> - Generate fake JSON for API responses (generic fallback).
-
fakeJsonList(
{int count = 5}) → List< Map< String, dynamic> > - Generate a list of fake JSON objects.