Json.fromList constructor

Json.fromList(
  1. List list, {
  2. bool initial = true,
})

Create Json from a List

Implementation

Json.fromList(List<dynamic> list, {bool initial = true}) {
  _rawValue = <dynamic>[];

  try {
    int i = 0;
    for (var item in list) {
      _set(i++, item);
    }
  } on JsonException catch (error) {
    exception = exception ?? error;
  }
}