1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Can force to use mobile mode

This commit is contained in:
2020-05-13 18:21:30 +02:00
parent d04b40f662
commit a6ce969e89
2 changed files with 23 additions and 5 deletions

View File

@ -11,12 +11,10 @@ import 'package:settings_ui/settings_ui.dart';
class ApplicationSettings extends StatefulWidget {
@override
_ApplicationSettingsState createState() =>
_ApplicationSettingsState();
_ApplicationSettingsState createState() => _ApplicationSettingsState();
}
class _ApplicationSettingsState
extends State<ApplicationSettings> {
class _ApplicationSettingsState extends State<ApplicationSettings> {
PreferencesHelper _preferencesHelper;
Future<void> _refresh() async {
@ -31,7 +29,11 @@ class _ApplicationSettingsState
Widget _buildSections() {
return SettingsList(
sections: [_buildAppearanceSection(), _buildGeneralSection()],
sections: [
_buildAppearanceSection(),
_buildGeneralSection(),
_buildDebugSection()
],
);
}
@ -61,6 +63,21 @@ class _ApplicationSettingsState
],
);
/// Debug section
SettingsSection _buildDebugSection() => SettingsSection(
title: tr("Debug features"),
tiles: [
_PreferencesSettingsTile(
preferencesKey: PreferencesKeyList.FORCE_MOBILE_MODE,
title: tr("Force mobile mode"),
subtitle: tr(
"Force the smartphone mode of the application to be used, even when tablet mode could be used."),
onChange: _updatedSettings,
helper: _preferencesHelper,
),
],
);
/// Apply new settings
_updatedSettings() {
setState(() {});