dogs_flutter library

Classes

AnnotationMessage
A single message produced by a validator.
AnnotationResult
Container for validation results.
AnnotationResultLike
An interface for things that can be converted to an AnnotationResult
AutoStructureBindingLayout
BindingsErrorBuffer
BindingStyle
BindingStyleExtension<SELF>
BindingStyleModifier
BindingTheme
BoolBindingFieldController
BoolBindingFieldWidget
BoolFlutterBinder
CascadeItemType<T>
Defines the item type of the implementing class. The getItemType method in lyell_gen will consider T as the actual item type and treat it as if it is the type argument of a List, Future or a similar generic core types.
ClassValidator<T>
Class level validator for annotations of ClassValidators.
CodecPrimitiveCoercion
Mechanism for coercing specific native types to other native types.
ColumnAutoStructureBindingLayout
ComposableOperationModeFactory<T extends OperationMode>
A OperationModeFactory that composes multiple other factories.
ContextFieldValidator<T>
Field level validator that has access to the whole class instance.
ConverterSupplyingVisitor
Annotation to override the converter used for a field.
DatabindRequiredGuard
DateTimeConverter
DogConverter for DateTime instances which encodes the timestamp as a Iso8601 string.
DefaultNativeCodec
Default implementation of DogNativeCodec. Defines the following native types:
DefaultStructureConverter<T>
Default DogConverter base for DogStructures. Normally extended by generated converters.
DefaultTreeBaseFactories
Collection of default TreeBaseConverterFactorys.
DefaultValue
Contains the default value for a dog serializable field.
DelegateQualifiedTypeTree<T, B>
Description
A SchemaFieldVisitor that adds a description to an APISchemaObject.
DogBool
Graph node representing a boolean value.
DogConverter<T>
Base class for converters used by the DogEngine. Contains structure information about the type being serialized and provides an OperationMode mapping for all supported operation modes.
DogDouble
Graph node representing a double value.
DogEngine
Registry and interface for everything related to dogs.
DogGraphValue
Graph node of the serialized DOG graph.
DogInt
Graph node representing an integer value.
DogLinkable
Interfaces for classes that support linking using dogsLinked
DogList
Graph node representing a list value.
DogMap
Graph node representing a map value.
DogNative
Wrapped native value.
DogNativeCodec
Defines the native object types for a DogEngine and provides converters for them.
DogNull
Graph node representing a null value.
DogsFlutterSchemaTags
DogsMaterializer
Materializes SchemaTypes into MaterializedConverters, which can be used like most other statically defined converters.
DogString
Graph node representing a string value.
DogStructure<T>
Defines the structure of class T and provides methods for instance creation and data lookups. Also contains runtime instances of RetainedAnnotations used in T.
DogStructureConverterImpl<T>
Mock implementation for DefaultStructureConverter.
DogStructureCopyFrontend<T>
Frontend for copying a DogStructure with optional modifications.
DogStructureField
The definition of a field in a DogStructure. Holds all necessary information to validate and serialize and introspect the field.
DogStructureFieldCopyFrontend
Fluent API to create modified copies of a DogStructureField.
DogStructureProxy
Method proxy provider for DogStructures. A structure proxy must provided instantiation/"activation" for the object and property accessor methods for all fields defined by the structure. A get-all method for faster field value retrieval must also be provided.
DogVisitor<T>
Visitor for DogGraphValues that maps a value to type T.
DoubleBindingFieldController
DoubleBindingFieldWidget
DoubleFlutterBinder
DurationConverter
DogConverter for Duration instances which encode a duration as a Iso8601 string.
EnumProperty
Configures how the GeneratedEnumDogConverter will serialize this individual enum value. The name can be overridden by specifying a name. This enum value can also be marked as the fallback value.
ExcludeNull
A field and class level serialization hook that excludes fields with a null value from the serialized map.
ExpandedDogVisitor<T>
A visitor for DogGraphValues that provides a visitor method for each type of value.
FallbackBindingFieldController
FallbackBindingFieldWidget
FallbackFlutterBinder
FieldBinding
FieldBindingBuilder<T extends FieldBindingController>
FieldBindingContext<T>
FieldBindingController<T>
Base class for field binding controllers that manage individual field bindings.
FieldBindingParent
FieldMapStructureProxy
Simple class-less implementation of DogStructureProxy, that serializes to a string keyed field map.
FieldValidator<T>
Property level validator for annotations of DogStructureFields.
FlutterAlignmentConverter
FlutterBorderRadiusConverter
FlutterBoxConstraintsConverter
FlutterColorConverter
FlutterEdgeInsetsConverter
FlutterLogicalKeyConverter
FlutterMatrix4Converter
FlutterOffsetConverter
FlutterRadiusConverter
FlutterRectConverter
FlutterRRectConverter
FlutterSingleActivatorConverter
FlutterSizeConverter
FlutterWidgetBinder<T>
FormatMessages
GeneratedEnumDogConverter<T extends Enum>
A DogConverter that allows for the conversion of enum values to and from strings.
IntBindingFieldController
IntBindingFieldWidget
IntFlutterBinder
IsolatedClassValidator
Validates whole structure instances.
IsolatedFieldValidator
Validates a single field independent of the whole structure.
ItemAssociatedTypeToken<SOURCE, ITEM>
Double type capture token for associated item types. Mainly useful for serialization or type mapping.
IterableTreeNativeOperation
The native operation implementation for IterableTreeBaseConverterMixin.
IterableTreeValidationMode
The validation operation implementation for IterableTreeBaseConverterMixin.
LengthRange
A FieldValidator that restricts the length of a String.
LightweightMigration
LightweightMigration is a class that extends SerializationHook. It provides a lightweight way to handle migrations by executing a list of migration functions before deserialization.
ListAutoFactory
ListBindingFieldController
ListBindingFieldWidget
ListFlutterBinder
MapNTreeArgConverter<K, V>
NTreeArgConverter for Maps.
MaterialBindingStyle
MaterializedConverter
A DogsMaterializer generated proxy around a DogConverter.
Maximum
A FieldValidator that restricts a numeric type to a maximum value.
MemoryDogStructureProxy
Simple class-less implementation of DogStructureProxy, primarily for tests.
Minimum
A FieldValidator that restricts a numeric type to a minimum value.
MustMatch
Requires a field to match another field.
NativeProperty
Metadata that marks a property as native.
NativeRetentionConverter<T>
Converter that just keeps the value as is.
NativeSerializerMode<T>
Operation mode that converters a value to a native representation as defined by the DogNativeCodec of the current DogEngine. For most implementations, this means converting the value to a "primitive" dart type, that could also be encoded using jsonEncode.
NativeStructureContext
The structure context used by StructureNativeSerialization passes.
NativeStructureFieldContext
The field context used by StructureNativeSerialization passes.
NestedStructureAutoFactory
NestedStructureBindingFieldController
NestedStructureBindingFieldWidget
NestedStructureFlutterBinder
NoCodecPrimitiveCoercion
Simple implementation of CodecPrimitiveCoercion that throws an error when coercion is attempted.
NotBlank
A FieldValidator that requires non-null strings to not be blank.
NTreeArgConverter<BASE>
A converter interface for a generic type with a fixed number of type arguments. Used together with TreeBaseConverterFactory.createNargsFactory to create a DogConverter for generic types.
NumberPrimitiveCoercion
CodecPrimitiveCoercion that allows coercion between int and double. Should be used as the default CodecPrimitiveCoercion for DogEngines.
ObjectFactoryStructureProxy<T>
DogStructureProxy implementation for creating universal object factories.
OperationMode<T>
An operation mode exposed by a DogConverter.
OperationModeCacheEntry<T extends OperationMode>
A cache entry for OperationModes. Holds all resolved OperationModes for the specified OperationModeCacheEntry.modeType.
OperationModeFactory<T extends OperationMode>
Factory for OperationModes.
OperationModeRegistry
The registry for OperationModes. Serves as the central point for resolving OperationModes for DogConverters and Types. Also functions as a cache for the resolved OperationModes.
Optional<T>
Port of Java's Optional (https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html)
OptionalNTreeArgConverter<T>
NTreeArgConverter for Optionals.
Page<T>
Collection that represents a page of results.
PageMeta
Metadata about a page.
PageNTreeArgConverter<T>
A NTreeArgConverter for Pages.
PageRequest
Simple page and size based pagination request.
PageRequestConverter
A DogConverter for PageRequests.
PolymorphicConverter
DogConverter that supports polymorphic serialization and deserialization. Supports a maximum of one level of polymorphism because of the lack of runtime type introspection available in Dart.
PostRebuildHook<T>
Hook that runs after a structure T has been rebuilt.
Projection<T>
Creates a reusable list of projections that can be applied to a document.
Projections
A collection of projection transformers.
PropertyName
Overrides the name that will be used by the GeneratedDogConverter for this specific property. By default, the field name will be used.
PropertySerializer
Overrides the serializer that will be used by the GeneratedDogConverter for this specific property. By default, the field will be serialized using the convert associated with its type.
QualifiedTerminal<T>
QualifiedTypeTree<T, B>
QualifiedTypeTreeN<T, B>
Range
A FieldValidator that restricts a numeric type to a minimum and maximum value.
Regex
A FieldValidator that validates a String using a RegExp.
RegExpConverter
DogConverter for RegExp instances which encodes the regular expression as a string.
RetainedAnnotation
Marker annotation to make an annotation accessible at runtime using RetainedAnnotationHolder implementations.
RetainedAnnotationContainer
Standard implementation of const RetainedAnnotationHolder.
RetainedAnnotationHolder
Abstract container of RetainedAnnotations.
RevisionMigration
RevisionMigration is a class that extends SerializationHook. It provides a way to handle migrations by executing a list of migration functions before deserialization and after serialization.
RuntimeEnumConverter
A runtime string-based EnumConverter implementation
SchemaArray
A collection of items.
SchemaBindingStyleContributor
SchemaConfig
Configuration options for schema generation.
SchemaField
A field in a schema object.
SchemaFieldVisitor
Visitor for SchemaField instances that can be used to apply custom annotations and overrides to the fields autogenerated schema.
SchemaMap
A string-keyed map with values of a specific type.
SchemaObject
A collection of key-value pairs.
SchemaObjectUnroller
Unrolls schema objects, extracting all nested objects into separate definitions.
SchemaPass
Internal class to track schema passes and avoid recursion.
SchemaPrimitive
A primitive schema type.
SchemaProperties
Commonly used JSON Schema property keys.
SchemaReference
A reference to another schema structure.
SchemaStructureMaterializationContributor
Allows customization of the materialization process by transforming fields
SchemaType
A schema type.
Serializable
See @serializable.
SerializationHook
SerializationHook is an abstract class that implements StructureMetadata. It provides two methods for handling serialization and deserialization events.
SimpleDogConverter<T>
Simple converter base that only requires a serialize and deserialize method. Automatically adds NativeSerializerMode as well as a synthetic DogStructure with the given SimpleDogConverter.serialName.
SingletonConverterOperationModeFactory<T extends OperationMode>
A OperationModeFactory that returns a single OperationMode for a DogConverter of schema.
SingletonTypeOperationModeFactory<T extends OperationMode>
A OperationModeFactory that returns a singleton OperationMode for a specific type.
SizeRange
A FieldValidator that restricts the size of an Iterable.
StringBindingFieldController
StringBindingFieldWidget
StringFlutterBinder
Structure
Configures the dogs structuration of a class or enum.
StructureBinding<T>
StructureBindingController<T>
A controller that manages the binding between a data structure and Flutter widgets.
StructureBindingProvider
An InheritedWidget that provides a StructureBindingController to the widget tree.
StructureHarbinger<T>
Utility class for resolving converters for a DogStructure.
StructureMetadata
Marks a annotation as a structure annotation and retainable.
StructureNativeSerialization<T>
A NativeSerializerMode that supplies native serialization for DogStructures.
StructureNode
Superclass for all structure related subtypes.
StructureOperationModeFactory<MODE_TYPE extends OperationMode>
Static way to provide additional opmode factories to the default structure converter.
StructureValidation<T>
A ValidationMode that provides validation for DogStructures.
StructureViewer<T>
SyntheticTypeCapture
TextFieldStyle
A style extension for TextField properties that are commonly modified. This extension is not tied to Material Design and can be used with any theme.
TokenTypeTrees
TreeBaseConverterFactory
A factory for DogConverters that are derived from a TypeTree.
TypeCapture<T>
Abstract base class for using a generic type capture.
TypeContainer0
TypeContainer1<A>
TypeContainer2<A, B>
TypeContainer3<A, B, C>
TypeContainer4<A, B, C, D>
TypeContainer5<A, B, C, D, E>
TypeContainer6<A, B, C, D, E, F>
TypeContainer7<A, B, C, D, E, F, G>
TypeContainers
TypeToken<T>
Default implementation for a TypeCapture of type T.
TypeTree<BASE>
TypeTree0<T>
TypeTree1<BASE, ITEM>
TypeTree2<BASE, ITEM0, ITEM1>
TypeTree3<BASE, ITEM0, ITEM1, ITEM2>
TypeTreeN<BASE>
Uint8ListConverter
DogConverter for Uint8List instances which encodes the binary data as a base64 string using base64Encode.
UnsafeRuntimeTypeCapture
Unsafe type capture that only provides the passed in type and otherwise behaves like a dynamic type capture.
UriConverter
DogConverter for Uri instances which encodes the uri into a string.
UseConverterInstance
Annotation to manually set the convert used for a field to a fixed instance.
Validated
A FieldValidator that requires a field to be deeply validated.
ValidationMode<T>
Operation mode that provides a way to validate objects and return validation related error messages as annotations.

