File tree Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import 'package:saber/components/theming/adaptive_alert_dialog.dart';
5
5
import 'package:saber/data/prefs.dart' ;
6
6
import 'package:saber/i18n/strings.g.dart' ;
7
7
import 'package:saber/pages/home/settings.dart' ;
8
+ import 'package:stow/stow.dart' ;
8
9
9
10
class SettingsColor extends StatefulWidget {
10
11
const SettingsColor ({
@@ -23,7 +24,7 @@ class SettingsColor extends StatefulWidget {
23
24
final IconData ? icon;
24
25
final IconData ? Function (Color ? )? iconBuilder;
25
26
26
- final IPref < Color ?> pref;
27
+ final Stow < dynamic , Color ?, dynamic > pref;
27
28
final ValueChanged <Color ?>? afterChange;
28
29
29
30
@override
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/foundation.dart' ;
2
2
import 'package:flutter/material.dart' ;
3
3
import 'package:saber/components/theming/adaptive_toggle_buttons.dart' ;
4
- import 'package:saber/data/prefs.dart' ;
5
4
import 'package:saber/pages/home/settings.dart' ;
5
+ import 'package:stow/stow.dart' ;
6
6
7
7
class SettingsDropdown <T > extends StatefulWidget {
8
8
const SettingsDropdown ({
@@ -22,7 +22,7 @@ class SettingsDropdown<T> extends StatefulWidget {
22
22
final IconData ? icon;
23
23
final IconData ? Function (T )? iconBuilder;
24
24
25
- final IPref < T > pref;
25
+ final Stow < dynamic , T , dynamic > pref;
26
26
final List <ToggleButtonsOption <T >> options;
27
27
final ValueChanged <T >? afterChange;
28
28
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
3
3
import 'package:font_awesome_flutter/font_awesome_flutter.dart' ;
4
4
import 'package:saber/components/settings/settings_dropdown.dart' ;
5
5
import 'package:saber/components/theming/adaptive_toggle_buttons.dart' ;
6
- import 'package:saber/data/prefs.dart' ;
7
6
import 'package:saber/pages/home/settings.dart' ;
7
+ import 'package:stow/stow.dart' ;
8
8
9
9
class SettingsSelection <T extends num > extends StatefulWidget {
10
10
const SettingsSelection ({
@@ -26,7 +26,7 @@ class SettingsSelection<T extends num> extends StatefulWidget {
26
26
final IconData ? icon;
27
27
final IconData ? Function (T )? iconBuilder;
28
28
29
- final IPref < T > pref;
29
+ final Stow < dynamic , T , dynamic > pref;
30
30
final List <ToggleButtonsOption <T >> options;
31
31
final ValueChanged <T >? afterChange;
32
32
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
- import 'package:saber/data/prefs.dart' ;
3
2
import 'package:saber/pages/home/settings.dart' ;
3
+ import 'package:stow/stow.dart' ;
4
4
5
5
class SettingsSwitch extends StatefulWidget {
6
6
const SettingsSwitch ({
@@ -19,7 +19,7 @@ class SettingsSwitch extends StatefulWidget {
19
19
final IconData ? icon;
20
20
final IconData ? Function (bool )? iconBuilder;
21
21
22
- final IPref < bool > pref;
22
+ final Stow < dynamic , bool , dynamic > pref;
23
23
final ValueChanged <bool >? afterChange;
24
24
25
25
@override
Original file line number Diff line number Diff line change @@ -514,7 +514,7 @@ class EncPref<T> extends IPref<T> {
514
514
/// (e.g. in a static field) to avoid extraneous
515
515
/// listeners being added to the underlying [IPref] .
516
516
class TransformedPref <T_in , T_out > extends IPref <T_out > {
517
- final IPref < T_in > pref;
517
+ final Stow < dynamic , T_in , dynamic > pref;
518
518
final T_out Function (T_in ) transform;
519
519
final T_in Function (T_out ) reverseTransform;
520
520
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import 'package:saber/data/prefs.dart';
28
28
import 'package:saber/data/routes.dart' ;
29
29
import 'package:saber/data/tools/shape_pen.dart' ;
30
30
import 'package:saber/i18n/strings.g.dart' ;
31
+ import 'package:stow/stow.dart' ;
31
32
32
33
class SettingsPage extends StatefulWidget {
33
34
const SettingsPage ({super .key});
@@ -37,7 +38,7 @@ class SettingsPage extends StatefulWidget {
37
38
38
39
static Future <bool ?> showResetDialog ({
39
40
required BuildContext context,
40
- required IPref pref,
41
+ required Stow pref,
41
42
required String prefTitle,
42
43
}) async {
43
44
if (pref.value == pref.defaultValue) return null ;
You can’t perform that action at this time.
0 commit comments