diff --git a/lib/ui/routes/account_settings/general_account_settings.dart b/lib/ui/routes/account_settings/general_account_settings.dart index 60d2116..b5180af 100644 --- a/lib/ui/routes/account_settings/general_account_settings.dart +++ b/lib/ui/routes/account_settings/general_account_settings.dart @@ -5,6 +5,7 @@ import 'package:comunic/models/general_settings.dart'; import 'package:comunic/ui/dialogs/multi_choices_dialog.dart'; import 'package:comunic/ui/dialogs/virtual_directory_dialog.dart'; import 'package:comunic/ui/widgets/async_screen_widget.dart'; +import 'package:comunic/ui/widgets/settings/multi_choices_settings_tile.dart'; import 'package:comunic/ui/widgets/settings/text_settings_edit_tile.dart'; import 'package:comunic/utils/account_utils.dart'; import 'package:comunic/utils/input_utils.dart'; @@ -141,25 +142,14 @@ class __GeneralAccountSettingsBodyState List _pageSettingsTiles() { return [ // Page visibility - SettingsTile( - title: tr("Page visibility"), - subtitle: _visibilityChoices - .firstWhere((f) => f.id == _settings.pageVisibility) - .subtitle, - onTap: () async { - final choice = await showMultiChoicesDialog( - context: context, - choices: _visibilityChoices, - defaultChoice: _settings.pageVisibility, - title: tr("Change your page visibility"), - ); - - if (choice == null) return; - - _settings.pageVisibility = choice; - _updateSettings(); - }, - ), + MultiChoicesSettingsTile( + title: tr("Page visibility"), + choices: _visibilityChoices, + currentValue: _settings.pageVisibility, + onChanged: (v) { + _settings.pageVisibility = v; + _updateSettings(); + }), // Allow comments on user page ? SettingsTile.switchTile(