save method

void save(
  1. T? newValue
)

Data can be saved.

The newValue is saved as it is as data. If Null is given, it is not executed.

If the save is successful, value is replaced with newValue.

If the save fails, an attempt is made to restore to the previous data.

データの保存を行うことができます。

newValueがそのままデータとして保存されます。Nullが与えられた場合実行されません。

保存に成功した場合、valuenewValueに置き換えられます。

保存に失敗した場合、前のデータへの復元を試みます。

Implementation

void save(T? newValue) {
  if (newValue == null) {
    return;
  }
  final document = _document;
  _ref._save(
    document,
    document._filterOnSave(document.toMap(newValue)),
  );
  // TODO: 削除してみたが問題ないか確認
  // document._value = newValue;
}