~repos /only-bible-app
git clone https://pyrossh.dev/repos/only-bible-app.git
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
3457634f
—
pyrossh 2 years ago
improve dark theme and tile fitting
- lib/app.dart +4 -4
- lib/components/tile.dart +2 -1
- lib/components/verse_view.dart +1 -1
- lib/state.dart +9 -9
lib/app.dart
CHANGED
|
@@ -68,7 +68,7 @@ class App extends StatelessWidget {
|
|
|
68
68
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
|
69
69
|
primaryColor: const Color(0xFF4C2323),
|
|
70
70
|
secondaryHeaderColor: const Color(0xFFFFB341),
|
|
71
|
-
highlightColor: const Color(
|
|
71
|
+
highlightColor: const Color(0xAA5D4979),
|
|
72
72
|
dividerColor: Colors.white,
|
|
73
73
|
shadowColor: Colors.white,
|
|
74
74
|
colorScheme: const ColorScheme.dark(
|
|
@@ -78,9 +78,9 @@ class App extends StatelessWidget {
|
|
|
78
78
|
style: TextButton.styleFrom(
|
|
79
79
|
padding: EdgeInsets.zero,
|
|
80
80
|
shape: const RoundedRectangleBorder(),
|
|
81
|
-
elevation: 1,
|
|
81
|
+
elevation: isWide(context) ? 1 : 0.5,
|
|
82
82
|
backgroundColor: const Color(0xFF323232),
|
|
83
|
-
foregroundColor: const Color(
|
|
83
|
+
foregroundColor: const Color(0xFFBC86FC),
|
|
84
84
|
textStyle: const TextStyle(
|
|
85
85
|
fontSize: 18,
|
|
86
86
|
fontWeight: FontWeight.w500,
|
|
@@ -105,7 +105,7 @@ class App extends StatelessWidget {
|
|
|
105
105
|
letterSpacing: 0.5,
|
|
106
106
|
),
|
|
107
107
|
labelMedium: TextStyle(
|
|
108
|
-
color: Color(
|
|
108
|
+
color: Color(0xFFBA50AB),
|
|
109
109
|
fontSize: 12,
|
|
110
110
|
fontWeight: FontWeight.w800,
|
|
111
111
|
letterSpacing: 0.5,
|
lib/components/tile.dart
CHANGED
|
@@ -9,8 +9,9 @@ class Tile extends StatelessWidget {
|
|
|
9
9
|
|
|
10
10
|
@override
|
|
11
11
|
Widget build(BuildContext context) {
|
|
12
|
+
final availableWidth = MediaQuery.of(context).size.width - 40; // width - margin
|
|
12
13
|
return Container(
|
|
13
|
-
width: isWide(context) ? 60 :
|
|
14
|
+
width: isWide(context) ? 60 : (availableWidth/5).round() - 13,
|
|
14
15
|
height: isWide(context) ? 60 : 40,
|
|
15
16
|
margin: const EdgeInsets.only(right: 16, bottom: 16),
|
|
16
17
|
child: TextButton(
|
lib/components/verse_view.dart
CHANGED
|
@@ -10,7 +10,7 @@ class VerseText extends StatelessWidget {
|
|
|
10
10
|
|
|
11
11
|
@override
|
|
12
12
|
Widget build(BuildContext context) {
|
|
13
|
-
final selected =
|
|
13
|
+
final selected = isVerseSelected(context, index);
|
|
14
14
|
final delta = fontSizeDelta.reactiveValue(context);
|
|
15
15
|
final bodySize = Theme.of(context).textTheme.bodyMedium!.fontSize! + delta;
|
|
16
16
|
final weight = fontBold.reactiveValue(context) ? FontWeight.w600 : FontWeight.w500;
|
lib/state.dart
CHANGED
|
@@ -39,6 +39,14 @@ final selectedVerses = ValueNotifier([]);
|
|
|
39
39
|
final isPlaying = ValueNotifier(false);
|
|
40
40
|
final fontSizeDelta = ValueNotifier(0);
|
|
41
41
|
|
|
42
|
+
bool isWide(BuildContext context) {
|
|
43
|
+
if (Platform.isIOS || Platform.isAndroid) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
final width = MediaQuery.of(context).size.width;
|
|
47
|
+
return width > 600;
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
toggleMode() {
|
|
43
51
|
darkMode.value = !darkMode.value;
|
|
44
52
|
updateStatusBar();
|
|
@@ -195,12 +203,4 @@ onVerseSelected(int i) {
|
|
|
195
203
|
} else {
|
|
196
204
|
selectedVerses.value = [...selectedVerses.value, i];
|
|
197
205
|
}
|
|
198
|
-
}
|
|
206
|
+
}
|
|
199
|
-
|
|
200
|
-
bool isWide(BuildContext context) {
|
|
201
|
-
if (Platform.isIOS || Platform.isAndroid) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
final width = MediaQuery.of(context).size.width;
|
|
205
|
-
return width > 600;
|
|
206
|
-
}
|