Accessor class

Annotation used with the over_react builder to customize individual accessors (props/state fields).

Validation (prefer using using late required props) occurs in UiComponent.validateRequiredProps which requires super calls into componentWillMount and componentWillReceiveProps.

mixin FooProps on UiProps {
  @Accessor(keyNamespace: '', key: 'custom_key')
  String bar;

  @Accessor(isRequired: true)
  String requiredProp;

  @Accessor(isRequired: true, isNullable: true)
  String nullableRequiredProp;
}

Related: requiredProp, nullableRequiredProp.

Constructors

Accessor({String? key, String? keyNamespace, bool isRequired = false, bool isNullable = false, String? requiredErrorMessage, bool doNotGenerate = false})
const

Properties

doNotGenerate bool
Whether to skip generating an accessor for this field.
final
hashCode int
The hash code for this object.
no setterinherited
isNullable bool
Whether setting a prop to null is allowed.
final
isRequired bool
Whether the accessor is required to be set.
final
key String?
A key for the annotated accessor, overriding the default of the accessor's name.
final
keyNamespace String?
A custom namespace for the key namespace of the annotated accessor, overriding the default of '${enclosingClassName}.'.
final
requiredErrorMessage String?
The error message displayed when the accessor is not set.
final
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