framework library

Classes

Alphabet
A collection of useful alphabets that can be used to generate ids.
Assert
A decorator that allows adding assert(...) on the generated classes.
Constants
DeepCollectionEquality
Deep equality on collections.
Default
Allows passing default values to a constructor:
EqualUnmodifiableListView<T>
An UnmodifiableListView which overrides ==
EqualUnmodifiableMapView<Key, Value>
An UnmodifiableMapView which overrides ==
EqualUnmodifiableSetView<T>
An UnmodifiableSetView which overrides ==
Expectation<T>
A captured method or property accessor -> a function that returns a value.
Fake
A stand-in for another object which cannot be used except for specifically overridden methods.
Freezed
Flags a class as needing to be processed by Freezed and allows passing options.
FreezedMapOptions
Options for enabling/disabling specific Union.map features;
FreezedUnionValue
An annotation used to specify how a union type will be serialized.
FreezedWhenOptions
Options for enabling/disabling specific Union.when features;
HttpClient
HttpClientMock
HttpResponse
Immutable
Annotation on an immutable class.
Implements<T extends Object?>
Marks a union type to implement the interface stringType or type T. In the case below City will implement AdministrativeArea<House>.
Injector
JsonConverter<T, S>
Implement this class to provide custom converters for a specific Type.
JsonEnum
Allows configuration of how enum elements are treated as JSON.
JsonKey
An annotation used to specify how a field is serialized.
JsonLiteral
An annotation used to generate a private field containing the contents of a JSON file.
JsonSerializable
An annotation used to specify a class to generate code for.
JsonValue
An annotation used to specify how a enum value is serialized.
Logger
LoggerObserver
Mock
Extend or mixin this class to mark the implementation as a Mock.
MockInjector
RecordUse
Annotation on static method or class whose accesses will be recorded.
Repository
Required
Annotation on a required named parameter.
StorageClient
StorageClientMock
StoreKeys
Ulid
Lexicographically sortable, 128-bit identifier (UUID) with 48-bit timestamp and 80 random bits. Canonically encoded as a 26 character string, as opposed to the 36 character UUID.
UseResult
Annotation on function or property whose value must not be ignored.
Uuid
uuid for Dart Author: Yulian Kuncheff Released under MIT License.
UuidValue
VaderEntity
VerificationResult
Information about a stub call verification.
When<T>
Result of when which enables methods to be stubbed via
With<T extends Object?>
Marks a union type to mixin the interface stringType or type T. In the case below City will mixin with AdministrativeArea<House>.

Enums

FieldRename
Values for the automatic field renaming behavior for JsonSerializable.
FreezedUnionCase
Options for automatic union values renaming.
HttpMethod
HttpResponseType
LogLevel
Level of logs to segmentation and control logging output
Namespace
RFC4122 & RFC9562 provided namespaces for v3, v5, and v8 namespace based UUIDs
StorageKey
ValidationMode
The options for UUID Validation strictness

Extensions

ListOfVerificationResult on List<VerificationResult>
Returns the list of argument lists which were captured within verifyInOrder.

Constants

alwaysThrows → const Object
Annotation marking a function as always throwing.
awaitNotRequired → const Object
Annotation on asynchronous function whose Future can be ignored.
checked → const Object
Annotation that no longer has any effect.
doNotStore → const Object
Annotation on function or property whose value must not be stored.
doNotSubmit → const Object
Annotation marking declaration that should be removed before publishing.
experimental → const Object
Annotation marking declaration as experimental and subject to change.
factory → const Object
Annotation on a function that creates new objects.
freezed → const Freezed
Defines an immutable data-class.
immutable → const Immutable
Annotation on an immutable class.
internal → const Object
Annotation on declaration that should not be used outside of its package.
isTest → const Object
Annotation on a test framework function that introduces a single test.
isTestGroup → const Object
Annotation on a test framework function that introduces a group of tests.
literal → const Object
Annotation on constructor that must be invoked with const if possible.
mustBeConst → const Object
Annotation on a parameter whose arguments must be constants.
mustBeOverridden → const Object
Annotation on instance members that must be overridden by subclasses.
mustCallSuper → const Object
Annotation on instance member that overriding members must call.
nonVirtual → const Object
Annotation on instance member that must not be overridden.
optionalTypeArgs → const Object
Annotation on type arguments that can safely be omitted.
protected → const Object
Annotation on instance member that should only be used by subclasses.
redeclare → const Object
Annotation on extension type members which redeclare superinterface members.
reopen → const Object
Annotation on declaration with less access restrictions than superinterface.
required → const Required
Annotation on named parameter that should always have an argument supplied.
sealed → const Object
Annotation on class that must not be subclassed outside of its package.
unfreezed → const Freezed
Defines a potentially mutable data-class.
useResult → const UseResult
Annotation on function or property whose value must not be ignored.
virtual → const Object
Annotation which no longer has any effect.
visibleForOverriding → const Object
Annotation on declaration that should not be used outside of its package.
visibleForTesting → const Object
Annotation on a public declaration that should only be used in tests.

