moveRow method

Future<bool> moveRow(
  1. int fromIndex,
  2. int toIndex
)

Implementation

Future<bool> moveRow(int fromIndex, int toIndex) async {
  try {
    // reorder hashmap
    moveInHashmap(rows, fromIndex, toIndex);

    // reorder data
    notificationsEnabled = false;
    myDataSource?.move(fromIndex, toIndex, notifyListeners: false);
    data = myDataSource?.data ?? data;
    notificationsEnabled = true;
  } catch (e) {
    Log().exception(e);
  }
  return true;
}