tryBuildWidget method

Widget? tryBuildWidget(
  1. BuildContext context,
  2. dynamic spec,
  3. Map state,
  4. Map? parentContext,
)

Tries to execute a Widget build from a spec.

Implementation

Widget? tryBuildWidget(
    BuildContext context, dynamic spec, Map state, Map? parentContext) {
  if (spec == null) {
    return null;
  } else if (spec is Widget) {
    return spec;
  } else if (spec is! Map) {
    return null;
  }
  return buildWidget(context, spec, state, parentContext);
}