~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.


9de1044a pyrossh

2 years ago
log/record errors
README.md CHANGED
@@ -45,3 +45,6 @@ firebase deploy
45
45
  https://only-bible-app.web.app
46
46
  https://onlybible.app
47
47
  ```
48
+
49
+ Note:
50
+ > For crashanalytics to work in dev/debug mode in macos this has to be set DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
lib/main.dart CHANGED
@@ -1,33 +1,25 @@
1
1
  import "package:flutter/material.dart";
2
2
  import "package:flutter/foundation.dart";
3
3
  import "package:firebase_core/firebase_core.dart";
4
-
5
- // import 'package:firebase_crashlytics/firebase_crashlytics.dart';
4
+ import "package:firebase_crashlytics/firebase_crashlytics.dart";
6
5
  import "package:only_bible_app/options.dart";
7
6
  import "package:flutter_native_splash/flutter_native_splash.dart";
8
7
  import "package:only_bible_app/state.dart";
9
8
  import "package:only_bible_app/app.dart";
10
9
  import "package:provider/provider.dart";
11
10
 
12
- // Toggle this to cause an async error to be thrown during initialization
13
- // and to test that runZonedGuarded() catches the error
14
- const _kShouldTestAsyncErrorOnInit = false;
15
-
16
- // Toggle this for testing Crashlytics in your app locally.
17
- const _kTestingCrashlytics = true;
18
-
19
11
  void main() async {
20
12
  WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
21
13
  await Firebase.initializeApp(
22
14
  options: DefaultFirebaseOptions.currentPlatform,
23
15
  );
24
- // FlutterError.onError = (errorDetails) {
16
+ FlutterError.onError = (errorDetails) {
25
- // FirebaseCrashlytics.instance.recordFlutterError(errorDetails);
17
+ FirebaseCrashlytics.instance.recordFlutterError(errorDetails);
26
- // };
18
+ };
27
- // PlatformDispatcher.instance.onError = (error, stack) {
19
+ PlatformDispatcher.instance.onError = (error, stack) {
28
- // FirebaseCrashlytics.instance.recordError(error, stack);
20
+ FirebaseCrashlytics.instance.recordError(error, stack);
29
- // return true;
21
+ return true;
30
- // };
22
+ };
31
23
  FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
32
24
  final model = AppModel();
33
25
  final (book, chapter) = await model.loadData();
lib/state.dart CHANGED
@@ -1,4 +1,6 @@
1
1
  import "dart:convert";
2
+ import "dart:developer";
3
+ import "package:firebase_crashlytics/firebase_crashlytics.dart";
2
4
  import "package:flutter/foundation.dart" show defaultTargetPlatform, TargetPlatform;
3
5
  import "package:flutter/services.dart";
4
6
  import "package:flutter/material.dart";
@@ -193,28 +195,27 @@ class ChapterViewModel extends ChangeNotifier {
193
195
  isPlaying = false;
194
196
  notifyListeners();
195
197
  } else {
198
+ isPlaying = true;
199
+ notifyListeners();
200
+ for (final v in selectedVerses) {
201
+ final bibleName = bibleModel.bible.name;
202
+ final book = (model.book + 1).toString().padLeft(2, "0");
203
+ final chapter = (model.chapter + 1).toString().padLeft(3, "0");
204
+ final verse = (v + 1).toString().padLeft(3, "0");
205
+ final url = "http://localhost:3000/$bibleName/$book-$chapter-$verse.mp3";
196
- try {
206
+ try {
197
- isPlaying = true;
198
- notifyListeners();
199
- for (final v in selectedVerses) {
200
- final bibleName = bibleModel.bible.name;
201
- final book = (model.book + 1).toString().padLeft(2, "0");
202
- final chapter = (model.chapter + 1).toString().padLeft(3, "0");
203
- final verse = (v + 1).toString().padLeft(3, "0");
204
- await player.setUrl(
207
+ await player.setUrl(url);
205
- "http://localhost:3000/$bibleName/$book-$chapter-$verse.mp3",
206
- );
207
208
  await player.play();
208
209
  await player.stop();
210
+ } on PlayerException catch (err) {
211
+ log("Could not play audio", name: "play", error: (err.toString(), url));
212
+ FirebaseCrashlytics.instance.recordFlutterError(FlutterErrorDetails(exception: (err.toString(), url)));
213
+ showError(context, "Could not play audio");
214
+ } finally {
215
+ await player.pause();
216
+ isPlaying = false;
217
+ notifyListeners();
209
218
  }
210
- } catch (err) {
211
- // TODO: log this error
212
- print(err.toString());
213
- showError(context, "Could not play audio");
214
- } finally {
215
- await player.pause();
216
- isPlaying = false;
217
- notifyListeners();
218
219
  }
219
220
  }
220
221
  }
macos/Flutter/GeneratedPluginRegistrant.swift CHANGED
@@ -7,6 +7,7 @@ import Foundation
7
7
 
8
8
  import audio_session
9
9
  import firebase_core
10
+ import firebase_crashlytics
10
11
  import just_audio
11
12
  import path_provider_foundation
12
13
  import shared_preferences_foundation
@@ -14,6 +15,7 @@ import shared_preferences_foundation
14
15
  func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
15
16
  AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
16
17
  FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
18
+ FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
17
19
  JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
18
20
  PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
19
21
  SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
macos/Podfile.lock CHANGED
@@ -3,27 +3,71 @@ PODS:
3
3
  - FlutterMacOS
4
4
  - Firebase/CoreOnly (10.12.0):
5
5
  - FirebaseCore (= 10.12.0)
6
+ - Firebase/Crashlytics (10.12.0):
7
+ - Firebase/CoreOnly
8
+ - FirebaseCrashlytics (~> 10.12.0)
6
9
  - firebase_core (2.15.0):
7
10
  - Firebase/CoreOnly (~> 10.12.0)
8
11
  - FlutterMacOS
12
+ - firebase_crashlytics (3.3.4):
13
+ - Firebase/CoreOnly (~> 10.12.0)
14
+ - Firebase/Crashlytics (~> 10.12.0)
15
+ - firebase_core
16
+ - FlutterMacOS
9
17
  - FirebaseCore (10.12.0):
10
18
  - FirebaseCoreInternal (~> 10.0)
11
19
  - GoogleUtilities/Environment (~> 7.8)
12
20
  - GoogleUtilities/Logger (~> 7.8)
21
+ - FirebaseCoreExtension (10.13.0):
22
+ - FirebaseCore (~> 10.0)
13
23
  - FirebaseCoreInternal (10.13.0):
14
24
  - "GoogleUtilities/NSData+zlib (~> 7.8)"
25
+ - FirebaseCrashlytics (10.12.0):
26
+ - FirebaseCore (~> 10.5)
27
+ - FirebaseInstallations (~> 10.0)
28
+ - FirebaseSessions (~> 10.5)
29
+ - GoogleDataTransport (~> 9.2)
30
+ - GoogleUtilities/Environment (~> 7.8)
31
+ - nanopb (< 2.30910.0, >= 2.30908.0)
32
+ - PromisesObjC (~> 2.1)
33
+ - FirebaseInstallations (10.13.0):
34
+ - FirebaseCore (~> 10.0)
35
+ - GoogleUtilities/Environment (~> 7.8)
36
+ - GoogleUtilities/UserDefaults (~> 7.8)
37
+ - PromisesObjC (~> 2.1)
38
+ - FirebaseSessions (10.13.0):
39
+ - FirebaseCore (~> 10.5)
40
+ - FirebaseCoreExtension (~> 10.0)
41
+ - FirebaseInstallations (~> 10.0)
42
+ - GoogleDataTransport (~> 9.2)
43
+ - GoogleUtilities/Environment (~> 7.10)
44
+ - nanopb (< 2.30910.0, >= 2.30908.0)
45
+ - PromisesSwift (~> 2.1)
15
46
  - FlutterMacOS (1.0.0)
47
+ - GoogleDataTransport (9.2.5):
48
+ - GoogleUtilities/Environment (~> 7.7)
49
+ - nanopb (< 2.30910.0, >= 2.30908.0)
50
+ - PromisesObjC (< 3.0, >= 1.2)
16
51
  - GoogleUtilities/Environment (7.11.5):
17
52
  - PromisesObjC (< 3.0, >= 1.2)
18
53
  - GoogleUtilities/Logger (7.11.5):
19
54
  - GoogleUtilities/Environment
20
55
  - "GoogleUtilities/NSData+zlib (7.11.5)"
56
+ - GoogleUtilities/UserDefaults (7.11.5):
57
+ - GoogleUtilities/Logger
21
58
  - just_audio (0.0.1):
22
59
  - FlutterMacOS
60
+ - nanopb (2.30909.0):
61
+ - nanopb/decode (= 2.30909.0)
62
+ - nanopb/encode (= 2.30909.0)
63
+ - nanopb/decode (2.30909.0)
64
+ - nanopb/encode (2.30909.0)
23
65
  - path_provider_foundation (0.0.1):
24
66
  - Flutter
25
67
  - FlutterMacOS
26
68
  - PromisesObjC (2.3.1)
69
+ - PromisesSwift (2.3.1):
70
+ - PromisesObjC (= 2.3.1)
27
71
  - shared_preferences_foundation (0.0.1):
28
72
  - Flutter
29
73
  - FlutterMacOS
@@ -31,6 +75,7 @@ PODS:
31
75
  DEPENDENCIES:
32
76
  - audio_session (from `Flutter/ephemeral/.symlinks/plugins/audio_session/macos`)
33
77
  - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`)
