|
|
|
@ -1,9 +1,7 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:fluffychat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
|
|
|
|
|
import 'package:fluffychat/widgets/adaptive_dialogs/dialog_text_field.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
|
|
|
|
|
|
Future<int?> showPermissionChooser(
|
|
|
|
|
BuildContext context, {
|
|
|
|
@ -17,25 +15,24 @@ Future<int?> showPermissionChooser(
|
|
|
|
|
builder: (context) => AlertDialog.adaptive(
|
|
|
|
|
title: Text(L10n.of(context).chatPermissions),
|
|
|
|
|
content: ConstrainedBox(
|
|
|
|
|
constraints: const BoxConstraints(maxWidth: 256),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
spacing: 12.0,
|
|
|
|
|
children: [
|
|
|
|
|
Text(L10n.of(context).setPermissionsLevelDescription),
|
|
|
|
|
ValueListenableBuilder(
|
|
|
|
|
valueListenable: error,
|
|
|
|
|
builder: (context, errorText, _) => DialogTextField(
|
|
|
|
|
controller: controller,
|
|
|
|
|
hintText: currentLevel.toString(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
labelText: L10n.of(context).custom,
|
|
|
|
|
errorText: errorText,
|
|
|
|
|
),
|
|
|
|
|
constraints: const BoxConstraints(maxWidth: 256, maxHeight: 256),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
spacing: 12.0,
|
|
|
|
|
children: [
|
|
|
|
|
Text(L10n.of(context).setPermissionsLevelDescription),
|
|
|
|
|
ValueListenableBuilder(
|
|
|
|
|
valueListenable: error,
|
|
|
|
|
builder: (context, errorText, _) => DialogTextField(
|
|
|
|
|
controller: controller,
|
|
|
|
|
hintText: currentLevel.toString(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
labelText: L10n.of(context).custom,
|
|
|
|
|
errorText: errorText,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: [
|
|
|
|
|