JsonWidget class

An annotation to be placed on a class requesting the dynamic widget code generator to generate the dynamic code.

The widget can be used to name the widget that is being used in things like the schema. This can be used to rename a private widget that wraps a standard widget so that it looks like the standard widget in the documentation and to any downstream tools.

The autoRegister can be set to false to skip adding the widget to the default registrar.

The type can override the widget JSON type that is generated for the widget. By default the type is a snake_case'd version of the Widget. For example, ListView becomes list_view. However, there may be times where the default type may be undesireable. ClipRRrect becoming clip_r_rect for instance. In that case, JsonWidget(type: 'clip_rrect') could set the actual type to clip_rrect.

The jsonWidget defines the name of the generated reverse encodable widget if you would like to use a name that is different from the default.

Annotations
  • @Target({TargetKind.classType})

Constructors

JsonWidget({bool autoRegister = true, String? jsonWidget, String? type, String? widget})
const

Properties

autoRegister bool
final
hashCode int
The hash code for this object.
no setterinherited
jsonWidget String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String?
final
widget String?
final

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