Implement settings
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Successful in 51s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 11m17s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-04-19 01:49:28 +02:00
parent 5417796f3f
commit b91ddc172d
33 changed files with 912 additions and 127 deletions

View File

@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:settings_ui/settings_ui.dart';
class SettingsPickerScreen<T> extends StatelessWidget {
const SettingsPickerScreen({
Key? key,
required this.title,
required this.initialValue,
required this.values,
required this.onValueChanged,
this.icons,
}) : super(key: key);
final String title;
final T initialValue;
final List<T> values;
final void Function(T value) onValueChanged;
final Widget Function(T v)? icons;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(title)),
body: SettingsList(
platform: PlatformUtils.detectPlatform(context),
sections: [
SettingsSection(
tiles: values.map((e) {
return SettingsTile(
leading: icons != null ? icons!(e) : null,
title: Text(e.toString()),
onPressed: (_) {
onValueChanged(e);
Navigator.of(context).pop();
},
);
}).toList(),
),
],
),
);
}
}