clone method

  1. @override
RefAppState clone()
override

(en) Returns a clone if all contents of this class are cloneable. Throws an error if any non-cloneable objects are included.

(ja) このクラスの全ての内容がクローン可能な場合はクローンを返します。 クローン可能でないオブジェクトが混ざっている場合はエラーをスローします。

Implementation

@override
RefAppState clone() {
  final newState = RefAppState();
  newState._data.addAll(UtilCopy.deepCopyJsonableOrClonableFile(_data));
  // 状態フラグだけ引き継ぐ
  newState.isLoaded = isLoaded;
  return newState;
}