buildFromString method

Widget buildFromString(
  1. String jsonString, {
  2. required ActionHandler actionHandler,
  3. Map<String, dynamic>? bindingContext,
  4. StateAdapter? stateAdapter,
})

Parse JSON string and build widget tree.

Implementation

Widget buildFromString(
  String jsonString, {
  required ActionHandler actionHandler,
  Map<String, dynamic>? bindingContext,
  StateAdapter? stateAdapter,
}) {
  final decoded = jsonDecode(jsonString) as Map<String, dynamic>?;
  if (decoded == null) {
    throw JsonParserException('Root JSON must be an object');
  }
  return buildFromMap(
    decoded,
    actionHandler: actionHandler,
    bindingContext: bindingContext,
    stateAdapter: stateAdapter,
  );
}