get<T> static method
Implementation
static T get<T>(String key, T defaultValue, {Object? options}) {
try {
if (_ii._local) {
final data = _ii._props[key];
return data is T ? data : defaultValue;
}
return _execute((i) {
Object? cached;
final request = SettingsReadRequest._(
path: key,
type: defaultValue.dataType,
defaultValue: defaultValue,
options: options,
);
if (i._cached != null) {
cached = i._cached?.read(request);
}
cached ??= i._props[key];
if (cached is T) {
return cached;
}
return defaultValue;
});
} catch (msg) {
_log(msg);
return defaultValue;
}
}