Skip to content

Commit

Permalink
Reduce amount of swiping required to access toggle buttons via screen…
Browse files Browse the repository at this point in the history
… reader.
  • Loading branch information
amugofjava committed Apr 9, 2024
1 parent b2561b3 commit 1b9ba8e
Showing 1 changed file with 41 additions and 33 deletions.
74 changes: 41 additions & 33 deletions lib/ui/settings/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,51 +58,59 @@ class _SettingsState extends State<Settings> {
return ListView(
children: [
SettingsDividerLabel(label: L.of(context)!.settings_personalisation_divider_label),
ListTile(
shape: const RoundedRectangleBorder(side: BorderSide.none),
title: Text(L.of(context)!.settings_theme_switch_label),
trailing: Switch.adaptive(
value: snapshot.data!.theme == 'dark',
onChanged: (value) {
settingsBloc.darkMode(value);
}),
MergeSemantics(
child: ListTile(
shape: const RoundedRectangleBorder(side: BorderSide.none),
title: Text(L.of(context)!.settings_theme_switch_label),
trailing: Switch.adaptive(
value: snapshot.data!.theme == 'dark',
onChanged: (value) {
settingsBloc.darkMode(value);
}),
),
),
SettingsDividerLabel(label: L.of(context)!.settings_episodes_divider_label),
ListTile(
title: Text(L.of(context)!.settings_mark_deleted_played_label),
trailing: Switch.adaptive(
value: snapshot.data!.markDeletedEpisodesAsPlayed,
onChanged: (value) => setState(() => settingsBloc.markDeletedAsPlayed(value)),
MergeSemantics(
child: ListTile(
title: Text(L.of(context)!.settings_mark_deleted_played_label),
trailing: Switch.adaptive(
value: snapshot.data!.markDeletedEpisodesAsPlayed,
onChanged: (value) => setState(() => settingsBloc.markDeletedAsPlayed(value)),
),
),
),
sdcard
? ListTile(
title: Text(L.of(context)!.settings_download_sd_card_label),
trailing: Switch.adaptive(
value: snapshot.data!.storeDownloadsSDCard,
onChanged: (value) => sdcard
? setState(() {
if (value) {
_showStorageDialog(enableExternalStorage: true);
} else {
_showStorageDialog(enableExternalStorage: false);
}

settingsBloc.storeDownloadonSDCard(value);
})
: null,
? MergeSemantics(
child: ListTile(
title: Text(L.of(context)!.settings_download_sd_card_label),
trailing: Switch.adaptive(
value: snapshot.data!.storeDownloadsSDCard,
onChanged: (value) => sdcard
? setState(() {
if (value) {
_showStorageDialog(enableExternalStorage: true);
} else {
_showStorageDialog(enableExternalStorage: false);
}

settingsBloc.storeDownloadonSDCard(value);
})
: null,
),
),
)
: const SizedBox(
height: 0,
width: 0,
),
SettingsDividerLabel(label: L.of(context)!.settings_playback_divider_label),
ListTile(
title: Text(L.of(context)!.settings_auto_open_now_playing),
trailing: Switch.adaptive(
value: snapshot.data!.autoOpenNowPlaying,
onChanged: (value) => setState(() => settingsBloc.setAutoOpenNowPlaying(value)),
MergeSemantics(
child: ListTile(
title: Text(L.of(context)!.settings_auto_open_now_playing),
trailing: Switch.adaptive(
value: snapshot.data!.autoOpenNowPlaying,
onChanged: (value) => setState(() => settingsBloc.setAutoOpenNowPlaying(value)),
),
),
),
const EpisodeRefreshWidget(),
Expand Down

0 comments on commit 1b9ba8e

Please sign in to comment.