Skip to content

Commit 2a3c13c

Browse files
committed
feat(settings): use switches instead of checkboxes
1 parent d6495a6 commit 2a3c13c

File tree

1 file changed

+23
-30
lines changed

1 file changed

+23
-30
lines changed

app/lib/screens/settings/settings.dart

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ class _SettingsScreenState extends State<SettingsScreen> {
224224
// Hide update check option if app is distributed through an app store
225225
if (canCheckForUpdate)
226226
ListTile(
227-
leading: const Icon(Icons.update),
228-
title: const Text('Check for update'),
229-
trailing: Switch(
230-
value: app.checkForUpdate,
231-
onChanged: _handlecheckForUpdateToggle),
232-
subtitle:
233-
const Text('Be notified when a new version is available')),
227+
leading: const Icon(Icons.update),
228+
title: const Text('Check for update'),
229+
trailing: Switch(
230+
value: app.checkForUpdate,
231+
onChanged: _handlecheckForUpdateToggle),
232+
subtitle: const Text('Be notified when a new version is available'),
233+
),
234234
Padding(
235235
padding: const EdgeInsets.only(left: 16.0, top: 16),
236236
child: Text('Torrents settings',
@@ -247,23 +247,21 @@ class _SettingsScreenState extends State<SettingsScreen> {
247247
title: const Text('Maximum active downloads'),
248248
subtitle: Text(downloadQueueSize.toString())),
249249
ListTile(
250-
leading: const Icon(Icons.speed),
251-
title: const Text(
252-
'Enable speed limits',
253-
),
254-
subtitle: Text(
255-
"Streaming might not work correctly if you enable speed limits",
256-
style: isSpeedLimitEnabled
257-
? const TextStyle(color: Colors.yellow)
258-
: null),
259-
trailing: Checkbox(
260-
value: isSpeedLimitEnabled,
261-
onChanged: (bool? _) {
262-
_handleEnableSpeedLimits(!isSpeedLimitEnabled);
263-
}),
264-
onTap: () {
265-
_handleEnableSpeedLimits(!isSpeedLimitEnabled);
266-
}),
250+
leading: const Icon(Icons.speed),
251+
title: const Text(
252+
'Enable speed limits',
253+
),
254+
subtitle: Text(
255+
"Streaming might not work correctly if you enable speed limits",
256+
style: isSpeedLimitEnabled
257+
? const TextStyle(color: Colors.yellow)
258+
: null),
259+
trailing: Switch(
260+
value: isSpeedLimitEnabled,
261+
onChanged: (bool _) {
262+
_handleEnableSpeedLimits(!isSpeedLimitEnabled);
263+
}),
264+
),
267265
ListTile(
268266
enabled: isSpeedLimitEnabled,
269267
onTap: showSpeedLimitDownDialog,
@@ -279,13 +277,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
279277
subtitle:
280278
Text('${sessionModel.session?.speedLimitUp.toString()} KBps')),
281279
ListTile(
282-
onTap: () {
283-
setState(() {
284-
showAdvancedSettings = !showAdvancedSettings;
285-
});
286-
},
287280
leading: const Icon(Icons.settings),
288-
trailing: Checkbox(
281+
trailing: Switch(
289282
value: showAdvancedSettings,
290283
onChanged: (v) => {
291284
setState(() {

0 commit comments

Comments
 (0)