~repos /only-bible-app

#kotlin#android#ios

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.


6c964113 pyrossh

2 years ago
fix chapter select
bible_app/lib/components/book_selector.dart CHANGED
@@ -11,39 +11,11 @@ onTabBookChange(int i) {
11
11
  tabBookIndex.value = i;
12
12
  }
13
13
 
14
- // class CounterPage extends StatefulWidget {
15
- // _CounterPageState createState() => _CounterPageState();
16
- // }
17
- //
18
- // class _CounterPageState extends State<CounterPage> {
19
- // int count = 0;
20
- //
21
- // @override
22
- // Widget build(BuildContext context) {
23
- // return Scaffold(
24
- // appBar: AppBar(title: Text("Widget Communication")),
25
- // body: Center(
26
- // child: Count(
27
- // count: count,
28
- // onCountSelected: () {
29
- // print("Count was selected.");
30
- // },
31
- // onCountChanged: (int val) {
32
- // setState(() => count += val);
33
- // },
34
- // )
35
- // ),
36
- // );
37
- // }
38
- // }
39
-
40
14
  class BookSelector extends StatelessWidget {
41
15
  const BookSelector({super.key});
42
16
 
43
17
  @override
44
18
  Widget build(BuildContext context) {
45
- final book = kannadaBible[tabBookIndex.reactiveValue(context)];
46
-
47
19
  return DefaultTabController(
48
20
  length: 2,
49
21
  // animationDuration: Platform.isMacOS ? Duration.zero: const Duration(milliseconds: 300),
@@ -107,13 +79,7 @@ class BookSelector extends StatelessWidget {
107
79
  ),
108
80
  BooksList(offset: 39, books: newTestament),
109
81
  ]),
110
- ListView(children: [
111
- Container(
112
- margin: const EdgeInsets.only(bottom: 10, left: 10),
113
- child: Text(book.name, style: Theme.of(context).textTheme.headlineMedium),
114
- ),
115
- const ChaptersList(),
82
+ const ChaptersList(),
116
- ]),
117
83
  ],
118
84
  ),
119
85
  ),