Properties

logger Logger
final
untilCalled Future<Invocation> Function<T>(T _())
Returns a future Invocation that will complete upon the first occurrence of the given invocation.
no setter
verify Verify
Verify that a method on a mock object was called with the given arguments.
no setter
verifyInOrder List<VerificationResult> Function<T>(List<T Function()> recordedInvocations)
Verifies that a list of methods on a mock object have been called with the given arguments. For example:
no setter
verifyNever Verify
Verify that a method on a mock object was never called with the given arguments.
no setter
when When<T> Function<T>(T x())
Create a stub method response.
no setter

Functions

$checkedConvert<T>(Map map, String key, T castFunc(dynamic), {Object? readValue(Map, String)?}) → T
Helper function used in generated code when JsonSerializableGenerator.checked is true.
$checkedCreate<T>(String className, Map map, T constructor(S <S>(String, S (Object?), {Object? readValue(Map, String)?})), {Map<String, String> fieldKeyMap = const {}}) → T
Helper function used in generated code when JsonSerializableGenerator.checked is true.
$checkedNew<T>(String className, Map map, T constructor(), {Map<String, String>? fieldKeyMap}) → T
Helper function used in generated code when JsonSerializableGenerator.checked is true.
$checkKeys(Map map, {List<String>? allowedKeys, List<String>? requiredKeys, List<String>? disallowNullValues}) → void
Helper function used in generated fromJson code when JsonSerializable.disallowUnrecognizedKeys is true for an annotated type or JsonKey.required is true for any annotated fields.
$enumDecode<K extends Enum, V>(Map<K, V> enumValues, Object? source, {K? unknownValue}) → K
Returns the key associated with value source from enumValues, if one exists.
$enumDecodeNullable<K extends Enum, V>(Map<K, V> enumValues, Object? source, {Enum? unknownValue}) → K?
Returns the key associated with value source from enumValues, if one exists.
any<T>({String? named, Matcher? that}) → T
An argument matcher that matches any argument passed in.
captureAny<T>({String? named, Matcher? that}) → T
An argument matcher that captures any argument passed in.
clearInteractions(dynamic mock) → void
Clear the collected interactions with mock.
logInvocations(List<Mock> mocks) → void
Print all collected invocations of any mock methods of mocks.
nanoid({int length = 21, String? alphabet, Random? random}) String
This generator function create a tiny, secure, URL-friendly, unique string ID
registerFallbackValue(dynamic value) → void
Allows any and captureAny to be used on parameters of type value.
reset(dynamic mock) → void
Clear stubs of, and collected interactions with mock.
resetMocktailState() → void
Reset the state of Mocktail, typically for use between tests.
sandbox(Function function, {LogLevel logLevel = LogLevel.debug, bool enableStopwatch = true}) Future<void>
throwOnMissingStub(Mock mock, {void exceptionBuilder(Invocation)?}) → void
Opt-into Mock throwing NoSuchMethodError for unimplemented methods.
verifyNoMoreInteractions(dynamic mock) → void
Ensure no redundant invocations occur.
verifyZeroInteractions(dynamic mock) → void
Ensure interactions never happened on a mock.

Typedefs

Answer<T> = T Function(Invocation invocation)
Returns a value dependent on the details of an invocation.
Verify = VerificationResult Function<T>(T matchingInvocations())
Type definition for the object returned when invoking verify.

Exceptions / Errors

AccessDeniedException
BadKeyException
A base class for exceptions thrown when decoding JSON.
CheckedFromJsonException
Exception thrown if there is a runtime exception in fromJson code generated when JsonSerializableGenerator.checked is true
DisallowedNullValueException
Exception thrown if there are keys with disallowed null values in a JSON map that was provided during deserialization.
InternetConnectionException
MissingRequiredKeysException
Exception thrown if there are missing required keys in a JSON map that was provided during deserialization.
MissingStubError
An error which is thrown when no stub is found which matches the arguments of a real method call on a mock object.
ParseDataException
ServerException
UnrecognizedKeysException
Exception thrown if there are unrecognized keys in a JSON map that was provided during deserialization.