save method

Future<void> save(
  1. List<T> list, {
  2. bool isPretty = true,
})

Implementation

Future<void> save(List<T> list, {bool isPretty = true}) async {
  final jsonList = list.map((e) => toMap(e)).toList();
  if (isPretty) {
    await io.write(root, JsonEncoder.withIndent(' ').convert(jsonList));
  } else {
    await io.write(root, jsonEncode(jsonList));
  }
  notify(TDatabaseListenerTypes.saved, null);
}