@@ -169,31 +135,37 @@ class ChaptersList extends StatelessWidget {
169
135
  Widget build(BuildContext context) {
170
136
  final bookIndex = tabBookIndex.reactiveValue(context);
171
137
  final book = kannadaBible[bookIndex];
138
+ return ListView(children: [
172
- return Wrap(
139
+ Container(
140
+ margin: const EdgeInsets.only(bottom: 10, left: 10),
141
+ child: Text(book.name, style: Theme.of(context).textTheme.headlineMedium),
142
+ ),
143
+ Wrap(
173
- children: List.generate(book.chapters.length, (index) {
144
+ children: List.generate(book.chapters.length, (index) {
174
- return InkWell(
145
+ return InkWell(
175
- borderRadius: const BorderRadius.all(Radius.circular(30)),
146
+ borderRadius: const BorderRadius.all(Radius.circular(30)),
176
- onTap: () {
147
+ onTap: () {
177
- HomeScreenRoute(book: book.name, chapter: index).go(context);
148
+ HomeScreenRoute(book: book.name, chapter: index).go(context);
178
- },
149
+ },
179
- child: Container(
150
+ child: Container(
180
- width: 90,
151
+ width: 90,
181
- height: 50,
152
+ height: 50,
182
- margin: const EdgeInsets.all(8),
153
+ margin: const EdgeInsets.all(8),
183
- child: Material(
154
+ child: Material(
184
- elevation: 3,
155
+ elevation: 3,
185
- borderRadius: const BorderRadius.all(Radius.circular(30)),
156
+ borderRadius: const BorderRadius.all(Radius.circular(30)),
186
- child: Center(
157
+ child: Center(
187
- child: Text(
158
+ child: Text(
188
- "${index + 1}",
159
+ "${index + 1}",
189
- textAlign: TextAlign.center,
160
+ textAlign: TextAlign.center,
190
- style: Theme.of(context).textTheme.labelMedium,
161
+ style: Theme.of(context).textTheme.labelMedium,
162
+ ),
191
163
  ),
192
164
  ),
193
165
  ),
194
- ),
195
- );
166
+ );
196
- }),
167
+ }),
168
+ )
197
- );
169
+ ]);
198
170
  }
199
171
  }
bible_app/lib/main.dart CHANGED
@@ -1,9 +1,7 @@
1
1
  import "package:flutter/material.dart";
2
2
  import 'package:go_router/go_router.dart';
3
3
  import "package:flutter_persistent_value_notifier/flutter_persistent_value_notifier.dart";
4
- import "package:kannada_bible_app/components/book_selector.dart";
5
4
  import "./screens/home.dart";
6
- import "components/header.dart";
7
5
  import "components/sidebar.dart";
8
6
 
9
7
  void main() async {
@@ -60,9 +58,6 @@ class App extends StatelessWidget {
60
58
  return MaterialApp.router(
61
59
  routerConfig: _router,
62
60
  theme: ThemeData(
63
- tabBarTheme: TabBarTheme(
64
- dividerColor: Colors.white,
65
- ),
66
61
  brightness: Brightness.light,
67
62
  primaryColor: const Color(0xFF4C2323),
68
63
  secondaryHeaderColor: const Color(0xFFFFB341),
@@ -110,9 +105,6 @@ class App extends StatelessWidget {
110
105
  ),
111
106
  ),
112
107
  darkTheme: ThemeData(
113
- tabBarTheme: TabBarTheme(
114
- dividerColor: Colors.white,
115
- ),
116
108
  brightness: Brightness.light,
117
109
  primaryColor: const Color(0xFF4C2323),
118
110
  secondaryHeaderColor: const Color(0xFFFFB341),
bible_app/lib/utils/dialog.dart CHANGED
@@ -26,7 +26,7 @@ Future<T?> showCustomDialog<T>(BuildContext context, Widget child) {
26
26
  }
27
27
 
28
28
  class DialogUtils {
29
- static DialogUtils _instance = new DialogUtils.internal();
29
+ static final DialogUtils _instance = DialogUtils.internal();
30
30
 
31
31
  DialogUtils.internal();
32
32
 
@@ -104,23 +104,23 @@ void showSlideCustomDialog(BuildContext context) {
104
104
  barrierLabel: "Barrier",
105
105
  barrierDismissible: true,
106
106
  barrierColor: Colors.black.withOpacity(0.5),
107
- transitionDuration: Duration(milliseconds: 700),
107
+ transitionDuration: const Duration(milliseconds: 700),
108
108
  pageBuilder: (_, __, ___) {
109
109
  return Center(
110
110
  child: Container(
111
111
  height: 240,
112
- child: SizedBox.expand(child: FlutterLogo()),
113
- margin: EdgeInsets.symmetric(horizontal: 20),
112
+ margin: const EdgeInsets.symmetric(horizontal: 20),
114
113
  decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(40)),
114
+ child: const SizedBox.expand(child: FlutterLogo()),
115
115
  ),
116
116
  );
117
117
  },
118
118
  transitionBuilder: (_, anim, __, child) {
119
119
  Tween<Offset> tween;
120
120
  if (anim.status == AnimationStatus.reverse) {
121
- tween = Tween(begin: Offset(-1, 0), end: Offset.zero);
121
+ tween = Tween(begin: const Offset(-1, 0), end: Offset.zero);
122
122
  } else {
123
- tween = Tween(begin: Offset(1, 0), end: Offset.zero);
123
+ tween = Tween(begin: const Offset(1, 0), end: Offset.zero);
124
124
  }
125
125
 
126
126
  return SlideTransition(
bible_app/scripts/generate.dart CHANGED
@@ -1,6 +1,5 @@
1
1
  import "dart:io";
2
-
3
- import "../lib/domain/book.dart";
2
+ import 'package:kannada_bible_app/domain/book.dart';
4
3
 
5
4
  void main() {
6
5
  final lines = File("./scripts/bibles/kannada.csv").readAsLinesSync();