updateFeatureLevel function
Implementation
Future<bool> updateFeatureLevel(
L10n lang,
Space space,
String levelKey,
String featureName,
int? newPowerLevel,
) async {
EasyLoading.show(status: lang.changingSettingOf(featureName));
try {
final res = await space.updateFeaturePowerLevels(
levelKey,
newPowerLevel,
);
EasyLoading.showToast(lang.powerLevelSubmitted(featureName));
return res;
} catch (e, s) {
_log.severe('Failed to change power level of $featureName', e, s);
EasyLoading.showError(
lang.failedToChangePowerLevel(e),
duration: const Duration(seconds: 3),
);
return false;
}
}