78
+ - firebase_crashlytics (from `Flutter/ephemeral/.symlinks/plugins/firebase_crashlytics/macos`)
34
79
  - FlutterMacOS (from `Flutter/ephemeral`)
35
80
  - just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`)
36
81
  - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
@@ -40,15 +85,24 @@ SPEC REPOS:
40
85
  trunk:
41
86
  - Firebase
42
87
  - FirebaseCore
88
+ - FirebaseCoreExtension
43
89
  - FirebaseCoreInternal
90
+ - FirebaseCrashlytics
91
+ - FirebaseInstallations
92
+ - FirebaseSessions
93
+ - GoogleDataTransport
44
94
  - GoogleUtilities
95
+ - nanopb
45
96
  - PromisesObjC
97
+ - PromisesSwift
46
98
 
47
99
  EXTERNAL SOURCES:
48
100
  audio_session:
49
101
  :path: Flutter/ephemeral/.symlinks/plugins/audio_session/macos
50
102
  firebase_core:
51
103
  :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos
104
+ firebase_crashlytics:
105
+ :path: Flutter/ephemeral/.symlinks/plugins/firebase_crashlytics/macos
52
106
  FlutterMacOS:
53
107
  :path: Flutter/ephemeral
54
108
  just_audio:
@@ -62,13 +116,21 @@ SPEC CHECKSUMS:
62
116
  audio_session: dea1f41890dbf1718f04a56f1d6150fd50039b72
63
117
  Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
64
118
  firebase_core: ff59797157ca9adda4440071643761b41fcd03b3
119
+ firebase_crashlytics: 223f1e85437fa85822439e51db3cd0be7dd35b23
65
120
  FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
121
+ FirebaseCoreExtension: ce60f9db46d83944cf444664d6d587474128eeca
66
122
  FirebaseCoreInternal: b342e37cd4f5b4454ec34308f073420e7920858e
123
+ FirebaseCrashlytics: c4d111b7430c49744c74bcc6346ea00868661ac8
124
+ FirebaseInstallations: b28af1b9f997f1a799efe818c94695a3728c352f
125
+ FirebaseSessions: 991fb4c20b3505eef125f7cbfa20a5b5b189c2a4
67
126
  FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
127
+ GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
68
128
  GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
69
129
  just_audio: 9b67ca7b97c61cfc9784ea23cd8cc55eb226d489
130
+ nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
70
131
  path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
71
132
  PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
133
+ PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265
72
134
  shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
73
135
 
74
136
  PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
macos/Runner.xcodeproj/project.pbxproj CHANGED
@@ -70,7 +70,7 @@
70
70
  331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
71
71
  333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
72
72
  335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
73
- 33CC10ED2044A3C60003C045 /* only_bible_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = only_bible_app.app; sourceTree = BUILT_PRODUCTS_DIR; };
73
+ 33CC10ED2044A3C60003C045 /* Only Bible App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Only Bible App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
74
74
  33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
75
75
  33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
76
76
  33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -147,7 +147,7 @@
147
147
  33CC10EE2044A3C60003C045 /* Products */ = {
148
148
  isa = PBXGroup;
149
149
  children = (
150
- 33CC10ED2044A3C60003C045 /* only_bible_app.app */,
150
+ 33CC10ED2044A3C60003C045 /* Only Bible App.app */,
151
151
  331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
152
152
  );
153
153
  name = Products;
@@ -243,6 +243,7 @@
243
243
  33CC110E2044A8840003C045 /* Bundle Framework */,
244
244
  3399D490228B24CF009A79C7 /* ShellScript */,
245
245
  492DE6FEE85F5F00ADEF999B /* [CP] Embed Pods Frameworks */,
246
+ F9ECD1765CB1E0BD76412733 /* [firebase_crashlytics] Crashlytics Upload Symbols */,
246
247
  );
247
248
  buildRules = (
248
249
  );
@@ -251,7 +252,7 @@
251
252
  );
252
253
  name = Runner;
253
254
  productName = Runner;
254
- productReference = 33CC10ED2044A3C60003C045 /* only_bible_app.app */;
255
+ productReference = 33CC10ED2044A3C60003C045 /* Only Bible App.app */;
255
256
  productType = "com.apple.product-type.application";
256
257
  };
257
258
  /* End PBXNativeTarget section */
@@ -424,6 +425,26 @@
424
425
  shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
425
426
  showEnvVarsInLog = 0;
426
427
  };
428
+ F9ECD1765CB1E0BD76412733 /* [firebase_crashlytics] Crashlytics Upload Symbols */ = {
429
+ isa = PBXShellScriptBuildPhase;
430
+ buildActionMask = 2147483647;
431
+ files = (
432
+ );
433
+ inputFileListPaths = (
434
+ );
435
+ inputPaths = (
436
+ "\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"",
437
+ "\"$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)\"",
438
+ );
439
+ name = "[firebase_crashlytics] Crashlytics Upload Symbols";
440
+ outputFileListPaths = (
441
+ );
442
+ outputPaths = (
443
+ );
444
+ runOnlyForDeploymentPostprocessing = 0;
445
+ shellPath = /bin/sh;
446
+ shellScript = "\"$PODS_ROOT/FirebaseCrashlytics/upload-symbols\" --flutter-project \"$PROJECT_DIR/firebase_app_id_file.json\" ";
447
+ };
427
448
  /* End PBXShellScriptBuildPhase section */
428
449
 
429
450
  /* Begin PBXSourcesBuildPhase section */
@@ -699,6 +720,7 @@
699
720
  CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
700
721
  CODE_SIGN_STYLE = Automatic;
701
722
  COMBINE_HIDPI_IMAGES = YES;
723
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
702
724
  INFOPLIST_FILE = Runner/Info.plist;
703
725
  LD_RUNPATH_SEARCH_PATHS = (
704
726
  "$(inherited)",
macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme CHANGED
@@ -15,7 +15,7 @@
15
15
  <BuildableReference
16
16
  BuildableIdentifier = "primary"
17
17
  BlueprintIdentifier = "33CC10EC2044A3C60003C045"
18
- BuildableName = "only_bible_app.app"
18
+ BuildableName = "Only Bible App.app"
19
19
  BlueprintName = "Runner"
20
20
  ReferencedContainer = "container:Runner.xcodeproj">
21
21
  </BuildableReference>
@@ -31,7 +31,7 @@
31
31
  <BuildableReference
32
32
  BuildableIdentifier = "primary"
33
33
  BlueprintIdentifier = "33CC10EC2044A3C60003C045"
34
- BuildableName = "only_bible_app.app"
34
+ BuildableName = "Only Bible App.app"
35
35
  BlueprintName = "Runner"
36
36
  ReferencedContainer = "container:Runner.xcodeproj">
37
37
  </BuildableReference>
@@ -65,7 +65,7 @@
65
65
  <BuildableReference
66
66
  BuildableIdentifier = "primary"
67
67
  BlueprintIdentifier = "33CC10EC2044A3C60003C045"
68
- BuildableName = "only_bible_app.app"
68
+ BuildableName = "Only Bible App.app"
69
69
  BlueprintName = "Runner"
70
70
  ReferencedContainer = "container:Runner.xcodeproj">
71
71
  </BuildableReference>
@@ -82,7 +82,7 @@
82
82
  <BuildableReference
83
83
  BuildableIdentifier = "primary"
84
84
  BlueprintIdentifier = "33CC10EC2044A3C60003C045"
85
- BuildableName = "only_bible_app.app"
85
+ BuildableName = "Only Bible App.app"
86
86
  BlueprintName = "Runner"
87
87
  ReferencedContainer = "container:Runner.xcodeproj">
88
88
  </BuildableReference>
macos/Runner/Configs/AppInfo.xcconfig CHANGED
@@ -5,7 +5,7 @@
5
5
  // 'flutter create' template.
6
6
 
7
7
  // The application's name. By default this is also the title of the Flutter window.
8
- PRODUCT_NAME = only_bible_app
8
+ PRODUCT_NAME = Only Bible App
9
9
 
10
10
  // The application's bundle identifier
11
11
  PRODUCT_BUNDLE_IDENTIFIER = sh.pyros.onlyBibleApp
pubspec.lock CHANGED
@@ -9,6 +9,14 @@ packages:
9
9
  url: "https://pub.dev"
10
10
  source: hosted
11
11
  version: "63.0.0"
12
+ _flutterfire_internals:
13
+ dependency: transitive
14
+ description:
15
+ name: _flutterfire_internals
16
+ sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8"
17
+ url: "https://pub.dev"
18
+ source: hosted
19
+ version: "1.3.4"
12
20
  analyzer:
13
21
  dependency: transitive
14
22
  description:
@@ -265,6 +273,22 @@ packages:
265
273
  url: "https://pub.dev"
266
274
  source: hosted
267
275
  version: "2.6.0"
276
+ firebase_crashlytics:
277
+ dependency: "direct main"
278
+ description:
279
+ name: firebase_crashlytics
280
+ sha256: "3607b46342537f98df18b130b6f5ab25cee6981a3a782e1a7b121d04dfea3caa"
281
+ url: "https://pub.dev"
282
+ source: hosted
283
+ version: "3.3.4"
284
+ firebase_crashlytics_platform_interface:
285
+ dependency: transitive
286
+ description:
287
+ name: firebase_crashlytics_platform_interface
288
+ sha256: c63abeb87b18f6e6d4bf6bb3977f15d2d9281a049d93fe098e83e56dcbf7da06
289
+ url: "https://pub.dev"
290
+ source: hosted
291
+ version: "3.6.4"
268
292
  fixnum:
269
293
  dependency: transitive
270
294
  description:
pubspec.yaml CHANGED
@@ -20,7 +20,7 @@ dependencies:
20
20
  cupertino_icons: ^1.0.5
21
21
  firebase_core: ^2.15.0
22
22
  provider: ^6.0.5
23
- # firebase_crashlytics: ^3.3.4
23
+ firebase_crashlytics: ^3.3.4
24
24
  # firebase_performance: ^0.9.2+4
25
25
 
26
26
  dev_dependencies: