setInitialValue method
Add/update the data of value
at the position of path
.
Unlike other storage methods, you will not be notified of data updates.
Also, actual data is written after _initialize
is executed.
Please use this function when you want to include mock data or other data in advance.
path
の位置にvalue
のデータを追加・更新します。
他の保存用メソッドと違ってデータの更新が通知されることはありません。
また、_initialize
実行後に実際のデータが書き込まれます。
モックデータなど予めデータを入れておきたい場合などにご利用ください。
Implementation
void setInitialValue(String path, DynamicMap value) {
if (path.isEmpty || value.isEmpty) {
return;
}
path = path.trimQuery().trimString("/");
final paths = path.split("/");
if (paths.isEmpty) {
return;
}
if (_registeredInitialValue.containsKey(path)) {
return;
}
_registeredInitialValue[path] = value;
}