Source
void loadNodesFile() {
if (provider is SerializableNodeProvider &&
!_reconnecting) {
_nodesFile = getConfig("nodes") == null
? new File("${_basePath}/nodes.json")
: new File.fromUri(Uri.parse(getConfig("nodes")));
Map<String, dynamic> loadedNodesData;
if (loadNodesJson) {
_nodesFile = getConfig("nodes") == null
? new File("${_basePath}/nodes.json")
: new File.fromUri(Uri.parse(getConfig("nodes")));
try {
String nodesStr = _nodesFile.readAsStringSync();
var json = DsJson.decode(nodesStr);
if (json is Map<String, dynamic>) {
loadedNodesData = json;
}
} catch (err) {}
}
if (loadedNodesData != null) {
onNodesDeserialized(loadedNodesData);
(provider as SerializableNodeProvider).init(loadedNodesData);
} else if (defaultNodes != null) {
(provider as SerializableNodeProvider).init(defaultNodes);
}
}
}