~repos /only-bible-app
GIT_CONFIG_PARAMETERS="'http.version=HTTP/1.1'" git clone
https://git.pyrossh.dev/only-bible-app.git
Discussions:
https://groups.google.com/g/rust-embed-devs
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
46d07536
—
pyrossh 1 month ago
remove settings ui
- lib/store/actions_navigation.dart +12 -1
- lib/theme.dart +6 -38
- lib/widgets/book_tile.dart +3 -2
- lib/widgets/highlight_button.dart +1 -0
- lib/widgets/settings_sheet.dart +123 -84
- pubspec.lock +0 -8
- pubspec.yaml +0 -1
lib/store/actions_navigation.dart
CHANGED
|
@@ -24,7 +24,18 @@ class ShowSettingsAction extends ReduxAction<AppState> {
|
|
|
24
24
|
enableDrag: true,
|
|
25
25
|
showDragHandle: true,
|
|
26
26
|
useSafeArea: true,
|
|
27
|
+
builder: (context) {
|
|
28
|
+
final surface = Theme.of(context).colorScheme.surface;
|
|
29
|
+
return Theme(
|
|
30
|
+
data: Theme.of(context).copyWith(
|
|
31
|
+
bottomSheetTheme: BottomSheetThemeData(
|
|
32
|
+
backgroundColor: surface,
|
|
33
|
+
dragHandleColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
34
|
+
),
|
|
35
|
+
),
|
|
27
|
-
|
|
36
|
+
child: SettingsSheet(bible: bible),
|
|
37
|
+
);
|
|
38
|
+
},
|
|
28
39
|
);
|
|
29
40
|
return null;
|
|
30
41
|
}
|
lib/theme.dart
CHANGED
|
@@ -16,7 +16,7 @@ const darkHighlights = [
|
|
|
16
16
|
|
|
17
17
|
const lightColorScheme = ColorScheme(
|
|
18
18
|
brightness: Brightness.light,
|
|
19
|
-
primary: Color(
|
|
19
|
+
primary: Color.fromARGB(255, 100, 127, 203),
|
|
20
20
|
onPrimary: Color(0xFFFFFFFF),
|
|
21
21
|
primaryContainer: Color(0xFFDAE2FF),
|
|
22
22
|
onPrimaryContainer: Color(0xFF001848),
|
|
@@ -32,10 +32,10 @@ const lightColorScheme = ColorScheme(
|
|
|
32
32
|
onError: Color(0xFFFFFFFF),
|
|
33
33
|
errorContainer: Color(0xFFFFDAD6),
|
|
34
34
|
onErrorContainer: Color(0xFF410002),
|
|
35
|
-
surface: Color(
|
|
35
|
+
surface: Color(0xFFFFFFFF),
|
|
36
36
|
onSurface: Color(0xFF000000),
|
|
37
37
|
onSurfaceVariant: Color(0xFF45464F),
|
|
38
|
-
outline: Color(
|
|
38
|
+
outline: Color.fromARGB(255, 157, 160, 171),
|
|
39
39
|
outlineVariant: Color(0xFFC5C6D0),
|
|
40
40
|
shadow: Color.fromARGB(255, 88, 85, 85),
|
|
41
41
|
scrim: Color(0xFF000000),
|
|
@@ -119,27 +119,15 @@ final lightTheme = ThemeData(
|
|
|
119
119
|
foregroundColor: lightColorScheme.onSurface,
|
|
120
120
|
elevation: 1,
|
|
121
121
|
),
|
|
122
|
-
bottomSheetTheme:
|
|
122
|
+
bottomSheetTheme: BottomSheetThemeData(
|
|
123
123
|
elevation: 10,
|
|
124
|
-
backgroundColor:
|
|
124
|
+
backgroundColor: lightColorScheme.surface,
|
|
125
|
-
shadowColor:
|
|
125
|
+
shadowColor: lightColorScheme.scrim,
|
|
126
|
-
surfaceTintColor: Color(0xFFF2F2F7),
|
|
127
126
|
showDragHandle: true,
|
|
128
127
|
dragHandleSize: Size(50, 3),
|
|
129
|
-
clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
130
|
-
shape: RoundedRectangleBorder(
|
|
131
|
-
side: BorderSide(
|
|
132
|
-
color: Color(0xFFAFA8A8),
|
|
133
|
-
),
|
|
134
|
-
borderRadius: BorderRadius.only(
|
|
135
|
-
topLeft: Radius.circular(25.0),
|
|
136
|
-
topRight: Radius.circular(25.0),
|
|
137
|
-
),
|
|
138
|
-
),
|
|
139
128
|
),
|
|
140
129
|
dialogTheme: const DialogThemeData(
|
|
141
130
|
elevation: 10,
|
|
142
|
-
// TODO: get this to inherit from top like darkTheme does
|
|
143
131
|
shadowColor: Colors.black,
|
|
144
132
|
backgroundColor: Colors.white,
|
|
145
133
|
surfaceTintColor: Colors.white,
|
|
@@ -150,26 +138,6 @@ final lightTheme = ThemeData(
|
|
|
150
138
|
),
|
|
151
139
|
),
|
|
152
140
|
),
|
|
153
|
-
popupMenuTheme: const PopupMenuThemeData(
|
|
154
|
-
enableFeedback: true,
|
|
155
|
-
elevation: 4,
|
|
156
|
-
surfaceTintColor: Colors.transparent,
|
|
157
|
-
),
|
|
158
|
-
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
159
|
-
style: TextButton.styleFrom(
|
|
160
|
-
elevation: 0.5,
|
|
161
|
-
shadowColor: Colors.black,
|
|
162
|
-
surfaceTintColor: Colors.white,
|
|
163
|
-
backgroundColor: const Color(0xFFEAE9E9),
|
|
164
|
-
foregroundColor: lightColorScheme.primary,
|
|
165
|
-
shape: const RoundedRectangleBorder(
|
|
166
|
-
side: BorderSide(
|
|
167
|
-
color: Colors.grey,
|
|
168
|
-
width: 1,
|
|
169
|
-
),
|
|
170
|
-
),
|
|
171
|
-
),
|
|
172
|
-
),
|
|
173
141
|
iconButtonTheme: IconButtonThemeData(
|
|
174
142
|
style: IconButton.styleFrom(
|
|
175
143
|
enableFeedback: true,
|
lib/widgets/book_tile.dart
CHANGED
|
@@ -11,7 +11,7 @@ class BookTile extends StatelessWidget {
|
|
|
11
11
|
Widget build(BuildContext context) {
|
|
12
12
|
final colorScheme = Theme.of(context).colorScheme;
|
|
13
13
|
return Material(
|
|
14
|
-
elevation:
|
|
14
|
+
elevation: 4,
|
|
15
15
|
color: isSelected ? colorScheme.primaryContainer : colorScheme.surface,
|
|
16
16
|
shadowColor: colorScheme.scrim,
|
|
17
17
|
shape: RoundedRectangleBorder(
|
|
@@ -22,6 +22,7 @@ class BookTile extends StatelessWidget {
|
|
|
22
22
|
),
|
|
23
23
|
),
|
|
24
24
|
child: InkWell(
|
|
25
|
+
enableFeedback: true,
|
|
25
26
|
borderRadius: BorderRadius.circular(12),
|
|
26
27
|
onTap: onTap,
|
|
27
28
|
child: Center(
|
|
@@ -30,7 +31,7 @@ class BookTile extends StatelessWidget {
|
|
|
30
31
|
textAlign: TextAlign.center,
|
|
31
32
|
style: TextStyle(
|
|
32
33
|
fontSize: 16,
|
|
33
|
-
fontWeight: isSelected ? FontWeight.
|
|
34
|
+
fontWeight: isSelected ? FontWeight.w700 : FontWeight.w600,
|
|
34
35
|
color: isSelected ? colorScheme.onPrimaryContainer : colorScheme.onSurface,
|
|
35
36
|
),
|
|
36
37
|
),
|
lib/widgets/highlight_button.dart
CHANGED
|
@@ -10,6 +10,7 @@ class HighlightButton extends StatelessWidget {
|
|
|
10
10
|
@override
|
|
11
11
|
Widget build(BuildContext context) {
|
|
12
12
|
return InkWell(
|
|
13
|
+
enableFeedback: true,
|
|
13
14
|
onTap: () => onHighlightSelected(index),
|
|
14
15
|
child: Container(
|
|
15
16
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
lib/widgets/settings_sheet.dart
CHANGED
|
@@ -2,8 +2,6 @@ import "package:flutter/material.dart";
|
|
|
2
2
|
import "package:only_bible_app/gen/bible.gen.dart";
|
|
3
3
|
import "package:only_bible_app/store/app_state.dart";
|
|
4
4
|
import "package:only_bible_app/store/actions_state.dart";
|
|
5
|
-
import "package:only_bible_app/utils.dart";
|
|
6
|
-
import "package:settings_ui/settings_ui.dart";
|
|
7
5
|
|
|
8
6
|
class SettingsSheet extends StatelessWidget {
|
|
9
7
|
final Bible bible;
|
|
@@ -16,99 +14,140 @@ class SettingsSheet extends StatelessWidget {
|
|
|
16
14
|
final boldFont = context.select((s) => s.boldFont);
|
|
17
15
|
final engTitles = context.select((s) => s.engTitles);
|
|
18
16
|
final fontSize = context.select((s) => s.fontSize);
|
|
17
|
+
final colorScheme = Theme.of(context).colorScheme;
|
|
18
|
+
|
|
19
|
-
return
|
|
19
|
+
return Padding(
|
|
20
|
+
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
21
|
+
child: Column(
|
|
20
|
-
|
|
22
|
+
mainAxisSize: MainAxisSize.min,
|
|
21
|
-
platform: DevicePlatform.iOS,
|
|
22
|
-
|
|
23
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
23
|
-
settingsListBackground: Color(0xFFF2F2F7),
|
|
24
|
-
),
|
|
25
|
-
darkTheme: const SettingsThemeData(
|
|
26
|
-
settingsListBackground: Color(0xFF141415),
|
|
27
|
-
),
|
|
28
|
-
|
|
24
|
+
children: [
|
|
29
|
-
SettingsSection(
|
|
30
|
-
|
|
25
|
+
Text(
|
|
31
26
|
bible.settingsTitle!,
|
|
32
|
-
style: context.
|
|
27
|
+
style: Theme.of(context).textTheme.headlineMedium,
|
|
33
28
|
),
|
|
29
|
+
const SizedBox(height: 16),
|
|
30
|
+
// Theme toggle
|
|
31
|
+
Material(
|
|
32
|
+
elevation: 1,
|
|
33
|
+
borderRadius: BorderRadius.circular(12),
|
|
34
|
+
color: colorScheme.surface,
|
|
35
|
+
child: Container(
|
|
34
|
-
|
|
36
|
+
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
|
37
|
+
decoration: BoxDecoration(
|
|
38
|
+
borderRadius: BorderRadius.circular(12),
|
|
39
|
+
border: Border.all(color: colorScheme.scrim),
|
|
40
|
+
),
|
|
41
|
+
child: Row(
|
|
35
|
-
|
|
42
|
+
children: [
|
|
36
|
-
SettingsTile.navigation(
|
|
37
|
-
|
|
43
|
+
const Icon(Icons.color_lens_outlined, color: Colors.green),
|
|
44
|
+
const SizedBox(width: 12),
|
|
38
|
-
|
|
45
|
+
Expanded(child: Text(bible.themeTitle!)),
|
|
39
|
-
|
|
46
|
+
ToggleButtons(
|
|
40
|
-
onPressed: (int index) {
|
|
41
|
-
|
|
47
|
+
onPressed: (_) => context.dispatch(ToggleDarkModeAction()),
|
|
42
|
-
},
|
|
43
|
-
|
|
48
|
+
highlightColor: Colors.transparent,
|
|
44
|
-
|
|
49
|
+
borderColor: Colors.grey,
|
|
45
|
-
|
|
50
|
+
borderRadius: const BorderRadius.all(Radius.circular(25)),
|
|
46
|
-
|
|
51
|
+
selectedColor: darkMode ? Colors.lightBlue.shade300 : Colors.yellowAccent.shade700,
|
|
47
|
-
|
|
52
|
+
selectedBorderColor: Colors.grey,
|
|
48
|
-
|
|
53
|
+
color: Colors.grey,
|
|
49
|
-
|
|
54
|
+
fillColor: Colors.transparent,
|
|
50
|
-
|
|
55
|
+
constraints: const BoxConstraints(minHeight: 36, minWidth: 50),
|
|
56
|
+
isSelected: [!darkMode, darkMode],
|
|
57
|
+
children: const [
|
|
51
|
-
|
|
58
|
+
Icon(Icons.light_mode),
|
|
52
|
-
|
|
59
|
+
Icon(Icons.dark_mode),
|
|
60
|
+
],
|
|
53
|
-
|
|
61
|
+
),
|
|
54
|
-
isSelected: [!darkMode, darkMode],
|
|
55
|
-
children: const [
|
|
56
|
-
Icon(Icons.light_mode),
|
|
57
|
-
Icon(Icons.dark_mode),
|
|
58
62
|
],
|
|
59
63
|
),
|
|
60
64
|
),
|
|
65
|
+
),
|
|
61
|
-
|
|
66
|
+
const SizedBox(height: 8),
|
|
67
|
+
// Font size slider
|
|
68
|
+
Material(
|
|
69
|
+
elevation: 1,
|
|
70
|
+
borderRadius: BorderRadius.circular(12),
|
|
62
|
-
|
|
71
|
+
color: colorScheme.surface,
|
|
63
|
-
color: darkMode ? const Color(0xFF1C1C1E) : Colors.white,
|
|
64
|
-
|
|
72
|
+
child: Container(
|
|
73
|
+
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
|
74
|
+
decoration: BoxDecoration(
|
|
75
|
+
borderRadius: BorderRadius.circular(12),
|
|
76
|
+
border: Border.all(color: colorScheme.scrim),
|
|
77
|
+
),
|
|
78
|
+
child: Row(
|
|
65
|
-
|
|
79
|
+
children: [
|
|
66
|
-
Padding(
|
|
67
|
-
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
68
|
-
child: Row(
|
|
69
|
-
children: [
|
|
70
|
-
Icon(
|
|
71
|
-
Icons.format_size,
|
|
72
|
-
|
|
80
|
+
Icon(Icons.format_size, color: colorScheme.onSurface),
|
|
73
|
-
),
|
|
74
|
-
|
|
81
|
+
const SizedBox(width: 12),
|
|
75
|
-
|
|
82
|
+
Text("${fontSize.round()}"),
|
|
76
|
-
|
|
83
|
+
Expanded(
|
|
77
|
-
|
|
84
|
+
child: Slider(
|
|
78
|
-
|
|
85
|
+
value: fontSize,
|
|
79
|
-
|
|
86
|
+
min: 14,
|
|
80
|
-
|
|
87
|
+
max: 26,
|
|
81
|
-
|
|
88
|
+
divisions: 12,
|
|
82
|
-
|
|
89
|
+
label: "${fontSize.round()}",
|
|
83
|
-
|
|
90
|
+
onChanged: (v) => context.dispatch(UpdateFontSizeAction(v)),
|
|
84
|
-
),
|
|
85
|
-
),
|
|
86
|
-
],
|
|
87
|
-
),
|
|
88
91
|
),
|
|
89
|
-
|
|
92
|
+
),
|
|
90
|
-
|
|
93
|
+
],
|
|
91
|
-
),
|
|
92
94
|
),
|
|
93
95
|
),
|
|
96
|
+
),
|
|
97
|
+
const SizedBox(height: 8),
|
|
98
|
+
// Bold font toggle
|
|
99
|
+
Material(
|
|
100
|
+
elevation: 1,
|
|
101
|
+
borderRadius: BorderRadius.circular(12),
|
|
102
|
+
color: colorScheme.surface,
|
|
103
|
+
child: Container(
|
|
104
|
+
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
|
94
|
-
|
|
105
|
+
decoration: BoxDecoration(
|
|
106
|
+
borderRadius: BorderRadius.circular(12),
|
|
107
|
+
border: Border.all(color: colorScheme.scrim),
|
|
108
|
+
),
|
|
109
|
+
child: Row(
|
|
110
|
+
children: [
|
|
111
|
+
Icon(Icons.format_bold, color: colorScheme.onSurface),
|
|
112
|
+
const SizedBox(width: 12),
|
|
113
|
+
Expanded(child: Text(bible.boldFontTitle!)),
|
|
114
|
+
Switch(
|
|
95
|
-
|
|
115
|
+
value: boldFont,
|
|
96
|
-
leading: Icon(
|
|
97
|
-
Icons.format_bold,
|
|
98
|
-
|
|
116
|
+
onChanged: (_) => context.dispatch(ToggleBoldFontAction()),
|
|
117
|
+
),
|
|
118
|
+
],
|
|
99
119
|
),
|
|
100
|
-
title: Text(bible.boldFontTitle!),
|
|
101
|
-
onToggle: (value) => context.dispatch(ToggleBoldFontAction()),
|
|
102
120
|
),
|
|
121
|
+
),
|
|
122
|
+
const SizedBox(height: 8),
|
|
123
|
+
// English titles toggle
|
|
124
|
+
Material(
|
|
125
|
+
elevation: 1,
|
|
126
|
+
borderRadius: BorderRadius.circular(12),
|
|
127
|
+
color: colorScheme.surface,
|
|
128
|
+
child: Container(
|
|
129
|
+
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
|
103
|
-
|
|
130
|
+
decoration: BoxDecoration(
|
|
131
|
+
borderRadius: BorderRadius.circular(12),
|
|
132
|
+
border: Border.all(color: colorScheme.scrim),
|
|
133
|
+
),
|
|
134
|
+
child: Row(
|
|
135
|
+
children: [
|
|
136
|
+
Icon(Icons.abc, color: colorScheme.onSurface),
|
|
137
|
+
const SizedBox(width: 12),
|
|
138
|
+
Expanded(child: Text(bible.engTitles!)),
|
|
139
|
+
Switch(
|
|
104
|
-
|
|
140
|
+
value: engTitles,
|
|
105
|
-
leading: Icon(Icons.abc, color: context.theme.colorScheme.onSurface),
|
|
106
|
-
title: Text(bible.engTitles!),
|
|
107
|
-
|
|
141
|
+
onChanged: (_) => context.dispatch(ToggleEngTitlesAction()),
|
|
142
|
+
),
|
|
143
|
+
],
|
|
144
|
+
),
|
|
108
145
|
),
|
|
146
|
+
),
|
|
147
|
+
const SizedBox(height: 16),
|
|
148
|
+
Spacer(),
|
|
109
|
-
|
|
149
|
+
],
|
|
110
|
-
|
|
150
|
+
),
|
|
111
|
-
],
|
|
112
151
|
);
|
|
113
152
|
}
|
|
114
153
|
}
|
pubspec.lock
CHANGED
|
@@ -815,14 +815,6 @@ packages:
|
|
|
815
815
|
url: "https://pub.dev"
|
|
816
816
|
source: hosted
|
|
817
817
|
version: "3.4.4"
|
|
818
|
-
settings_ui:
|
|
819
|
-
dependency: "direct main"
|
|
820
|
-
description:
|
|
821
|
-
name: settings_ui
|
|
822
|
-
sha256: d9838037cb554b24b4218b2d07666fbada3478882edefae375ee892b6c820ef3
|
|
823
|
-
url: "https://pub.dev"
|
|
824
|
-
source: hosted
|
|
825
|
-
version: "2.0.2"
|
|
826
818
|
share_plus:
|
|
827
819
|
dependency: "direct main"
|
|
828
820
|
description:
|
pubspec.yaml
CHANGED
|
@@ -12,7 +12,6 @@ dependencies:
|
|
|
12
12
|
path_provider: ^2.1.5
|
|
13
13
|
flutter_native_splash: ^2.4.7
|
|
14
14
|
flutter_swipe_detector: ^2.0.0
|
|
15
|
-
settings_ui: ^2.0.2
|
|
16
15
|
share_plus: ^12.0.1
|
|
17
16
|
package_info_plus: ^9.0.0
|
|
18
17
|
flutter_azure_tts: ^1.0.0
|