resolve method

Map resolve(
  1. Map obj, [
  2. bool keepAlive = false
])

Resolve (substitute all placeholders) inside a json equivalent dart obj with its own values.

If keepAlive is set to true, it'll leave all placeholders intact if the value is not found inside obj. Or else, it'll be substituted with '' (empty String)

Implementation

Map resolve(Map obj, [bool keepAlive = false]) {
  var jsonString = json.encode(obj);
  jsonString = eval(jsonString, obj, keepAlive);
  return json.decode(jsonString);
}