moveJsonList method

  1. @override
void moveJsonList(
  1. String file,
  2. List<Object> path,
  3. int from,
  4. int to,
)
override

Moves an item of the list at path in file.

Implementation

@override
void moveJsonList(String file, List<Object> path, int from, int to) {
  final list = _jsonAt(current?.file(file), path);
  if (list is! List || from < 0 || from >= list.length || to < 0 || to >= list.length) return;
  final value = list.removeAt(from);
  list.insert(to, value);
  configEdited(file);
}