~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.
5aeefbd2
—
pyrossh 2 years ago
rename
bible_app/lib/routes/{index.dart → home_screen_route.dart}
RENAMED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import "package:flutter/material.dart";
|
|
2
2
|
import 'package:go_router/go_router.dart';
|
|
3
|
-
import '../domain/book.dart';
|
|
4
3
|
import '../components/header.dart';
|
|
5
|
-
import '../domain/kannada_gen.dart';
|
|
6
4
|
import '../components/verse_view.dart';
|
|
7
5
|
import '../state.dart';
|
|
8
|
-
import '../utils/assets.dart';
|
|
9
6
|
|
|
10
7
|
class HomeScreenRoute extends GoRouteData {
|
|
11
8
|
final String book;
|
|
@@ -17,11 +14,8 @@ class HomeScreenRoute extends GoRouteData {
|
|
|
17
14
|
|
|
18
15
|
@override
|
|
19
16
|
Page buildPage(BuildContext context, GoRouterState state) {
|
|
20
|
-
final selectedBook =
|
|
17
|
+
final selectedBook = selectedBible.value.firstWhere((it) => book == it.name);
|
|
21
18
|
final verses = selectedBook.chapters[chapter].verses;
|
|
22
|
-
print("Build");
|
|
23
|
-
Stopwatch stopwatch = Stopwatch()..start();
|
|
24
|
-
|
|
25
19
|
return NoTransitionPage(
|
|
26
20
|
child: Container(
|
|
27
21
|
margin: EdgeInsets.symmetric(
|
|
@@ -29,22 +23,7 @@ class HomeScreenRoute extends GoRouteData {
|
|
|
29
23
|
),
|
|
30
24
|
child: Column(
|
|
31
25
|
children: [
|
|
32
|
-
Header(book:
|
|
26
|
+
Header(book: selectedBook.index, chapter: chapter, verses: verses),
|
|
33
|
-
FutureBuilder(
|
|
34
|
-
future: Utils.loadGzAsset(context, "kannada.csv.gz"),
|
|
35
|
-
// future: Utils.loadAsset(context, "kannada.csv"),
|
|
36
|
-
builder: (context, snapshot) {
|
|
37
|
-
if (snapshot.hasData) {
|
|
38
|
-
stopwatch.stop();
|
|
39
|
-
print('time elapsed ${stopwatch.elapsed}');
|
|
40
|
-
return Text("Loaded");
|
|
41
|
-
}
|
|
42
|
-
if (snapshot.hasError) {
|
|
43
|
-
return Text("Error");
|
|
44
|
-
}
|
|
45
|
-
return Text("Loading....");
|
|
46
|
-
},
|
|
47
|
-
),
|
|
48
27
|
Flexible(
|
|
49
28
|
child: ListView.builder(
|
|
50
29
|
padding: const EdgeInsets.symmetric(
|
|
@@ -60,15 +39,15 @@ class HomeScreenRoute extends GoRouteData {
|
|
|
60
39
|
);
|
|
61
40
|
},
|
|
62
41
|
),
|
|
63
|
-
)
|
|
42
|
+
)
|
|
64
|
-
// Container(
|
|
65
|
-
// margin: const EdgeInsets.only(top: 5),
|
|
66
|
-
// decoration: const BoxDecoration(
|
|
67
|
-
// border: Border(bottom: BorderSide(width: 1.5)),
|
|
68
|
-
// ),
|
|
69
|
-
// ),
|
|
70
43
|
],
|
|
71
44
|
),
|
|
45
|
+
// Container(
|
|
46
|
+
// margin: const EdgeInsets.only(top: 5),
|
|
47
|
+
// decoration: const BoxDecoration(
|
|
48
|
+
// border: Border(bottom: BorderSide(width: 1.5)),
|
|
49
|
+
// ),
|
|
50
|
+
// ),
|
|
72
51
|
),
|
|
73
52
|
);
|
|
74
53
|
}
|