of static method

SpryJson of(
  1. Context context
)

Get the SpryJson instance from the Context.

final SpryJson json = SpryJson.of(context);

Implementation

static SpryJson of(Context context) {
  if (context.contains(SPRY_JSON)) {
    return context.get(SPRY_JSON) as SpryJson;
  }

  _defaultInstance ??= SpryJson();
  context.set(SPRY_JSON, _defaultInstance!);

  return _defaultInstance!;
}