Enums

IterableKind
Common iterable kinds which are compatible with dogs.
ModeFactoryInsertionSlot
Specifies where to insert a OperationModeFactory when composing with another factory.
SchemaCoreType
Json Schema core types
StructureConformity
The conformity of a structure.

Mixins

Dataclass<T>
A mixin that provides dataclass functionality to a class, including validation shortcuts, equality, hashcode and toString
EnumConverter<T>
Mixin that exposes a public api surface for enum converters. Primarily intended to be used by opmode factories for converter tree introspection.
ExpandedGraphDogVisitorMixin<T>
A mixin that provides a default implementation for ExpandedDogVisitor. Override the methods to provide custom behavior for each type of value.
FieldSerializationHook
FieldSerializationHook is a mixin for field structure metadata annotations to provide hooks which are able to change map values after serialization and before deserialization.
IterableTreeBaseConverterMixin
A mixin for DogConverters that handle iterable types.
MetadataMixin
A mixin that provides a simple way to add metadata to a class.
OperationMapMixin<T>
Provides a more convenient way to resolve OperationModes for DogConverters.
TypeCaptureMixin<T>
Mixin for adding the TypeCapture interface to classes.

Extension Types

ValidationTrigger

Extensions

AnnotationResultExtensions on AnnotationResult
Extension methods for AnnotationResult.
BindingStyleDataMaterialExtension on BindingStyle
BindingStyleSchemaBuilderExtension on SchemaType
DogEngineShortcuts on DogEngine
Extensions which provide easier shortcuts for common operations.
DogJsonExtension on DogEngine
Extension on DogEngine that provides JSON serialization and deserialization.
DogsIterableExtension on Iterable<T>
Extensions on Iterables.
DogValueExtension on DogGraphValue
Extensions on DogGraphValues.
FieldBindingControllerExtension on FieldBindingController
Extension methods for FieldBindingController.
FieldExtension on DogStructureField
Extensions on DogStructureFields.
ProjectionExtension on DogEngine
Extensions on the DogEngine related to projections.
QualifiedExtension on TypeTree
SchemaGenerateExtension on DogEngine
Extension methods for schema generation on DogEngine.
StructureExtensions on DogStructure
Extensions on DogStructures.
TextFieldStyleExtension on BindingStyle
Extension methods for applying TextField properties from TextFieldStyle
TypeTreeExtension on TypeTree<T>

