Cleanup
This commit is contained in:
@@ -2,12 +2,12 @@ import 'package:app/core/i18n/translations.g.dart';
|
||||
import 'package:app/core/ui/controller/locale_controller.dart';
|
||||
import 'package:app/core/ui/controller/scale_controller.dart';
|
||||
import 'package:app/core/ui/controller/theme.dart';
|
||||
import 'package:app/modules/settings/modules/app/model/app_settings_view_model.dart';
|
||||
import 'package:app/modules/settings/modules/app/model/design_settings_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AppSettingsView extends StatelessWidget {
|
||||
const AppSettingsView({super.key});
|
||||
class DesignSettingsView extends StatelessWidget {
|
||||
const DesignSettingsView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -3,26 +3,20 @@ import 'package:app/modules/settings/modules/app/model/feature_settings_view_mod
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:app/core/i18n/translations.g.dart';
|
||||
|
||||
/// A dedicated section under "Einstellungen" to enable/disable features.
|
||||
/// You can link this screen from your existing Settings list.
|
||||
/// If you keep a single Settings page, render _FeatureSettingsSection in-place.
|
||||
class FeatureSettingsView extends StatelessWidget {
|
||||
const FeatureSettingsView({super.key});
|
||||
class AppSettingsView extends StatelessWidget {
|
||||
const AppSettingsView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final t = Translations.of(context);
|
||||
final featureController = context.read<FeatureController>();
|
||||
final model = FeatureSettingsViewModel(featureController);
|
||||
|
||||
return ChangeNotifierProvider(
|
||||
create: (BuildContext context) => model,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(title: Text(t.settings.featureSettings)),
|
||||
body: const _FeatureSettingsSection(),
|
||||
),
|
||||
child: Scaffold(body: const _FeatureSettingsSection()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class AppSettingsViewModel extends ChangeNotifier {
|
||||
bool _isLoading = false;
|
||||
bool _isSaving = false;
|
||||
|
||||
final ThemeController _theme;
|
||||
final ScaleController _scale;
|
||||
@@ -53,6 +52,4 @@ class AppSettingsViewModel extends ChangeNotifier {
|
||||
TextScalePref get textScale => _scale.scale;
|
||||
|
||||
bool get isLoading => _isLoading;
|
||||
|
||||
bool get isSaving => _isSaving;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:app/core/i18n/translations.g.dart';
|
||||
import 'package:app/core/ui/panel.dart';
|
||||
import 'package:app/modules/settings/modules/app/app_settings_view.dart';
|
||||
import 'package:app/modules/settings/modules/app/design_settings_view.dart';
|
||||
import 'package:app/modules/settings/modules/app/features_settings_view.dart';
|
||||
import 'package:app/modules/settings/modules/help/feedback_view.dart';
|
||||
import 'package:app/modules/settings/modules/help/help_view.dart';
|
||||
@@ -14,10 +14,7 @@ class SettingsView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final t = Translations.of(context);
|
||||
|
||||
return Scaffold(
|
||||
// appBar: AppBar(title: Text(t.settings.title)),
|
||||
body: PanelNavigator(rootBuilder: (ctx) => _CategoryList()),
|
||||
);
|
||||
}
|
||||
@@ -55,65 +52,69 @@ class _CategoryList extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_SectionHeader(t.settings.sections.app),
|
||||
tile(
|
||||
Icons.tune,
|
||||
t.settings.items.appSettings,
|
||||
() => const AppSettingsView(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
tile(
|
||||
Icons.tune,
|
||||
t.settings.featureSettings,
|
||||
() => const FeatureSettingsView(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_SectionHeader(t.settings.sections.app),
|
||||
tile(
|
||||
Icons.tune,
|
||||
t.settings.items.appSettings,
|
||||
() => const AppSettingsView(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
tile(
|
||||
Icons.phone_iphone,
|
||||
t.settings.items.designSettings,
|
||||
() => const DesignSettingsView(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_SectionHeader(t.settings.sections.account),
|
||||
tile(
|
||||
Icons.badge_outlined,
|
||||
t.settings.items.personalData,
|
||||
() => const PersonalPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.manage_accounts_outlined,
|
||||
t.settings.items.accountManagement,
|
||||
() => const AccountPanel(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_SectionHeader(t.settings.sections.account),
|
||||
tile(
|
||||
Icons.badge_outlined,
|
||||
t.settings.items.personalData,
|
||||
() => const PersonalPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.manage_accounts_outlined,
|
||||
t.settings.items.accountManagement,
|
||||
() => const AccountPanel(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_SectionHeader(t.settings.sections.help),
|
||||
tile(
|
||||
Icons.help_outline,
|
||||
t.settings.items.helpCenter,
|
||||
() => const HelpPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.feedback_outlined,
|
||||
t.settings.items.feedback,
|
||||
() => const FeedbackPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.gavel_outlined,
|
||||
t.settings.items.legalPrivacy, // "Rechtliches & Datenschutz"
|
||||
() => const LegalPanel(),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_SectionHeader(t.settings.sections.help),
|
||||
tile(
|
||||
Icons.help_outline,
|
||||
t.settings.items.helpCenter,
|
||||
() => const HelpPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.feedback_outlined,
|
||||
t.settings.items.feedback,
|
||||
() => const FeedbackPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.gavel_outlined,
|
||||
t.settings.items.legalPrivacy, // "Rechtliches & Datenschutz"
|
||||
() => const LegalPanel(),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
const Divider(),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.logout),
|
||||
title: Text(t.settings.items.logout),
|
||||
onTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(t.settings.messages.logoutNotImplemented)),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
const Divider(),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.logout),
|
||||
title: Text(t.settings.items.logout),
|
||||
onTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(t.settings.messages.logoutNotImplemented),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user