~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.
d9bde302
—
pyrossh 2 years ago
improve code
- analysis_options.yaml +1 -1
- lib/main.dart +8 -8
- lib/models.dart +8 -0
- lib/theme.dart +9 -15
- lib/utils/dialog.dart +4 -2
- lib/{widgets/side_menu_page.dart → utils/side_menu_modal.dart} +3 -3
- lib/widgets/bible_selector.dart +42 -46
- lib/widgets/book_selector.dart +59 -56
- lib/widgets/books_list.dart +0 -61
- lib/widgets/chapter_selector.dart +55 -0
- lib/widgets/chapters_list.dart +0 -52
- lib/widgets/header.dart +9 -9
- lib/widgets/menu.dart +3 -3
- pubspec.lock +0 -48
- pubspec.yaml +5 -5
analysis_options.yaml
CHANGED
|
@@ -13,4 +13,4 @@ linter:
|
|
|
13
13
|
- use_named_constants
|
|
14
14
|
- use_string_buffers
|
|
15
15
|
- secure_pubspec_urls
|
|
16
|
-
-
|
|
16
|
+
- prefer_double_quotes
|
lib/main.dart
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "package:flutter/material.dart";
|
|
2
|
-
import
|
|
2
|
+
import "package:flutter/foundation.dart";
|
|
3
|
-
import
|
|
3
|
+
import "package:firebase_core/firebase_core.dart";
|
|
4
4
|
// import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
5
|
-
import
|
|
5
|
+
import "package:only_bible_app/options.dart";
|
|
6
|
-
import
|
|
6
|
+
import "package:flutter_persistent_value_notifier/flutter_persistent_value_notifier.dart";
|
|
7
|
-
import
|
|
7
|
+
import "package:flutter_native_splash/flutter_native_splash.dart";
|
|
8
|
-
import
|
|
8
|
+
import "package:only_bible_app/state.dart";
|
|
9
|
-
import
|
|
9
|
+
import "package:only_bible_app/app.dart";
|
|
10
10
|
|
|
11
11
|
// Toggle this to cause an async error to be thrown during initialization
|
|
12
12
|
// and to test that runZonedGuarded() catches the error
|
lib/models.dart
CHANGED
|
@@ -13,6 +13,14 @@ class Bible {
|
|
|
13
13
|
required this.name,
|
|
14
14
|
required this.books,
|
|
15
15
|
});
|
|
16
|
+
|
|
17
|
+
List<Book> getOldBooks() {
|
|
18
|
+
return books.where((it) => it.isOldTestament()).toList();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
List<Book> getNewBooks() {
|
|
22
|
+
return books.where((it) => it.isNewTestament()).toList();
|
|
23
|
+
}
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
class Book {
|
lib/theme.dart
CHANGED
|
@@ -37,7 +37,6 @@ final lightTheme = ThemeData(
|
|
|
37
37
|
textStyle: const TextStyle(
|
|
38
38
|
fontSize: 18,
|
|
39
39
|
fontWeight: FontWeight.w500,
|
|
40
|
-
color: Color(0xFF9A1111),
|
|
41
40
|
letterSpacing: 0,
|
|
42
41
|
),
|
|
43
42
|
),
|
|
@@ -93,20 +92,15 @@ final darkTheme = ThemeData(
|
|
|
93
92
|
),
|
|
94
93
|
iconButtonTheme: lightTheme.iconButtonTheme,
|
|
95
94
|
textButtonTheme: TextButtonThemeData(
|
|
96
|
-
style: TextButton.styleFrom( // TODO: copy this
|
|
97
|
-
|
|
95
|
+
style: ButtonStyle(
|
|
96
|
+
enableFeedback: lightTheme.textButtonTheme.style!.enableFeedback,
|
|
98
|
-
padding:
|
|
97
|
+
padding: lightTheme.textButtonTheme.style!.padding,
|
|
99
|
-
shape:
|
|
98
|
+
shape: lightTheme.textButtonTheme.style!.shape,
|
|
99
|
+
textStyle: lightTheme.textButtonTheme.style!.textStyle,
|
|
100
|
-
elevation:
|
|
100
|
+
elevation: lightTheme.textButtonTheme.style!.elevation,
|
|
101
|
-
shadowColor: Colors.white,
|
|
101
|
+
shadowColor: MaterialStateProperty.all(Colors.white),
|
|
102
|
-
backgroundColor: const Color(0xFF323232),
|
|
102
|
+
backgroundColor: MaterialStateProperty.all(const Color(0xFF323232)),
|
|
103
|
-
foregroundColor: const Color(0xFFBC86FC),
|
|
103
|
+
foregroundColor: MaterialStateProperty.all(const Color(0xFFBC86FC)),
|
|
104
|
-
textStyle: const TextStyle(
|
|
105
|
-
fontSize: 18,
|
|
106
|
-
fontWeight: FontWeight.w500,
|
|
107
|
-
color: Color(0xFF9A1111),
|
|
108
|
-
letterSpacing: 0,
|
|
109
|
-
),
|
|
110
104
|
),
|
|
111
105
|
),
|
|
112
106
|
textTheme: TextTheme(
|
lib/utils/dialog.dart
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "dart:ui";
|
|
2
2
|
import "package:flutter/material.dart";
|
|
3
|
+
import "package:go_router/go_router.dart";
|
|
3
4
|
|
|
4
5
|
Future<T?> showCustomDialog<T>(BuildContext context, Widget child) {
|
|
5
6
|
return showGeneralDialog<T>(
|
|
@@ -7,7 +8,7 @@ Future<T?> showCustomDialog<T>(BuildContext context, Widget child) {
|
|
|
7
8
|
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
8
9
|
barrierDismissible: true,
|
|
9
10
|
barrierColor: Colors.black.withOpacity(0.5),
|
|
10
|
-
transitionDuration:
|
|
11
|
+
transitionDuration: Duration.zero,
|
|
11
12
|
transitionBuilder: (_, anim, __, child) {
|
|
12
13
|
return FadeTransition(
|
|
13
14
|
opacity: anim,
|
|
@@ -40,7 +41,8 @@ showAlert(BuildContext context, String title, String message) {
|
|
|
40
41
|
actions: [
|
|
41
42
|
TextButton(
|
|
42
43
|
onPressed: () {
|
|
43
|
-
Navigator.of(context).pop();
|
|
44
|
+
// Navigator.of(context).pop();
|
|
45
|
+
context.pop();
|
|
44
46
|
},
|
|
45
47
|
child: const Text("OK"),
|
|
46
48
|
),
|
lib/{widgets/side_menu_page.dart → utils/side_menu_modal.dart}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
2
|
import 'package:only_bible_app/state.dart';
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class SideMenuModal extends ModalRoute<void> {
|
|
5
5
|
final Widget child;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
SideMenuModal({required this.child});
|
|
8
8
|
|
|
9
9
|
@override
|
|
10
|
-
Duration get transitionDuration =>
|
|
10
|
+
Duration get transitionDuration => Duration.zero;
|
|
11
11
|
|
|
12
12
|
@override
|
|
13
13
|
Duration get reverseTransitionDuration => Duration.zero;
|
lib/widgets/bible_selector.dart
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
|
-
import 'package:go_router/go_router.dart';
|
|
3
|
-
import 'package:only_bible_app/widgets/books_list.dart';
|
|
4
|
-
import 'package:only_bible_app/widgets/chapters_list.dart';
|
|
5
|
-
import
|
|
2
|
+
import "package:only_bible_app/state.dart";
|
|
6
|
-
import
|
|
3
|
+
import "package:only_bible_app/models.dart";
|
|
7
|
-
|
|
8
|
-
import '../models.dart';
|
|
9
4
|
|
|
10
5
|
class BibleSelector extends StatelessWidget {
|
|
11
6
|
const BibleSelector({super.key});
|
|
@@ -14,48 +9,49 @@ class BibleSelector extends StatelessWidget {
|
|
|
14
9
|
Widget build(BuildContext context) {
|
|
15
10
|
return Container(
|
|
16
11
|
margin: EdgeInsets.only(top: isWide(context) ? 5 : 0, left: 20),
|
|
17
|
-
child:
|
|
12
|
+
child: Column(
|
|
13
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
18
14
|
children: [
|
|
19
|
-
|
|
15
|
+
Container(
|
|
16
|
+
margin: const EdgeInsets.only(bottom: 20),
|
|
17
|
+
child: Row(
|
|
20
|
-
|
|
18
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
|
21
|
-
|
|
19
|
+
children: [
|
|
22
|
-
Container(
|
|
23
|
-
margin: const EdgeInsets.only(bottom: 20),
|
|
24
|
-
child: Row(
|
|
25
|
-
mainAxisAlignment: MainAxisAlignment.center,
|
|
26
|
-
children: [
|
|
27
|
-
|
|
20
|
+
Expanded(
|
|
28
|
-
|
|
21
|
+
child: Text("Bibles", style: Theme.of(context).textTheme.headlineMedium),
|
|
29
|
-
),
|
|
30
|
-
Container(
|
|
31
|
-
margin: EdgeInsets.only(right: isWide(context) ? 30 : 10),
|
|
32
|
-
child: IconButton(
|
|
33
|
-
icon: const Icon(Icons.close, size: 28),
|
|
34
|
-
onPressed: () {
|
|
35
|
-
Navigator.of(context).pop();
|
|
36
|
-
},
|
|
37
|
-
),
|
|
38
|
-
)
|
|
39
|
-
],
|
|
40
|
-
),
|
|
41
|
-
),
|
|
42
|
-
Wrap(
|
|
43
|
-
children: List.of(
|
|
44
|
-
bibles.map((bible) {
|
|
45
|
-
return Container(
|
|
46
|
-
margin: const EdgeInsets.only(right: 16, bottom: 16),
|
|
47
|
-
child: TextButton(
|
|
48
|
-
style: TextButton.styleFrom(
|
|
49
|
-
padding: const EdgeInsets.all(20),
|
|
50
|
-
),
|
|
51
|
-
child: Text(bible.name),
|
|
52
|
-
onPressed: () => changeBible(context, bible.id),
|
|
53
|
-
),
|
|
54
|
-
);
|
|
55
|
-
}),
|
|
56
22
|
),
|
|
23
|
+
Container(
|
|
24
|
+
margin: const EdgeInsets.only(right: 10),
|
|
25
|
+
child: IconButton(
|
|
26
|
+
icon: const Icon(Icons.close, size: 28),
|
|
27
|
+
onPressed: () {
|
|
28
|
+
Navigator.of(context).pop();
|
|
29
|
+
},
|
|
30
|
+
),
|
|
31
|
+
)
|
|
32
|
+
],
|
|
33
|
+
),
|
|
34
|
+
),
|
|
35
|
+
Expanded(
|
|
36
|
+
child: GridView.count(
|
|
37
|
+
crossAxisCount: 2,
|
|
38
|
+
padding: EdgeInsets.zero,
|
|
39
|
+
shrinkWrap: true,
|
|
40
|
+
crossAxisSpacing: 0,
|
|
41
|
+
mainAxisSpacing: 0,
|
|
42
|
+
childAspectRatio: 4,
|
|
43
|
+
children: List.of(
|
|
44
|
+
bibles.map((bible) {
|
|
45
|
+
return Container(
|
|
46
|
+
margin: const EdgeInsets.only(right: 16, bottom: 16),
|
|
47
|
+
child: TextButton(
|
|
48
|
+
child: Text(bible.name),
|
|
49
|
+
onPressed: () => changeBible(context, bible.id),
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
}),
|
|
57
53
|
),
|
|
58
|
-
|
|
54
|
+
),
|
|
59
55
|
),
|
|
60
56
|
],
|
|
61
57
|
),
|
lib/widgets/book_selector.dart
CHANGED
|
@@ -1,70 +1,73 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
|
-
import 'package:go_router/go_router.dart';
|
|
3
|
-
import 'package:only_bible_app/widgets/books_list.dart';
|
|
4
|
-
import 'package:only_bible_app/widgets/chapters_list.dart';
|
|
5
|
-
import
|
|
2
|
+
import "package:only_bible_app/state.dart";
|
|
3
|
+
import "package:only_bible_app/widgets/chapter_selector.dart";
|
|
4
|
+
import "package:only_bible_app/utils/side_menu_modal.dart";
|
|
6
5
|
|
|
7
|
-
class BookSelector extends
|
|
6
|
+
class BookSelector extends StatelessWidget {
|
|
8
7
|
const BookSelector({super.key});
|
|
9
8
|
|
|
10
|
-
@override
|
|
11
|
-
State<StatefulWidget> createState() => BookSelectorState();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
class BookSelectorState extends State<BookSelector> {
|
|
15
|
-
int tab = 0;
|
|
16
|
-
int bookIndex = 0;
|
|
17
|
-
|
|
18
|
-
@override
|
|
19
|
-
void initState() {
|
|
20
|
-
super.initState();
|
|
21
|
-
tab = 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
onBookSelected(int index) {
|
|
9
|
+
onBookSelected(BuildContext context, int index) {
|
|
25
|
-
setState(() {
|
|
26
|
-
bookIndex = index;
|
|
27
|
-
tab = 1;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
onChapterSelected(int index) {
|
|
32
|
-
|
|
10
|
+
Navigator.of(context).pushReplacement(SideMenuModal(child: ChapterSelector(selectedBookIndex: index)));
|
|
33
11
|
}
|
|
34
12
|
|
|
35
13
|
@override
|
|
36
14
|
Widget build(BuildContext context) {
|
|
37
|
-
if (tab == 1) {
|
|
38
|
-
final book = selectedBible.value!.books[bookIndex];
|
|
39
|
-
return Container(
|
|
40
|
-
margin: EdgeInsets.only(top: isWide(context) ? 5 : 0, left: 20),
|
|
41
|
-
child: ChaptersList(
|
|
42
|
-
title: book.name,
|
|
43
|
-
length: book.chapters.length,
|
|
44
|
-
onTap: onChapterSelected,
|
|
45
|
-
),
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
final oldTestament = selectedBible.value!.books.where((it) => it.isOldTestament()).toList();
|
|
49
|
-
final newTestament = selectedBible.value!.books.where((it) => it.isNewTestament()).toList();
|
|
50
15
|
return Container(
|
|
51
|
-
margin: EdgeInsets.only(top: isWide(context) ? 5 : 0, left: 20),
|
|
16
|
+
margin: EdgeInsets.only(top: isWide(context) ? 5 : 0, left: 20, right: 20),
|
|
17
|
+
child: CustomScrollView(
|
|
18
|
+
slivers: [
|
|
19
|
+
SliverToBoxAdapter(
|
|
52
|
-
|
|
20
|
+
child: Container(
|
|
21
|
+
margin: const EdgeInsets.only(bottom: 10),
|
|
22
|
+
child: Row(
|
|
23
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
|
53
|
-
|
|
24
|
+
children: [
|
|
25
|
+
Expanded(
|
|
26
|
+
child: Text("Old Testament", style: Theme.of(context).textTheme.headlineMedium),
|
|
27
|
+
),
|
|
54
|
-
|
|
28
|
+
IconButton(
|
|
55
|
-
|
|
29
|
+
icon: const Icon(Icons.close, size: 28),
|
|
30
|
+
onPressed: () {
|
|
31
|
+
Navigator.of(context).pop();
|
|
32
|
+
},
|
|
33
|
+
),
|
|
34
|
+
],
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
),
|
|
56
|
-
|
|
38
|
+
SliverGrid.count(
|
|
57
|
-
|
|
39
|
+
crossAxisCount: 6,
|
|
40
|
+
crossAxisSpacing: 16,
|
|
41
|
+
mainAxisSpacing: 16,
|
|
42
|
+
childAspectRatio: 1.6,
|
|
43
|
+
children: List.of(
|
|
44
|
+
selectedBible.value!.getOldBooks().map((book) {
|
|
45
|
+
return TextButton(
|
|
58
|
-
|
|
46
|
+
child: Text(book.shortName()),
|
|
47
|
+
onPressed: () => onBookSelected(context, book.index),
|
|
48
|
+
);
|
|
49
|
+
}),
|
|
50
|
+
),
|
|
59
51
|
),
|
|
52
|
+
SliverToBoxAdapter(
|
|
60
|
-
|
|
53
|
+
child: Container(
|
|
61
|
-
|
|
54
|
+
margin: const EdgeInsets.only(top: 30, bottom: 20),
|
|
55
|
+
child: Text("New Testament", style: Theme.of(context).textTheme.headlineMedium),
|
|
56
|
+
),
|
|
62
57
|
),
|
|
58
|
+
SliverGrid.count(
|
|
63
|
-
|
|
59
|
+
crossAxisCount: 6,
|
|
60
|
+
crossAxisSpacing: 16,
|
|
61
|
+
mainAxisSpacing: 16,
|
|
62
|
+
childAspectRatio: 1.6,
|
|
63
|
+
children: List.of(
|
|
64
|
-
|
|
64
|
+
selectedBible.value!.getNewBooks().map((book) {
|
|
65
|
+
return TextButton(
|
|
65
|
-
|
|
66
|
+
child: Text(book.shortName()),
|
|
66
|
-
showClose: false,
|
|
67
|
-
|
|
67
|
+
onPressed: () => onBookSelected(context, book.index),
|
|
68
|
+
);
|
|
69
|
+
}),
|
|
70
|
+
),
|
|
68
71
|
),
|
|
69
72
|
],
|
|
70
73
|
),
|
lib/widgets/books_list.dart
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import "package:flutter/material.dart";
|
|
2
|
-
import 'package:go_router/go_router.dart';
|
|
3
|
-
import 'package:only_bible_app/state.dart';
|
|
4
|
-
import 'package:only_bible_app/widgets/tile.dart';
|
|
5
|
-
import 'package:only_bible_app/models.dart';
|
|
6
|
-
|
|
7
|
-
class BooksList extends StatelessWidget {
|
|
8
|
-
final String title;
|
|
9
|
-
final List<Book> books;
|
|
10
|
-
final Function(int) onTap;
|
|
11
|
-
final bool showClose;
|
|
12
|
-
|
|
13
|
-
const BooksList({
|
|
14
|
-
super.key,
|
|
15
|
-
required this.title,
|
|
16
|
-
required this.books,
|
|
17
|
-
required this.onTap,
|
|
18
|
-
required this.showClose,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
@override
|
|
22
|
-
Widget build(BuildContext context) {
|
|
23
|
-
return Column(
|
|
24
|
-
crossAxisAlignment: CrossAxisAlignment.start,
|
|
25
|
-
children: [
|
|
26
|
-
Container(
|
|
27
|
-
margin: const EdgeInsets.only(bottom: 20),
|
|
28
|
-
child: Row(
|
|
29
|
-
mainAxisAlignment: MainAxisAlignment.center,
|
|
30
|
-
children: [
|
|
31
|
-
Expanded(
|
|
32
|
-
child: Text(title, style: Theme.of(context).textTheme.headlineMedium),
|
|
33
|
-
),
|
|
34
|
-
if (showClose)
|
|
35
|
-
Container(
|
|
36
|
-
margin: EdgeInsets.only(right: isWide(context) ? 30 : 10),
|
|
37
|
-
child: IconButton(
|
|
38
|
-
icon: const Icon(Icons.close, size: 28),
|
|
39
|
-
onPressed: () {
|
|
40
|
-
Navigator.of(context).pop();
|
|
41
|
-
},
|
|
42
|
-
),
|
|
43
|
-
)
|
|
44
|
-
],
|
|
45
|
-
),
|
|
46
|
-
),
|
|
47
|
-
Wrap(
|
|
48
|
-
children: List.of(
|
|
49
|
-
books.map((book) {
|
|
50
|
-
final name = book.shortName();
|
|
51
|
-
return Tile(
|
|
52
|
-
name: name,
|
|
53
|
-
onPressed: () => onTap(book.index),
|
|
54
|
-
);
|
|
55
|
-
}),
|
|
56
|
-
),
|
|
57
|
-
),
|
|
58
|
-
],
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
}
|
lib/widgets/chapter_selector.dart
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import "package:flutter/material.dart";
|
|
2
|
+
import "package:only_bible_app/state.dart";
|
|
3
|
+
|
|
4
|
+
class ChapterSelector extends StatelessWidget {
|
|
5
|
+
final int selectedBookIndex;
|
|
6
|
+
|
|
7
|
+
const ChapterSelector({super.key, required this.selectedBookIndex});
|
|
8
|
+
|
|
9
|
+
onChapterSelected(BuildContext context, int index) {
|
|
10
|
+
navigateBookChapter(context, selectedBookIndex, index, true);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@override
|
|
14
|
+
Widget build(BuildContext context) {
|
|
15
|
+
final book = selectedBible.value!.books[selectedBookIndex];
|
|
16
|
+
return Container(
|
|
17
|
+
margin: EdgeInsets.only(top: isWide(context) ? 5 : 0, left: 20, right: 20),
|
|
18
|
+
child: CustomScrollView(
|
|
19
|
+
slivers: [
|
|
20
|
+
SliverToBoxAdapter(
|
|
21
|
+
child: Container(
|
|
22
|
+
margin: const EdgeInsets.only(bottom: 10),
|
|
23
|
+
child: Row(
|
|
24
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
|
25
|
+
children: [
|
|
26
|
+
Expanded(
|
|
27
|
+
child: Text(book.name, style: Theme.of(context).textTheme.headlineMedium),
|
|
28
|
+
),
|
|
29
|
+
IconButton(
|
|
30
|
+
icon: const Icon(Icons.close, size: 28),
|
|
31
|
+
onPressed: () {
|
|
32
|
+
Navigator.of(context).pop();
|
|
33
|
+
},
|
|
34
|
+
),
|
|
35
|
+
],
|
|
36
|
+
),
|
|
37
|
+
),
|
|
38
|
+
),
|
|
39
|
+
SliverGrid.count(
|
|
40
|
+
crossAxisCount: 6,
|
|
41
|
+
crossAxisSpacing: 16,
|
|
42
|
+
mainAxisSpacing: 16,
|
|
43
|
+
childAspectRatio: 1.6,
|
|
44
|
+
children: List.generate(book.chapters.length, (index) {
|
|
45
|
+
return TextButton(
|
|
46
|
+
child: Text("${index + 1}"),
|
|
47
|
+
onPressed: () => onChapterSelected(context, index),
|
|
48
|
+
);
|
|
49
|
+
}),
|
|
50
|
+
),
|
|
51
|
+
],
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
lib/widgets/chapters_list.dart
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import "package:flutter/material.dart";
|
|
2
|
-
import 'package:go_router/go_router.dart';
|
|
3
|
-
import 'package:only_bible_app/state.dart';
|
|
4
|
-
import 'package:only_bible_app/widgets/tile.dart';
|
|
5
|
-
|
|
6
|
-
class ChaptersList extends StatelessWidget {
|
|
7
|
-
final String title;
|
|
8
|
-
final int length;
|
|
9
|
-
final Function(int) onTap;
|
|
10
|
-
|
|
11
|
-
const ChaptersList({
|
|
12
|
-
super.key,
|
|
13
|
-
required this.title,
|
|
14
|
-
required this.length,
|
|
15
|
-
required this.onTap,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
@override
|
|
19
|
-
Widget build(BuildContext context) {
|
|
20
|
-
return ListView(
|
|
21
|
-
children: [
|
|
22
|
-
Container(
|
|
23
|
-
margin: const EdgeInsets.only(bottom: 20),
|
|
24
|
-
child: Row(
|
|
25
|
-
children: [
|
|
26
|
-
Expanded(
|
|
27
|
-
child: Text(title, style: Theme.of(context).textTheme.headlineMedium),
|
|
28
|
-
),
|
|
29
|
-
Container(
|
|
30
|
-
margin: EdgeInsets.only(right: isWide(context) ? 30 : 10),
|
|
31
|
-
child: IconButton(
|
|
32
|
-
icon: const Icon(Icons.close, size: 28),
|
|
33
|
-
onPressed: () {
|
|
34
|
-
Navigator.of(context).pop();
|
|
35
|
-
},
|
|
36
|
-
),
|
|
37
|
-
)
|
|
38
|
-
],
|
|
39
|
-
),
|
|
40
|
-
),
|
|
41
|
-
Wrap(
|
|
42
|
-
children: List.generate(length, (index) {
|
|
43
|
-
return Tile(
|
|
44
|
-
name: "${index + 1}",
|
|
45
|
-
onPressed: () => onTap(index),
|
|
46
|
-
);
|
|
47
|
-
}),
|
|
48
|
-
)
|
|
49
|
-
],
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
}
|
lib/widgets/header.dart
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
|
-
import
|
|
2
|
+
import "package:flutter_reactive_value/flutter_reactive_value.dart";
|
|
3
|
-
import
|
|
3
|
+
import "package:only_bible_app/widgets/book_selector.dart";
|
|
4
|
-
import
|
|
4
|
+
import "package:only_bible_app/widgets/play_button.dart";
|
|
5
|
-
import
|
|
5
|
+
import "package:only_bible_app/utils/side_menu_modal.dart";
|
|
6
|
-
import
|
|
6
|
+
import "package:only_bible_app/widgets/menu.dart";
|
|
7
|
-
import
|
|
7
|
+
import "package:only_bible_app/state.dart";
|
|
8
|
-
import
|
|
8
|
+
import "package:only_bible_app/widgets/bible_selector.dart";
|
|
9
9
|
|
|
10
10
|
class Header extends StatelessWidget {
|
|
11
11
|
const Header({super.key});
|
|
@@ -43,7 +43,7 @@ class Header extends StatelessWidget {
|
|
|
43
43
|
style: Theme.of(context).textTheme.headlineMedium,
|
|
44
44
|
),
|
|
45
45
|
onPressed: () {
|
|
46
|
-
Navigator.of(context).push(
|
|
46
|
+
Navigator.of(context).push(SideMenuModal(child: const BookSelector()));
|
|
47
47
|
},
|
|
48
48
|
),
|
|
49
49
|
Row(
|
|
@@ -57,7 +57,7 @@ class Header extends StatelessWidget {
|
|
|
57
57
|
),
|
|
58
58
|
child: Text(selectedBible.reactiveValue(context)!.name),
|
|
59
59
|
onPressed: () {
|
|
60
|
-
Navigator.of(context).push(
|
|
60
|
+
Navigator.of(context).push(SideMenuModal(child: const BibleSelector()));
|
|
61
61
|
},
|
|
62
62
|
),
|
|
63
63
|
),
|
lib/widgets/menu.dart
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "package:flutter/material.dart";
|
|
2
|
-
import
|
|
2
|
+
import "package:flutter_reactive_value/flutter_reactive_value.dart";
|
|
3
|
-
import
|
|
3
|
+
import "package:only_bible_app/state.dart";
|
|
4
4
|
|
|
5
5
|
class Menu extends StatelessWidget {
|
|
6
6
|
const Menu({super.key});
|
pubspec.lock
CHANGED
|
@@ -49,14 +49,6 @@ packages:
|
|
|
49
49
|
url: "https://pub.dev"
|
|
50
50
|
source: hosted
|
|
51
51
|
version: "0.1.16"
|
|
52
|
-
back_button_interceptor:
|
|
53
|
-
dependency: transitive
|
|
54
|
-
description:
|
|
55
|
-
name: back_button_interceptor
|
|
56
|
-
sha256: e47660f2178a4392eb72001f9594d3fdcb5efde93e59d2819d61fda499e781c8
|
|
57
|
-
url: "https://pub.dev"
|
|
58
|
-
source: hosted
|
|
59
|
-
version: "6.0.2"
|
|
60
52
|
boolean_selector:
|
|
61
53
|
dependency: transitive
|
|
62
54
|
description:
|
|
@@ -294,38 +286,6 @@ packages:
|
|
|
294
286
|
url: "https://pub.dev"
|
|
295
287
|
source: hosted
|
|
296
288
|
version: "0.1.6"
|
|
297
|
-
flutter_charset_detector:
|
|
298
|
-
dependency: "direct main"
|
|
299
|
-
description:
|
|
300
|
-
name: flutter_charset_detector
|
|
301
|
-
sha256: edc87079f3c8917f2fa5620e594d10deef81bbf3d7a89cf99441dec955a06d9f
|
|
302
|
-
url: "https://pub.dev"
|
|
303
|
-
source: hosted
|
|
304
|
-
version: "1.0.2"
|
|
305
|
-
flutter_charset_detector_android:
|
|
306
|
-
dependency: transitive
|
|
307
|
-
description:
|
|
308
|
-
name: flutter_charset_detector_android
|
|
309
|
-
sha256: "2439a3bf418fe0fb962fc3dc9d0401c3561a497017bc587b9c48a47490f9c428"
|
|
310
|
-
url: "https://pub.dev"
|
|
311
|
-
source: hosted
|
|
312
|
-
version: "1.0.0"
|
|
313
|
-
flutter_charset_detector_ios:
|
|
314
|
-
dependency: transitive
|
|
315
|
-
description:
|
|
316
|
-
name: flutter_charset_detector_ios
|
|
317
|
-
sha256: e0e2c7b819cd1f7c9a50da94bf7f0e6d7a095eb64e81196ec758e77793903d43
|
|
318
|
-
url: "https://pub.dev"
|
|
319
|
-
source: hosted
|
|
320
|
-
version: "1.0.2"
|
|
321
|
-
flutter_charset_detector_platform_interface:
|
|
322
|
-
dependency: transitive
|
|
323
|
-
description:
|
|
324
|
-
name: flutter_charset_detector_platform_interface
|
|
325
|
-
sha256: fcb61de27285031164c945aca4b42e4d36f9a9e359212f21ab652275c9c723ec
|
|
326
|
-
url: "https://pub.dev"
|
|
327
|
-
source: hosted
|
|
328
|
-
version: "1.0.0"
|
|
329
289
|
flutter_driver:
|
|
330
290
|
dependency: transitive
|
|
331
291
|
description: flutter
|
|
@@ -580,14 +540,6 @@ packages:
|
|
|
580
540
|
url: "https://pub.dev"
|
|
581
541
|
source: hosted
|
|
582
542
|
version: "1.0.4"
|
|
583
|
-
one_context:
|
|
584
|
-
dependency: "direct main"
|
|
585
|
-
description:
|
|
586
|
-
name: one_context
|
|
587
|
-
sha256: db39c05e68a0f8dabb68072eab31e21912a5f4933db24eabc2b1af8a02d221e2
|
|
588
|
-
url: "https://pub.dev"
|
|
589
|
-
source: hosted
|
|
590
|
-
version: "2.1.0"
|
|
591
543
|
package_config:
|
|
592
544
|
dependency: transitive
|
|
593
545
|
description:
|
pubspec.yaml
CHANGED
|
@@ -9,6 +9,9 @@ environment:
|
|
|
9
9
|
dependencies:
|
|
10
10
|
flutter:
|
|
11
11
|
sdk: flutter
|
|
12
|
+
flutter_localizations:
|
|
13
|
+
sdk: flutter
|
|
14
|
+
intl: any
|
|
12
15
|
path_provider: ^2.0.15
|
|
13
16
|
flutter_persistent_value_notifier: ^1.0.2
|
|
14
17
|
flutter_reactive_value: ^1.0.4
|
|
@@ -16,14 +19,11 @@ dependencies:
|
|
|
16
19
|
go_router: ^10.0.0
|
|
17
20
|
shared_preferences: ^2.2.0
|
|
18
21
|
flutter_native_splash: ^2.3.1
|
|
19
|
-
flutter_charset_detector: ^1.0.2
|
|
20
|
-
one_context: ^2.1.0
|
|
21
22
|
flutter_swipe_detector: ^2.0.0
|
|
22
23
|
cupertino_icons: ^1.0.5
|
|
23
24
|
firebase_core: ^2.15.0
|
|
24
|
-
|
|
25
|
+
# firebase_crashlytics: ^3.3.4
|
|
25
|
-
|
|
26
|
+
# firebase_performance: ^0.9.2+4
|
|
26
|
-
intl: any
|
|
27
27
|
|
|
28
28
|
dev_dependencies:
|
|
29
29
|
flutter_test:
|