Constants

beanIgnore → const _BeanIgnore
Marks a property as ignored when using the bean conformity.
deepEquality → const DeepCollectionEquality
Static DeepCollectionEquality instance used by the dog library.
dogsLinked → const DogLinked
Automatically links a DogLinkable object when running the generated dogs plugin.
email → const Regex
Reduced version of a RFC 5322 email regex from https://www.regular-expressions.info/email.html This regex omits IP addresses, double quotes and square brackets.
excludeNull → const ExcludeNull
A field and class level serialization hook that excludes fields with a null value from the serialized map.
linkSerializer → const DogLinked
Manually marks a custom dog converter implementation for linking. The dogs_generator will then include an instance of this converter.
native → const NativeProperty
Metadata that marks a property as native. The value will be kept as is during serialization and deserialization.
negative → const Range
A FieldValidator that restricts a numeric type to be negative.
negativeOrZero → const Range
A FieldValidator that restricts a numeric type to be negative or zero.
notBlank → const NotBlank
Requires non-null strings to not be blank.
polymorphic → const _Polymorphic
Marks a property as polymorphic, meaning its value's type can vary.
positive → const Range
A FieldValidator that restricts a numeric type to be positive.
positiveOrZero → const Range
A FieldValidator that restricts a numeric type to be positive or zero.
serializable → const Structure
Marks a class or enum as serializable.
validated → const Validated
Requires a field to be deeply validated. Example: You have a class Group with a field List<Person> members as well as a type Person which is validatable. You can then annotate your field List<Person> members with @validated to validate all members when validating your container.

