updateFeatureLevelChangeDialog function
Future<bool>
updateFeatureLevelChangeDialog( - dynamic context,
- int maxPowerLevel,
- int? currentPw,
- dynamic space,
- dynamic powerLevels,
- String levelKey,
- String featureName,
)
Implementation
Future<bool> updateFeatureLevelChangeDialog(
BuildContext context,
int maxPowerLevel,
int? currentPw,
Space space,
RoomPowerLevels powerLevels,
String levelKey,
String featureName,
) async {
final lang = L10n.of(context);
final newPowerLevel = await showDialog<int?>(
context: context,
builder: (BuildContext context) => _ChangePowerLevelDialog(
featureName: featureName,
currentPowerLevelName:
maxPowerLevel == 100 ? powerLevelName(currentPw) : 'Custom',
currentPowerLevel: currentPw,
),
);
if (newPowerLevel == currentPw) return false;
if (!context.mounted) {
EasyLoading.dismiss();
return true;
}
return await updateFeatureLevel(
lang,
space,
levelKey,
featureName,
newPowerLevel,
);
}