~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.
d9f20bb8
—
pyrossh 2 years ago
Add urls
- lib/app.dart +11 -7
- lib/main.dart +1 -1
- pubspec.lock +1 -1
- pubspec.yaml +2 -0
lib/app.dart
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import 'dart:ui' as ui;
|
|
2
1
|
import "package:flutter/material.dart";
|
|
3
2
|
import "package:flutter_gen/gen_l10n/app_localizations.dart";
|
|
4
|
-
import "package:only_bible_app/providers/app_provider.dart";
|
|
5
3
|
import "package:only_bible_app/screens/chapter_view_screen.dart";
|
|
6
4
|
import "package:only_bible_app/theme.dart";
|
|
5
|
+
import "package:only_bible_app/utils.dart";
|
|
6
|
+
import "package:only_bible_app/widgets/scaffold_markdown.dart";
|
|
7
7
|
|
|
8
8
|
class App extends StatelessWidget {
|
|
9
9
|
final int initialBook;
|
|
@@ -13,18 +13,22 @@ class App extends StatelessWidget {
|
|
|
13
13
|
|
|
14
14
|
@override
|
|
15
15
|
Widget build(BuildContext context) {
|
|
16
|
-
final model = AppProvider.of(context);
|
|
17
16
|
return MaterialApp(
|
|
18
17
|
title: "Only Bible App",
|
|
19
|
-
locale:
|
|
18
|
+
locale: context.app.locale,
|
|
20
|
-
// onGenerateTitle: (context) =>
|
|
21
|
-
// DemoLocalizations.of(context).title,
|
|
22
19
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
23
20
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
24
21
|
debugShowCheckedModeBanner: false,
|
|
25
|
-
themeMode:
|
|
22
|
+
themeMode: context.app.darkMode ? ThemeMode.dark : ThemeMode.light,
|
|
26
23
|
theme: lightTheme,
|
|
27
24
|
darkTheme: darkTheme,
|
|
25
|
+
// initialRoute: "",
|
|
26
|
+
routes: {
|
|
27
|
+
// TODO: maybe have a landing page
|
|
28
|
+
// "/": (context) => const ScaffoldMarkdown(title: "Privacy Policy", file: "privacy-policy.md"),
|
|
29
|
+
"/privacy-policy": (context) => const ScaffoldMarkdown(title: "Privacy Policy", file: "privacy-policy.md"),
|
|
30
|
+
"/about-us": (context) => const ScaffoldMarkdown(title: "About Us", file: "about-us.md"),
|
|
31
|
+
},
|
|
28
32
|
home: ChapterViewScreen(book: initialBook, chapter: initialChapter),
|
|
29
33
|
);
|
|
30
34
|
}
|
lib/main.dart
CHANGED
|
@@ -11,7 +11,6 @@ import "package:only_bible_app/providers/app_provider.dart";
|
|
|
11
11
|
import "package:provider/provider.dart";
|
|
12
12
|
|
|
13
13
|
void main() async {
|
|
14
|
-
usePathUrlStrategy();
|
|
15
14
|
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
|
16
15
|
await Firebase.initializeApp(
|
|
17
16
|
options: DefaultFirebaseOptions.currentPlatform,
|
|
@@ -25,6 +24,7 @@ void main() async {
|
|
|
25
24
|
return true;
|
|
26
25
|
};
|
|
27
26
|
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
|
27
|
+
usePathUrlStrategy();
|
|
28
28
|
print(Intl.getCurrentLocale());
|
|
29
29
|
final model = AppProvider();
|
|
30
30
|
final (book, chapter) = await model.loadData();
|
pubspec.lock
CHANGED
|
@@ -422,7 +422,7 @@ packages:
|
|
|
422
422
|
source: sdk
|
|
423
423
|
version: "0.0.0"
|
|
424
424
|
flutter_web_plugins:
|
|
425
|
-
dependency:
|
|
425
|
+
dependency: "direct main"
|
|
426
426
|
description: flutter
|
|
427
427
|
source: sdk
|
|
428
428
|
version: "0.0.0"
|
pubspec.yaml
CHANGED
|
@@ -11,6 +11,8 @@ dependencies:
|
|
|
11
11
|
sdk: flutter
|
|
12
12
|
flutter_localizations:
|
|
13
13
|
sdk: flutter
|
|
14
|
+
flutter_web_plugins:
|
|
15
|
+
sdk: flutter
|
|
14
16
|
intl: any
|
|
15
17
|
path_provider: ^2.0.15
|
|
16
18
|
just_audio: ^0.9.34
|