RecreatorClassConfig class
Configuration for a single-type-parameter widget that must be re-created (rather than relaxer-wrapped) with a script-supplied type argument.
Some immutable Flutter widgets — DropdownMenuItem<T>,
DropdownMenuEntry<T>, ButtonSegment<T> — cannot be wrapped by a
$Relaxed subclass (they are immutable and drive complex rendering).
Instead the generator emits a D4.registerGenericTypeWrapper re-creator
that reconstructs the widget with the correct <T> by reading the
constructor parameters back from the same-named instance getters.
Each entry lists the className and the concrete innerTypes for which a
switch arm is emitted (in addition to the always-present
dynamic/Object arm). Used by the relaxer generator's re-creator
emitter (recreatorClasses).
Example in buildkit.yaml:
d4rtgen:
recreatorClasses:
- DropdownMenuItem
- className: ButtonSegment
innerTypes: [String, int]
Constructors
-
RecreatorClassConfig({required String className, List<
String> innerTypes = defaultInnerTypes}) -
const
-
RecreatorClassConfig.fromJson(Map<
String, dynamic> json) -
factory
- RecreatorClassConfig.fromYaml(Object value)
-
Parse from a simple string (just the class name) or a map.
factory
Properties
- className → String
-
The widget class name to emit a re-creator for.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
innerTypes
→ List<
String> -
The concrete inner type arguments to emit
switcharms for.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
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
defaultInnerTypes
→ const List<
String> - Default inner types when none are specified — mirrors the hand-written re-creators they replace.