|
|
|
@ -14,7 +14,7 @@ Future<int?> showPermissionChooser(
|
|
|
|
return await showAdaptiveDialog<int>(
|
|
|
|
return await showAdaptiveDialog<int>(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (context) => AlertDialog.adaptive(
|
|
|
|
builder: (context) => AlertDialog.adaptive(
|
|
|
|
title: Text(L10n.of(context).chatPermissions),
|
|
|
|
title: Center(child: Text(L10n.of(context).chatPermissions)),
|
|
|
|
content: ConstrainedBox(
|
|
|
|
content: ConstrainedBox(
|
|
|
|
constraints: const BoxConstraints(maxWidth: 256, maxHeight: 256),
|
|
|
|
constraints: const BoxConstraints(maxWidth: 256, maxHeight: 256),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
@ -39,6 +39,7 @@ Future<int?> showPermissionChooser(
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
bigButtons: true,
|
|
|
|
bigButtons: true,
|
|
|
|
|
|
|
|
borderRadius: AdaptiveDialogAction.topRadius,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
final level = int.tryParse(controller.text.trim());
|
|
|
|
final level = int.tryParse(controller.text.trim());
|
|
|
|
if (level == null) {
|
|
|
|
if (level == null) {
|
|
|
|
@ -55,18 +56,23 @@ Future<int?> showPermissionChooser(
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (maxLevel >= 100 && currentLevel != 100)
|
|
|
|
if (maxLevel >= 100 && currentLevel != 100)
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
|
|
|
|
borderRadius: AdaptiveDialogAction.centerRadius,
|
|
|
|
bigButtons: true,
|
|
|
|
bigButtons: true,
|
|
|
|
onPressed: () => Navigator.of(context).pop<int>(100),
|
|
|
|
onPressed: () => Navigator.of(context).pop<int>(100),
|
|
|
|
child: Text(L10n.of(context).admin),
|
|
|
|
child: Text(L10n.of(context).admin),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (maxLevel >= 50 && currentLevel != 50)
|
|
|
|
if (maxLevel >= 50 && currentLevel != 50)
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
|
|
|
|
borderRadius: maxLevel != 0
|
|
|
|
|
|
|
|
? AdaptiveDialogAction.centerRadius
|
|
|
|
|
|
|
|
: AdaptiveDialogAction.bottomRadius,
|
|
|
|
bigButtons: true,
|
|
|
|
bigButtons: true,
|
|
|
|
onPressed: () => Navigator.of(context).pop<int>(50),
|
|
|
|
onPressed: () => Navigator.of(context).pop<int>(50),
|
|
|
|
child: Text(L10n.of(context).moderator),
|
|
|
|
child: Text(L10n.of(context).moderator),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (currentLevel != 0)
|
|
|
|
if (currentLevel != 0)
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
|
|
|
|
borderRadius: AdaptiveDialogAction.bottomRadius,
|
|
|
|
bigButtons: true,
|
|
|
|
bigButtons: true,
|
|
|
|
onPressed: () => Navigator.of(context).pop<int>(0),
|
|
|
|
onPressed: () => Navigator.of(context).pop<int>(0),
|
|
|
|
child: Text(L10n.of(context).normalUser),
|
|
|
|
child: Text(L10n.of(context).normalUser),
|
|
|
|
|