Skip to content

Commit

Permalink
Add item icons
Browse files Browse the repository at this point in the history
  • Loading branch information
normalllll committed Aug 22, 2024
1 parent bd98afe commit 700a2a9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/pages/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ class SettingsPage extends StatefulWidget {
}

class _SettingsPageState extends State<SettingsPage> {
Widget buildItem({required Widget title, Widget? subtitle, Function()? onTap}) {
Widget buildItem({
required Widget title,
Widget? subtitle,
Widget? leading,
Function()? onTap,
}) {
return Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: ListTile(
leading: leading,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
Expand Down Expand Up @@ -347,20 +353,26 @@ class _SettingsPageState extends State<SettingsPage> {
children: [
buildItem(
title: Text(i18n.settings.language),
leading: const Icon(Icons.language),
subtitle: Text(languageToText(SettingsService.language)),
onTap: () {
_languageDialog();
},
),
buildItem(
title: Text(i18n.settings.theme),
leading: switch (Theme.of(context).brightness) {
Brightness.dark => const Icon(Icons.dark_mode_outlined),
Brightness.light => const Icon(Icons.light_mode_outlined),
},
subtitle: Text(themeModeToText(SettingsService.themeMode)),
onTap: () {
_themeModeDialog();
},
),
buildItem(
title: Text(i18n.settings.waterfallColumns),
leading: const Icon(Icons.view_column_outlined),
subtitle: Text(waterfallColumns(SettingsService.waterfallColumns)),
onTap: () {
_waterfallColumnsDialog();
Expand All @@ -369,6 +381,7 @@ class _SettingsPageState extends State<SettingsPage> {
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS)
buildItem(
title: Text(i18n.settings.downloadPath),
leading: const Icon(Icons.save_alt_outlined),
subtitle: Text(SettingsService.downloadPath ?? i18n.settings.platformDefault),
onTap: () {
_downloadPathDialog();
Expand Down

0 comments on commit 700a2a9

Please sign in to comment.