decodeJsonAsync function

Future decodeJsonAsync(
  1. String text, {
  2. bool background = false,
})

Background decoding is explicit. Model construction remains with the caller.

Implementation

Future<dynamic> decodeJsonAsync(String text, {bool background = false}) async {
  if (background) {
    return worker.decode(text);
  }
  return jsonDecode(text);
}