tryAdaptAutoValidated static method
Non-throwing auto-switch plus post-switch validation.
Implementation
static ValidatedChartAutoSwitchResult tryAdaptAutoValidated(
Map<String, dynamic> json, {
List<ChartType>? preferredOrder,
bool includeCurrentType = false,
bool registeredOnly = true,
bool deep = true,
bool requireRegisteredType = true,
}) {
final result = tryAdaptAuto(
json,
preferredOrder: preferredOrder,
includeCurrentType: includeCurrentType,
registeredOnly: registeredOnly,
);
return ValidatedChartAutoSwitchResult(
switchResult: result,
validation: _validateSwitchedPayload(
result.payload,
deep: deep,
requireRegisteredType: requireRegisteredType,
),
);
}