Properties

defaultFactories OperationModeFactory<FlutterWidgetBinder>
final
dogs DogEngine
Static instance of DogEngine that will be initialised by invoking the generated initialiseDogs() method.
no setter
kCacheDataclassHashCodes bool
Changes if Dataclasses lazily cache their deep hashCode. Significantly speeds up high-volume comparisons between similar Dataclasses but increases memory overhead.
getter/setter pair
kDefaultPageSize int
The default page size used by PageRequests.
getter/setter pair
kWarnPolymorphicTerminalNode bool
Changes if polymorphic terminal nodes inferred for type trees print warnings on creation in debug mode.
getter/setter pair

Functions

adjustIterable<T>(dynamic value, IterableKind kind) → dynamic
Converts a value to the given IterableKind. If the value is a Iterable implementation, it will converted to the desired IterableKind. Trying to convert singular values to a iterable will result in an exception.
adjustWithCoercion(dynamic value, IterableKind kind, TypeCapture target, CodecPrimitiveCoercion coercion, String? fieldName) → dynamic
Converts a value to the given IterableKind. Tries to coerce the value to the desired type using the coercion if the value is not assignable to the target type.
configureDogs({required List<DogPlugin> plugins, bool global = true}) DogEngine
Entrypoint for enabling and configuring a DogEngine.
DogsFlutterPlugin({List<OperationModeFactory<FlutterWidgetBinder>>? binders, bool addSchemaContributors = true}) DogPlugin
mapifyValue(dynamic obj) Map
Makes sure that the given obj is a map by wrapping it in a map if necessary.
stringKeyedMapFrom(Object? value) Object?
Deeply converts a map with dynamic keys to a map with string keys.
substituteNullValues(Object? value) Object?
Deeply converts a map with dynamic keys to a map with string keys.
unmapifyValue(Map obj) → dynamic
Undo the mapifyValue operation.
unsusbstituteNullValues(Object? value) Object?
Undoes the conversion of substituteNullValues.

