Skip to content

Commit

Permalink
add setting for syncing only over wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaGergedan committed Oct 27, 2024
1 parent f58cd6d commit bd41f20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/data/prefs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ abstract class Prefs {

static late final PlainPref<Uint8List?> pfp;
static late final PlainPref<bool> syncInBackground;
static late final PlainPref<bool> onlySyncOverWifi;

static late final PlainPref<ThemeMode> appTheme;

Expand Down Expand Up @@ -168,6 +169,7 @@ abstract class Prefs {

pfp = PlainPref('pfp', null);
syncInBackground = PlainPref('syncInBackground', true);
onlySyncOverWifi = PlainPref('onlySyncOverWifi', true);

appTheme = PlainPref('appTheme', ThemeMode.system);
platform = PlainPref('platform', defaultTargetPlatform);
Expand Down
9 changes: 9 additions & 0 deletions lib/pages/home/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,15 @@ class _SettingsPageState extends State<SettingsPage> {
},
pref: Prefs.hyperlegibleFont,
),
SettingsSwitch(
title: 'Sync notes only over WiFi',
subtitle: 'If disabled mobile data may be used to sync notes',
iconBuilder: (i) => switch (Prefs.platform.value) {
TargetPlatform.iOS || TargetPlatform.macOS => Icons.wifi_rounded,
_ => Icons.wifi_sharp,
},
pref: Prefs.onlySyncOverWifi,
),
SettingsSubtitle(subtitle: t.settings.prefCategories.writing),
SettingsSwitch(
title: t.settings.prefLabels.preferGreyscale,
Expand Down

0 comments on commit bd41f20

Please sign in to comment.