~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.
aed96f8e
—
pyrossh 2 years ago
improve design
- bible_app/README.md +1 -2
- bible_app/android/app/src/main/res/ic_launcher-web.png +0 -0
- bible_app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- bible_app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- bible_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- bible_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- bible_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- bible_app/android/app/src/main/res/mipmap-ldpi/ic_launcher.png +0 -0
- bible_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- bible_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- bible_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- bible_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- bible_app/android/app/src/main/res/playstore-icon.png +0 -0
- bible_app/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- bible_app/assets/logo.vectornator +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +125 -119
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png +0 -0
- bible_app/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png +0 -0
- bible_app/lib/components/book_selector.dart +16 -5
- bible_app/lib/components/books_list.dart +8 -5
- bible_app/lib/components/chapters_list.dart +8 -5
- bible_app/lib/components/header.dart +11 -10
- bible_app/lib/components/menu.dart +42 -49
- bible_app/lib/components/play_button.dart +8 -39
- bible_app/lib/components/shell.dart +3 -1
- bible_app/lib/components/side_menu_page.dart +12 -11
- bible_app/lib/components/tile.dart +14 -16
- bible_app/lib/components/verse_view.dart +4 -1
- bible_app/lib/main.dart +6 -2
- bible_app/lib/models/book.dart +5 -1
- bible_app/lib/models/theme.dart +9 -0
- bible_app/lib/routes/home_screen.dart +2 -1
- bible_app/lib/state.dart +56 -12
- bible_app/lib/utils/dialog.dart +3 -5
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- bible_app/pubspec.lock +16 -0
- bible_app/pubspec.yaml +1 -0
- bible_app/web/favicon.png +0 -0
- bible_app/web/icons/Icon-192.png +0 -0
- bible_app/web/icons/Icon-512.png +0 -0
- bible_app/web/icons/Icon-maskable-192.png +0 -0
- bible_app/web/icons/Icon-maskable-512.png +0 -0
- bible_app/windows/runner/resources/app_icon.ico +0 -0
- scripts/convertVerses.js +3 -3
bible_app/README.md
CHANGED
|
@@ -5,6 +5,5 @@ A new Flutter project.
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
7
7
|
```agsl
|
|
8
|
-
flutter pub global activate build_runner
|
|
9
|
-
|
|
8
|
+
brew install fluttter
|
|
10
9
|
```
|
bible_app/android/app/src/main/res/ic_launcher-web.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
<background android:drawable="@color/ic_launcher_background"/>
|
|
4
|
+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
|
5
|
+
</adaptive-icon>
|
bible_app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
<background android:drawable="@color/ic_launcher_background"/>
|
|
4
|
+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
|
5
|
+
</adaptive-icon>
|
bible_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
CHANGED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-ldpi/ic_launcher.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
CHANGED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
CHANGED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
CHANGED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
CHANGED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/playstore-icon.png
ADDED
|
Binary file
|
bible_app/android/app/src/main/res/values/ic_launcher_background.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<resources>
|
|
3
|
+
<color name="ic_launcher_background">#fbb343</color>
|
|
4
|
+
</resources>
|
bible_app/assets/logo.vectornator
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
CHANGED
|
@@ -1,122 +1,128 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
2
|
+
"images":[
|
|
3
|
+
{
|
|
4
|
+
"idiom":"iphone",
|
|
5
|
+
"size":"20x20",
|
|
6
|
+
"scale":"2x",
|
|
7
|
+
"filename":"Icon-App-20x20@2x.png"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"idiom":"iphone",
|
|
11
|
+
"size":"20x20",
|
|
12
|
+
"scale":"3x",
|
|
13
|
+
"filename":"Icon-App-20x20@3x.png"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"idiom":"iphone",
|
|
17
|
+
"size":"29x29",
|
|
18
|
+
"scale":"1x",
|
|
19
|
+
"filename":"Icon-App-29x29@1x.png"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"idiom":"iphone",
|
|
23
|
+
"size":"29x29",
|
|
24
|
+
"scale":"2x",
|
|
25
|
+
"filename":"Icon-App-29x29@2x.png"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"idiom":"iphone",
|
|
29
|
+
"size":"29x29",
|
|
30
|
+
"scale":"3x",
|
|
31
|
+
"filename":"Icon-App-29x29@3x.png"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idiom":"iphone",
|
|
35
|
+
"size":"40x40",
|
|
36
|
+
"scale":"2x",
|
|
37
|
+
"filename":"Icon-App-40x40@2x.png"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"idiom":"iphone",
|
|
41
|
+
"size":"40x40",
|
|
42
|
+
"scale":"3x",
|
|
43
|
+
"filename":"Icon-App-40x40@3x.png"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"idiom":"iphone",
|
|
47
|
+
"size":"60x60",
|
|
48
|
+
"scale":"2x",
|
|
49
|
+
"filename":"Icon-App-60x60@2x.png"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"idiom":"iphone",
|
|
53
|
+
"size":"60x60",
|
|
54
|
+
"scale":"3x",
|
|
55
|
+
"filename":"Icon-App-60x60@3x.png"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"idiom":"iphone",
|
|
59
|
+
"size":"76x76",
|
|
60
|
+
"scale":"2x",
|
|
61
|
+
"filename":"Icon-App-76x76@2x.png"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"idiom":"ipad",
|
|
65
|
+
"size":"20x20",
|
|
66
|
+
"scale":"1x",
|
|
67
|
+
"filename":"Icon-App-20x20@1x.png"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"idiom":"ipad",
|
|
71
|
+
"size":"20x20",
|
|
72
|
+
"scale":"2x",
|
|
73
|
+
"filename":"Icon-App-20x20@2x.png"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"idiom":"ipad",
|
|
77
|
+
"size":"29x29",
|
|
78
|
+
"scale":"1x",
|
|
79
|
+
"filename":"Icon-App-29x29@1x.png"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"idiom":"ipad",
|
|
83
|
+
"size":"29x29",
|
|
84
|
+
"scale":"2x",
|
|
85
|
+
"filename":"Icon-App-29x29@2x.png"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"idiom":"ipad",
|
|
89
|
+
"size":"40x40",
|
|
90
|
+
"scale":"1x",
|
|
91
|
+
"filename":"Icon-App-40x40@1x.png"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"idiom":"ipad",
|
|
95
|
+
"size":"40x40",
|
|
96
|
+
"scale":"2x",
|
|
97
|
+
"filename":"Icon-App-40x40@2x.png"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"idiom":"ipad",
|
|
101
|
+
"size":"76x76",
|
|
102
|
+
"scale":"1x",
|
|
103
|
+
"filename":"Icon-App-76x76@1x.png"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"idiom":"ipad",
|
|
107
|
+
"size":"76x76",
|
|
108
|
+
"scale":"2x",
|
|
109
|
+
"filename":"Icon-App-76x76@2x.png"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"idiom":"ipad",
|
|
113
|
+
"size":"83.5x83.5",
|
|
114
|
+
"scale":"2x",
|
|
115
|
+
"filename":"Icon-App-83.5x83.5@2x.png"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"size" : "1024x1024",
|
|
119
|
+
"idiom" : "ios-marketing",
|
|
120
|
+
"scale" : "1x",
|
|
121
|
+
"filename" : "ItunesArtwork@2x.png"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"info":{
|
|
125
|
+
"version":1,
|
|
126
|
+
"author":"easyappicon"
|
|
116
127
|
}
|
|
117
|
-
],
|
|
118
|
-
"info" : {
|
|
119
|
-
"version" : 1,
|
|
120
|
-
"author" : "xcode"
|
|
121
|
-
}
|
|
122
128
|
}
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
DELETED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
CHANGED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png
ADDED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png
ADDED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png
ADDED
|
Binary file
|
bible_app/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png
ADDED
|
Binary file
|
bible_app/lib/components/book_selector.dart
CHANGED
|
@@ -39,20 +39,31 @@ class BookSelectorState extends State<BookSelector> {
|
|
|
39
39
|
final book = selectedBible.value[bookIndex];
|
|
40
40
|
return Container(
|
|
41
41
|
margin: const EdgeInsets.only(top: 15, left: 20),
|
|
42
|
+
child: ChaptersList(
|
|
43
|
+
title: book.name,
|
|
42
|
-
|
|
44
|
+
length: book.chapters.length,
|
|
45
|
+
onTap: onChapterSelected),
|
|
43
46
|
);
|
|
44
47
|
}
|
|
48
|
+
final oldTestament =
|
|
45
|
-
|
|
49
|
+
selectedBible.value.where((it) => it.isOldTestament()).toList();
|
|
50
|
+
final newTestament =
|
|
46
|
-
|
|
51
|
+
selectedBible.value.where((it) => it.isNewTestament()).toList();
|
|
47
52
|
return Container(
|
|
48
53
|
margin: const EdgeInsets.only(top: 15, left: 20),
|
|
49
54
|
child: ListView(
|
|
50
55
|
children: [
|
|
56
|
+
BooksList(
|
|
51
|
-
|
|
57
|
+
title: "Old Testament",
|
|
58
|
+
books: oldTestament,
|
|
59
|
+
onTap: onBookSelected),
|
|
52
60
|
Container(
|
|
53
61
|
margin: const EdgeInsets.only(bottom: 10),
|
|
54
62
|
),
|
|
63
|
+
BooksList(
|
|
55
|
-
|
|
64
|
+
title: "New Testament",
|
|
65
|
+
books: newTestament,
|
|
66
|
+
onTap: onBookSelected),
|
|
56
67
|
],
|
|
57
68
|
),
|
|
58
69
|
);
|
bible_app/lib/components/books_list.dart
CHANGED
|
@@ -8,7 +8,11 @@ class BooksList extends StatelessWidget {
|
|
|
8
8
|
final List<Book> books;
|
|
9
9
|
final Function(int) onTap;
|
|
10
10
|
|
|
11
|
+
const BooksList(
|
|
12
|
+
{super.key,
|
|
13
|
+
required this.title,
|
|
14
|
+
required this.books,
|
|
11
|
-
|
|
15
|
+
required this.onTap});
|
|
12
16
|
|
|
13
17
|
@override
|
|
14
18
|
Widget build(BuildContext context) {
|
|
@@ -22,10 +26,9 @@ class BooksList extends StatelessWidget {
|
|
|
22
26
|
Wrap(
|
|
23
27
|
children: List.of(books.map((book) {
|
|
24
28
|
final name = book.shortName();
|
|
25
|
-
return
|
|
29
|
+
return Tile(
|
|
26
|
-
|
|
30
|
+
name: name,
|
|
27
|
-
|
|
31
|
+
onPressed: () => onTap(book.index),
|
|
28
|
-
child: Tile(name: name),
|
|
29
32
|
);
|
|
30
33
|
})),
|
|
31
34
|
),
|
bible_app/lib/components/chapters_list.dart
CHANGED
|
@@ -7,7 +7,11 @@ class ChaptersList extends StatelessWidget {
|
|
|
7
7
|
final int length;
|
|
8
8
|
final Function(int) onTap;
|
|
9
9
|
|
|
10
|
+
const ChaptersList(
|
|
11
|
+
{super.key,
|
|
12
|
+
required this.title,
|
|
13
|
+
required this.length,
|
|
10
|
-
|
|
14
|
+
required this.onTap});
|
|
11
15
|
|
|
12
16
|
@override
|
|
13
17
|
Widget build(BuildContext context) {
|
|
@@ -19,10 +23,9 @@ class ChaptersList extends StatelessWidget {
|
|
|
19
23
|
),
|
|
20
24
|
Wrap(
|
|
21
25
|
children: List.generate(length, (index) {
|
|
22
|
-
return
|
|
26
|
+
return Tile(
|
|
23
|
-
|
|
27
|
+
name: "${index + 1}",
|
|
24
|
-
|
|
28
|
+
onPressed: () => onTap(index),
|
|
25
|
-
child: Tile(name: "${index + 1}"),
|
|
26
29
|
);
|
|
27
30
|
}),
|
|
28
31
|
)
|
bible_app/lib/components/header.dart
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
|
+
import "package:go_router/go_router.dart";
|
|
2
3
|
import "./play_button.dart";
|
|
3
4
|
import "./side_menu_page.dart";
|
|
4
5
|
import "./menu.dart";
|
|
@@ -26,23 +27,23 @@ class Header extends StatelessWidget {
|
|
|
26
27
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
27
28
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
28
29
|
children: [
|
|
29
|
-
|
|
30
|
+
TextButton.icon(
|
|
31
|
+
style: TextButton.styleFrom(
|
|
32
|
+
padding: EdgeInsets.zero,
|
|
33
|
+
foregroundColor: const Color(0xFF9A1111),
|
|
34
|
+
),
|
|
35
|
+
label: Icon(Icons.expand_more, size: 28, color: theme.value.headerText.color),
|
|
36
|
+
icon: Text("${selectedBible.value[book].name} ${chapter + 1}", style: theme.value.headerText),
|
|
30
|
-
|
|
37
|
+
onPressed: () {
|
|
31
38
|
Navigator.of(context).push(SideMenuPage());
|
|
32
39
|
},
|
|
33
|
-
child: Row(
|
|
34
|
-
children: [
|
|
35
|
-
Text("${selectedBible.value[book].name} ${chapter + 1}", style: theme.value.headerText),
|
|
36
|
-
const Icon(Icons.expand_more, size: 30),
|
|
37
|
-
],
|
|
38
|
-
),
|
|
39
40
|
),
|
|
40
41
|
Row(
|
|
41
42
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
42
43
|
children: [
|
|
43
44
|
Container(
|
|
44
|
-
margin: EdgeInsets.only(right: isWide(context) ?
|
|
45
|
+
margin: EdgeInsets.only(right: isWide(context) ? 10 : 8),
|
|
45
|
-
child: PlayButton(
|
|
46
|
+
child: const PlayButton(),
|
|
46
47
|
),
|
|
47
48
|
const Menu(),
|
|
48
49
|
],
|
bible_app/lib/components/menu.dart
CHANGED
|
@@ -8,55 +8,48 @@ class Menu extends StatelessWidget {
|
|
|
8
8
|
@override
|
|
9
9
|
Widget build(BuildContext context) {
|
|
10
10
|
final moreIcon = isWide(context) ? Icons.more_vert : Icons.more_vert;
|
|
11
|
+
const spacing = 25.0;
|
|
11
12
|
return PopupMenuButton(
|
|
13
|
+
constraints: const BoxConstraints.tightFor(width: 80),
|
|
12
|
-
|
|
14
|
+
icon: Icon(moreIcon, size: 28),
|
|
13
|
-
|
|
15
|
+
offset: const Offset(0.0, 60),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
itemBuilder: (BuildContext itemContext) {
|
|
17
|
+
final modeIcon = darkMode.reactiveValue(itemContext)
|
|
18
|
+
? Icons.dark_mode
|
|
19
|
+
: Icons.light_mode;
|
|
20
|
+
final boldColor =
|
|
21
|
+
fontBold.reactiveValue(itemContext) ? Colors.red : Colors.grey;
|
|
22
|
+
return [
|
|
16
|
-
|
|
23
|
+
PopupMenuItem(
|
|
17
|
-
|
|
24
|
+
value: 1,
|
|
18
|
-
padding: EdgeInsets.symmetric(vertical: 15, horizontal: isWide(context) ? 10 : 5),
|
|
19
|
-
onTap: toggleMode,
|
|
20
|
-
|
|
25
|
+
child: Column(
|
|
21
|
-
|
|
26
|
+
crossAxisAlignment: CrossAxisAlignment.center,
|
|
22
|
-
|
|
27
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
|
23
|
-
|
|
28
|
+
children: [
|
|
29
|
+
IconButton(
|
|
30
|
+
icon: Icon(modeIcon, color: Colors.black, size: 28),
|
|
31
|
+
onPressed: toggleMode,
|
|
32
|
+
),
|
|
24
|
-
|
|
33
|
+
Container(margin: const EdgeInsets.only(top: spacing)),
|
|
34
|
+
IconButton(
|
|
35
|
+
icon: Icon(Icons.format_bold, color: boldColor, size: 28),
|
|
36
|
+
onPressed: toggleBold,
|
|
37
|
+
),
|
|
38
|
+
Container(margin: const EdgeInsets.only(top: spacing)),
|
|
39
|
+
const IconButton(
|
|
40
|
+
icon:
|
|
25
|
-
|
|
41
|
+
Icon(Icons.add_circle, color: Colors.black, size: 28),
|
|
42
|
+
onPressed: increaseFont,
|
|
43
|
+
),
|
|
26
|
-
|
|
44
|
+
Container(margin: const EdgeInsets.only(top: spacing)),
|
|
45
|
+
const IconButton(
|
|
46
|
+
icon: Icon(Icons.remove_circle,
|
|
47
|
+
color: Colors.black, size: 28),
|
|
48
|
+
onPressed: decreaseFont,
|
|
49
|
+
),
|
|
27
|
-
|
|
50
|
+
],
|
|
28
|
-
|
|
51
|
+
)),
|
|
29
|
-
),
|
|
30
|
-
const PopupMenuItem(
|
|
31
|
-
value: 1,
|
|
32
|
-
padding: EdgeInsets.symmetric(vertical: 15),
|
|
33
|
-
child: Row(
|
|
34
|
-
crossAxisAlignment: CrossAxisAlignment.center,
|
|
35
|
-
mainAxisAlignment: MainAxisAlignment.center,
|
|
36
|
-
children: [
|
|
37
|
-
IconButton(
|
|
38
|
-
icon: Icon(Icons.add_circle, color: Colors.black, size: 30),
|
|
39
|
-
onPressed: increaseFont,
|
|
40
|
-
),
|
|
41
|
-
Text(" Font "),
|
|
42
|
-
IconButton(
|
|
43
|
-
icon: Icon(Icons.remove_circle, color: Colors.black, size: 30),
|
|
44
|
-
onPressed: decreaseFont,
|
|
45
|
-
),
|
|
46
|
-
|
|
52
|
+
];
|
|
47
|
-
),
|
|
48
|
-
),
|
|
49
|
-
const PopupMenuItem(
|
|
50
|
-
value: 1,
|
|
51
|
-
padding: EdgeInsets.symmetric(vertical: 10),
|
|
52
|
-
child: Row(
|
|
53
|
-
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
54
|
-
children: [
|
|
55
|
-
Text("About"),
|
|
56
|
-
],
|
|
57
|
-
),
|
|
58
|
-
),
|
|
59
|
-
],
|
|
60
|
-
|
|
53
|
+
});
|
|
61
54
|
}
|
|
62
55
|
}
|
bible_app/lib/components/play_button.dart
CHANGED
|
@@ -1,50 +1,19 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
2
|
import "package:flutter_reactive_value/flutter_reactive_value.dart";
|
|
3
|
-
import "package:just_audio/just_audio.dart";
|
|
4
|
-
import "../models/book.dart";
|
|
5
3
|
import "../state.dart";
|
|
6
|
-
import "../utils/dialog.dart";
|
|
7
4
|
|
|
8
5
|
class PlayButton extends StatelessWidget {
|
|
9
|
-
final int book;
|
|
10
|
-
final int chapter;
|
|
11
|
-
|
|
6
|
+
const PlayButton({super.key});
|
|
12
|
-
|
|
13
|
-
const PlayButton({super.key, required this.book, required this.chapter, required this.verses});
|
|
14
7
|
|
|
15
8
|
@override
|
|
16
9
|
Widget build(BuildContext context) {
|
|
17
|
-
final icon = isPlaying.reactiveValue(context)
|
|
10
|
+
final icon = isPlaying.reactiveValue(context)
|
|
11
|
+
? Icons.pause_circle_filled
|
|
12
|
+
: Icons.play_circle_fill;
|
|
18
13
|
return IconButton(
|
|
19
|
-
|
|
14
|
+
icon: Icon(icon, size: 28),
|
|
20
|
-
|
|
15
|
+
onPressed: () {
|
|
21
|
-
final player = AudioPlayer();
|
|
22
|
-
player.setUrl("https://github.com/pyrossh/bible-app/raw/master/public/audio/output.mp3");
|
|
23
|
-
// player.setUrl("asset:output.mp3");
|
|
24
|
-
if (isPlaying.value) {
|
|
25
|
-
await player.pause();
|
|
26
|
-
onPause();
|
|
27
|
-
} else {
|
|
28
|
-
try {
|
|
29
|
-
|
|
16
|
+
onPlay(context);
|
|
30
|
-
final filteredVerses =
|
|
31
|
-
verses.asMap().keys.where((it) => selectedVerses.value.contains(it)).map((it) => verses[it]);
|
|
32
|
-
for (final v in filteredVerses) {
|
|
33
|
-
await player.setClip(
|
|
34
|
-
start: Duration(milliseconds: (v.audioRange.start * 1000).toInt()),
|
|
35
|
-
end: Duration(milliseconds: (v.audioRange.end * 1000).toInt()),
|
|
36
|
-
|
|
17
|
+
});
|
|
37
|
-
await player.play();
|
|
38
|
-
await player.pause();
|
|
39
|
-
}
|
|
40
|
-
} catch (err) {
|
|
41
|
-
showError(context, "Could not play audio");
|
|
42
|
-
} finally {
|
|
43
|
-
await player.pause();
|
|
44
|
-
onPause();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
);
|
|
49
18
|
}
|
|
50
19
|
}
|
bible_app/lib/components/shell.dart
CHANGED
|
@@ -2,6 +2,8 @@ import 'package:flutter_reactive_value/flutter_reactive_value.dart';
|
|
|
2
2
|
import 'package:go_router/go_router.dart';
|
|
3
3
|
import "package:flutter/material.dart";
|
|
4
4
|
import 'package:flutter/services.dart';
|
|
5
|
+
import 'package:one_context/one_context.dart';
|
|
6
|
+
import 'package:only_bible_app/components/play_button.dart';
|
|
5
7
|
import '../models/theme.dart';
|
|
6
8
|
import '../state.dart';
|
|
7
9
|
import "sidebar.dart";
|
|
@@ -10,7 +12,7 @@ class Shell extends ShellRoute {
|
|
|
10
12
|
Shell({required super.routes});
|
|
11
13
|
|
|
12
14
|
@override
|
|
13
|
-
GlobalKey<NavigatorState> get navigatorKey =>
|
|
15
|
+
GlobalKey<NavigatorState> get navigatorKey => OneContext().key;
|
|
14
16
|
|
|
15
17
|
@override
|
|
16
18
|
ShellRouteBuilder? get builder => (context, state, child) {
|
bible_app/lib/components/side_menu_page.dart
CHANGED
|
@@ -26,10 +26,10 @@ class SideMenuPage extends ModalRoute<void> {
|
|
|
26
26
|
|
|
27
27
|
@override
|
|
28
28
|
Widget buildPage(
|
|
29
|
-
|
|
29
|
+
BuildContext context,
|
|
30
|
-
|
|
30
|
+
Animation<double> animation,
|
|
31
|
-
|
|
31
|
+
Animation<double> secondaryAnimation,
|
|
32
|
-
|
|
32
|
+
) {
|
|
33
33
|
return Material(
|
|
34
34
|
type: MaterialType.transparency,
|
|
35
35
|
child: Container(
|
|
@@ -42,14 +42,15 @@ class SideMenuPage extends ModalRoute<void> {
|
|
|
42
42
|
|
|
43
43
|
@override
|
|
44
44
|
Widget buildTransitions(
|
|
45
|
-
|
|
45
|
+
BuildContext context,
|
|
46
|
-
|
|
46
|
+
Animation<double> animation,
|
|
47
|
-
|
|
47
|
+
Animation<double> secondaryAnimation,
|
|
48
|
-
|
|
48
|
+
Widget child,
|
|
49
|
-
|
|
49
|
+
) {
|
|
50
50
|
return SlideTransition(
|
|
51
|
-
position: Tween(begin: const Offset(-1, 0), end: Offset.zero)
|
|
51
|
+
position: Tween(begin: const Offset(-1, 0), end: Offset.zero)
|
|
52
|
+
.animate(animation),
|
|
52
53
|
child: child,
|
|
53
54
|
);
|
|
54
55
|
}
|
|
55
|
-
}
|
|
56
|
+
}
|
bible_app/lib/components/tile.dart
CHANGED
|
@@ -4,30 +4,28 @@ import '../state.dart';
|
|
|
4
4
|
|
|
5
5
|
class Tile extends StatelessWidget {
|
|
6
6
|
final String name;
|
|
7
|
+
final VoidCallback onPressed;
|
|
7
8
|
|
|
8
|
-
const Tile({super.key, required this.name});
|
|
9
|
+
const Tile({super.key, required this.name, required this.onPressed});
|
|
9
10
|
|
|
10
11
|
@override
|
|
11
12
|
Widget build(BuildContext context) {
|
|
12
13
|
return Container(
|
|
13
|
-
width: isWide(context) ? 60 :
|
|
14
|
+
width: isWide(context) ? 60 : 55,
|
|
14
15
|
height: isWide(context) ? 60 : 40,
|
|
15
16
|
margin: const EdgeInsets.only(right: 16, bottom: 16),
|
|
16
|
-
decoration: const BoxDecoration(
|
|
17
|
-
color: Color(0xFFEAE9E9),
|
|
18
|
-
),
|
|
19
|
-
child: Center(
|
|
20
|
-
|
|
17
|
+
child: TextButton(
|
|
21
|
-
name,
|
|
22
|
-
textAlign: TextAlign.center,
|
|
23
|
-
|
|
18
|
+
style: TextButton.styleFrom(
|
|
19
|
+
padding: EdgeInsets.zero,
|
|
24
|
-
|
|
20
|
+
shape: const RoundedRectangleBorder(),
|
|
25
|
-
fontSize: 20,
|
|
26
|
-
|
|
21
|
+
// elevation: 4,
|
|
22
|
+
// backgroundColor: const Color(0xFFF6F6F6),
|
|
23
|
+
backgroundColor: const Color(0xFFEAE9E9),
|
|
27
|
-
|
|
24
|
+
foregroundColor: const Color(0xFF9A1111),
|
|
28
|
-
|
|
25
|
+
textStyle: theme.value.tileText,
|
|
29
|
-
),
|
|
30
26
|
),
|
|
27
|
+
onPressed: onPressed,
|
|
28
|
+
child: Text(name),
|
|
31
29
|
),
|
|
32
30
|
);
|
|
33
31
|
}
|
bible_app/lib/components/verse_view.dart
CHANGED
|
@@ -13,6 +13,8 @@ class VerseText extends StatelessWidget {
|
|
|
13
13
|
final selected = selectedVerses.reactiveValue(context).contains(index);
|
|
14
14
|
final delta = fontSizeDelta.reactiveValue(context);
|
|
15
15
|
final bodySize = theme.value.bodyText.fontSize! + delta;
|
|
16
|
+
final weight =
|
|
17
|
+
fontBold.reactiveValue(context) ? FontWeight.w600 : FontWeight.w500;
|
|
16
18
|
onTap() {
|
|
17
19
|
onVerseSelected(index);
|
|
18
20
|
}
|
|
@@ -36,7 +38,8 @@ class VerseText extends StatelessWidget {
|
|
|
36
38
|
),
|
|
37
39
|
),
|
|
38
40
|
Flexible(
|
|
41
|
+
child: Text(text,
|
|
39
|
-
|
|
42
|
+
style: TextStyle(fontSize: bodySize, fontWeight: weight)),
|
|
40
43
|
)
|
|
41
44
|
],
|
|
42
45
|
),
|
bible_app/lib/main.dart
CHANGED
|
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|
|
2
2
|
import 'package:flutter_persistent_value_notifier/flutter_persistent_value_notifier.dart';
|
|
3
3
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
|
4
4
|
import 'package:go_router/go_router.dart';
|
|
5
|
+
import 'package:one_context/one_context.dart';
|
|
6
|
+
import 'package:only_bible_app/models/theme.dart';
|
|
5
7
|
import 'components/shell.dart';
|
|
6
8
|
import 'routes/home_screen.dart';
|
|
7
9
|
import 'state.dart';
|
|
@@ -14,12 +16,14 @@ void main() async {
|
|
|
14
16
|
await updateStatusBar();
|
|
15
17
|
runApp(MaterialApp.router(
|
|
16
18
|
debugShowCheckedModeBanner: false,
|
|
19
|
+
builder: OneContext().builder,
|
|
17
20
|
theme: ThemeData(
|
|
18
21
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
|
19
22
|
),
|
|
20
23
|
routerConfig: GoRouter(
|
|
21
24
|
debugLogDiagnostics: true,
|
|
25
|
+
initialLocation:
|
|
22
|
-
|
|
26
|
+
"/${selectedBible.value[bookIndex.value].name}/${chapterIndex.value}",
|
|
23
27
|
routes: [
|
|
24
28
|
Shell(
|
|
25
29
|
routes: [
|
|
@@ -36,4 +40,4 @@ void main() async {
|
|
|
36
40
|
),
|
|
37
41
|
));
|
|
38
42
|
FlutterNativeSplash.remove();
|
|
39
|
-
}
|
|
43
|
+
}
|
bible_app/lib/models/book.dart
CHANGED
|
@@ -4,7 +4,11 @@ class Book {
|
|
|
4
4
|
final String localeName;
|
|
5
5
|
final List<Chapter> chapters;
|
|
6
6
|
|
|
7
|
+
const Book(
|
|
8
|
+
{required this.index,
|
|
9
|
+
required this.name,
|
|
7
|
-
|
|
10
|
+
required this.localeName,
|
|
11
|
+
required this.chapters});
|
|
8
12
|
|
|
9
13
|
bool isOldTestament() => index < 39;
|
|
10
14
|
|
bible_app/lib/models/theme.dart
CHANGED
|
@@ -47,6 +47,7 @@ const lightTheme = AppTheme(
|
|
|
47
47
|
// letterSpacing: 0.5,
|
|
48
48
|
),
|
|
49
49
|
headerText: TextStyle(
|
|
50
|
+
// color: lightLabel,
|
|
50
51
|
color: lightBody,
|
|
51
52
|
fontSize: 20,
|
|
52
53
|
fontWeight: FontWeight.w500,
|
|
@@ -57,6 +58,12 @@ const lightTheme = AppTheme(
|
|
|
57
58
|
fontWeight: FontWeight.w600,
|
|
58
59
|
fontSize: 20,
|
|
59
60
|
),
|
|
61
|
+
tileText: TextStyle(
|
|
62
|
+
fontSize: 18,
|
|
63
|
+
fontWeight: FontWeight.w500,
|
|
64
|
+
color: lightLabel,
|
|
65
|
+
letterSpacing: 0.5,
|
|
66
|
+
),
|
|
60
67
|
);
|
|
61
68
|
|
|
62
69
|
class AppTheme {
|
|
@@ -66,6 +73,7 @@ class AppTheme {
|
|
|
66
73
|
required this.bodyText,
|
|
67
74
|
required this.headerText,
|
|
68
75
|
required this.titleText,
|
|
76
|
+
required this.tileText,
|
|
69
77
|
required this.secondaryColor,
|
|
70
78
|
required this.highlightColor,
|
|
71
79
|
});
|
|
@@ -75,6 +83,7 @@ class AppTheme {
|
|
|
75
83
|
final TextStyle bodyText;
|
|
76
84
|
final TextStyle headerText;
|
|
77
85
|
final TextStyle titleText;
|
|
86
|
+
final TextStyle tileText;
|
|
78
87
|
final Color secondaryColor;
|
|
79
88
|
final Color highlightColor;
|
|
80
89
|
}
|
bible_app/lib/routes/home_screen.dart
CHANGED
|
@@ -14,7 +14,8 @@ class HomeScreen extends GoRouteData {
|
|
|
14
14
|
|
|
15
15
|
@override
|
|
16
16
|
Page buildPage(BuildContext context, GoRouterState state) {
|
|
17
|
+
final selectedBook =
|
|
17
|
-
|
|
18
|
+
selectedBible.value.firstWhere((it) => book == it.name);
|
|
18
19
|
final verses = selectedBook.chapters[chapter].verses;
|
|
19
20
|
return NoTransitionPage(
|
|
20
21
|
child: Container(
|
bible_app/lib/state.dart
CHANGED
|
@@ -4,6 +4,10 @@ import 'package:flutter/services.dart';
|
|
|
4
4
|
import 'package:flutter/material.dart';
|
|
5
5
|
import 'package:flutter_persistent_value_notifier/flutter_persistent_value_notifier.dart';
|
|
6
6
|
import 'package:flutter_reactive_value/flutter_reactive_value.dart';
|
|
7
|
+
import 'package:just_audio/just_audio.dart';
|
|
8
|
+
import 'package:one_context/one_context.dart';
|
|
9
|
+
import 'package:only_bible_app/components/play_button.dart';
|
|
10
|
+
import 'package:only_bible_app/utils/dialog.dart';
|
|
7
11
|
import 'models/book.dart';
|
|
8
12
|
import 'models/theme.dart';
|
|
9
13
|
|
|
@@ -12,6 +16,11 @@ final darkMode = PersistentValueNotifier<bool>(
|
|
|
12
16
|
initialValue: false,
|
|
13
17
|
);
|
|
14
18
|
|
|
19
|
+
final fontBold = PersistentValueNotifier<bool>(
|
|
20
|
+
sharedPreferencesKey: 'fontBold',
|
|
21
|
+
initialValue: false,
|
|
22
|
+
);
|
|
23
|
+
|
|
15
24
|
final selectedBibleName = PersistentValueNotifier<String>(
|
|
16
25
|
sharedPreferencesKey: 'selectedBibleName',
|
|
17
26
|
initialValue: "kannada.csv.gz",
|
|
@@ -33,6 +42,15 @@ final isPlaying = ValueNotifier(false);
|
|
|
33
42
|
final theme = ValueNotifier<AppTheme>(lightTheme);
|
|
34
43
|
final fontSizeDelta = ValueNotifier(0);
|
|
35
44
|
|
|
45
|
+
toggleMode() {
|
|
46
|
+
darkMode.value = !darkMode.value;
|
|
47
|
+
updateStatusBar();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
toggleBold() {
|
|
51
|
+
fontBold.value = !fontBold.value;
|
|
52
|
+
}
|
|
53
|
+
|
|
36
54
|
increaseFont() {
|
|
37
55
|
fontSizeDelta.value += 1;
|
|
38
56
|
}
|
|
@@ -41,11 +59,6 @@ decreaseFont() {
|
|
|
41
59
|
fontSizeDelta.value -= 1;
|
|
42
60
|
}
|
|
43
61
|
|
|
44
|
-
toggleMode() {
|
|
45
|
-
darkMode.value = !darkMode.value;
|
|
46
|
-
updateStatusBar();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
62
|
updateStatusBar() {
|
|
50
63
|
if (darkMode.value) {
|
|
51
64
|
SystemChrome.setSystemUIOverlayStyle(darkStatusBar);
|
|
@@ -84,7 +97,11 @@ getBibleFromText(String text) {
|
|
|
84
97
|
end = double.parse(item[5]);
|
|
85
98
|
}
|
|
86
99
|
if (books.length - 1 < book) {
|
|
100
|
+
books.add(Book(
|
|
101
|
+
index: book,
|
|
102
|
+
name: bookNames[book],
|
|
87
|
-
|
|
103
|
+
localeName: bookNames[book],
|
|
104
|
+
chapters: []));
|
|
88
105
|
}
|
|
89
106
|
if (books[book].chapters.length < chapter) {
|
|
90
107
|
books[book].chapters.add(Chapter(verses: []));
|
|
@@ -97,12 +114,39 @@ getBibleFromText(String text) {
|
|
|
97
114
|
return books;
|
|
98
115
|
}
|
|
99
116
|
|
|
117
|
+
onPlay(BuildContext context) async {
|
|
118
|
+
final verses =
|
|
119
|
+
selectedBible.value[bookIndex.value].chapters[chapterIndex.value].verses;
|
|
120
|
+
final filteredVerses = verses
|
|
100
|
-
|
|
121
|
+
.asMap()
|
|
122
|
+
.keys
|
|
123
|
+
.where((it) => selectedVerses.value.contains(it))
|
|
124
|
+
.map((it) => verses[it]);
|
|
125
|
+
final player = AudioPlayer();
|
|
126
|
+
player.setUrl(
|
|
127
|
+
"https://github.com/pyrossh/bible-app/raw/master/public/audio/output.mp3");
|
|
128
|
+
// player.setUrl("asset:output.mp3");
|
|
129
|
+
if (isPlaying.value) {
|
|
130
|
+
await player.pause();
|
|
131
|
+
isPlaying.value = false;
|
|
132
|
+
} else {
|
|
133
|
+
try {
|
|
101
|
-
|
|
134
|
+
isPlaying.value = true;
|
|
135
|
+
for (final v in filteredVerses) {
|
|
136
|
+
await player.setClip(
|
|
137
|
+
start: Duration(milliseconds: (v.audioRange.start * 1000).toInt()),
|
|
138
|
+
end: Duration(milliseconds: (v.audioRange.end * 1000).toInt()),
|
|
139
|
+
);
|
|
140
|
+
await player.play();
|
|
141
|
+
await player.pause();
|
|
102
|
-
}
|
|
142
|
+
}
|
|
103
|
-
|
|
104
|
-
|
|
143
|
+
} catch (err) {
|
|
144
|
+
showError(context, "Could not play audio");
|
|
145
|
+
} finally {
|
|
146
|
+
await player.pause();
|
|
105
|
-
|
|
147
|
+
isPlaying.value = false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
106
150
|
}
|
|
107
151
|
|
|
108
152
|
isVerseSelected(BuildContext context, int i) {
|
bible_app/lib/utils/dialog.dart
CHANGED
|
@@ -38,12 +38,10 @@ showAlert(BuildContext context, String title, String message) {
|
|
|
38
38
|
content: Text(message),
|
|
39
39
|
actionsAlignment: MainAxisAlignment.center,
|
|
40
40
|
actionsOverflowButtonSpacing: 8.0,
|
|
41
|
-
actions:
|
|
41
|
+
actions: [
|
|
42
42
|
TextButton(
|
|
43
|
+
onPressed: context.pop,
|
|
43
|
-
child: const Text("
|
|
44
|
+
child: const Text("OK"),
|
|
44
|
-
onPressed: () {
|
|
45
|
-
context.pop();
|
|
46
|
-
},
|
|
47
45
|
),
|
|
48
46
|
],
|
|
49
47
|
),
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
CHANGED
|
Binary file
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
CHANGED
|
Binary file
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
CHANGED
|
Binary file
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
CHANGED
|
Binary file
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
CHANGED
|
Binary file
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
CHANGED
|
Binary file
|
bible_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
CHANGED
|
Binary file
|
bible_app/pubspec.lock
CHANGED
|
@@ -33,6 +33,14 @@ packages:
|
|
|
33
33
|
url: "https://pub.dev"
|
|
34
34
|
source: hosted
|
|
35
35
|
version: "0.1.16"
|
|
36
|
+
back_button_interceptor:
|
|
37
|
+
dependency: transitive
|
|
38
|
+
description:
|
|
39
|
+
name: back_button_interceptor
|
|
40
|
+
sha256: e47660f2178a4392eb72001f9594d3fdcb5efde93e59d2819d61fda499e781c8
|
|
41
|
+
url: "https://pub.dev"
|
|
42
|
+
source: hosted
|
|
43
|
+
version: "6.0.2"
|
|
36
44
|
boolean_selector:
|
|
37
45
|
dependency: transitive
|
|
38
46
|
description:
|
|
@@ -303,6 +311,14 @@ packages:
|
|
|
303
311
|
url: "https://pub.dev"
|
|
304
312
|
source: hosted
|
|
305
313
|
version: "1.9.1"
|
|
314
|
+
one_context:
|
|
315
|
+
dependency: "direct main"
|
|
316
|
+
description:
|
|
317
|
+
name: one_context
|
|
318
|
+
sha256: db39c05e68a0f8dabb68072eab31e21912a5f4933db24eabc2b1af8a02d221e2
|
|
319
|
+
url: "https://pub.dev"
|
|
320
|
+
source: hosted
|
|
321
|
+
version: "2.1.0"
|
|
306
322
|
path:
|
|
307
323
|
dependency: transitive
|
|
308
324
|
description:
|
bible_app/pubspec.yaml
CHANGED
|
@@ -17,6 +17,7 @@ dependencies:
|
|
|
17
17
|
shared_preferences: ^2.2.0
|
|
18
18
|
flutter_native_splash: ^2.3.1
|
|
19
19
|
flutter_charset_detector: ^1.0.2
|
|
20
|
+
one_context: ^2.1.0
|
|
20
21
|
|
|
21
22
|
dev_dependencies:
|
|
22
23
|
flutter_test:
|
bible_app/web/favicon.png
CHANGED
|
Binary file
|
bible_app/web/icons/Icon-192.png
CHANGED
|
Binary file
|
bible_app/web/icons/Icon-512.png
CHANGED
|
Binary file
|
bible_app/web/icons/Icon-maskable-192.png
CHANGED
|
Binary file
|
bible_app/web/icons/Icon-maskable-512.png
CHANGED
|
Binary file
|
bible_app/windows/runner/resources/app_icon.ico
CHANGED
|
Binary file
|
scripts/convertVerses.js
CHANGED
|
@@ -87,9 +87,9 @@ const main = async () => {
|
|
|
87
87
|
// const end = durationAcc + result.privAudioDuration / 10000000;
|
|
88
88
|
// durationAcc = end;
|
|
89
89
|
// item.push(start.toFixed(4), end.toFixed(4));
|
|
90
|
-
|
|
90
|
+
if (chapter === 2) {
|
|
91
|
-
|
|
91
|
+
break;
|
|
92
|
-
|
|
92
|
+
}
|
|
93
93
|
await sleep(20);
|
|
94
94
|
}
|
|
95
95
|
synthesizer.close();
|