improve code

This commit is contained in:
nyne
2024-10-08 17:28:09 +08:00
parent 5deb71e10a
commit 12463208a6
4 changed files with 34 additions and 14 deletions

View File

@@ -3,15 +3,12 @@ part of 'settings_page.dart';
class _SwitchSetting extends StatefulWidget {
const _SwitchSetting({
required this.title,
this.subtitle,
required this.settingKey,
this.onChanged,
});
final String title;
final String? subtitle;
final String settingKey;
final VoidCallback? onChanged;
@@ -27,7 +24,6 @@ class _SwitchSettingState extends State<_SwitchSetting> {
return ListTile(
title: Text(widget.title),
subtitle: widget.subtitle == null ? null : Text(widget.subtitle!),
trailing: Switch(
value: appdata.settings[widget.settingKey],
onChanged: (value) {