Typedefs

AnnotationTransformer = AnnotationResult Function(AnnotationResult result)
DefaultValueSupplier = dynamic Function()
Supplier function for default values.
DogPlugin = void Function(DogEngine engine)
A plugin 'middleware' function that can be used to modify a DogEngine instance.
EnumFromString<T> = T? Function(String)
Decodes a enum value from a string.
EnumToString<T> = String Function(T?)
Encodes a enum value to a string.
FieldBindingWrapper = Widget Function(BuildContext context, Widget inner)
MessageTransformer = AnnotationMessage Function(AnnotationMessage message)
MigrationFunction = dynamic Function(Map<String, dynamic> map, DogStructure structure, DogEngine engine)
A function that may be used to transform a map before deserialization. May be used in conjunction with LightweightMigration or RevisionMigration.
ProjectionTransformer = Map<String, dynamic> Function(Map<String, dynamic> data)
Transformer that applies a projection to a Map document and returns the transformed document if a change was made.
StructureFieldNativeDeserializerFunc = void Function(dynamic v, List args, DogEngine engine)
StructureFieldNativeSerializerFunc = void Function(dynamic v, Map<String, dynamic> map, DogEngine engine)
StyleBuilder = BindingStyle Function(BindingStyle)
Supplier<T> = T Function()
TraverseResult = ({bool exists, dynamic value})
A result of traversing a map. exists is true if the path exists in the map. value is the value at the given path or null if it doesn't exist.

Exceptions / Errors

DogException
General exception for dogs related errors.
DogFieldSerializerException
Specific DogSerializerException thrown when a DogConverter fails to convert a field. Contains the DogStructureField that failed the conversion.
DogProjectionException
Exception thrown when the DogEngine fails to project a document.
DogSerializerException
Exception thrown when a DogConverter fails to convert a value.
ValidationException
An exception thrown when validation fails.