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


dc5bbf55 pyrossh

2 years ago
Fix issues
lib/providers/app_provider.dart CHANGED
@@ -485,7 +485,7 @@ class AppProvider extends ChangeNotifier {
485
485
  log("Could not play audio", name: "play", error: (err.toString(), pathname));
486
486
  FirebaseCrashlytics.instance.recordFlutterError(FlutterErrorDetails(exception: (err.toString(), pathname)));
487
487
  if (context.mounted) {
488
- showError(context, context.l10n.audioError);
488
+ showError(context, context.l10nEvent.audioError);
489
489
  }
490
490
  return;
491
491
  } finally {
lib/sheets/actions_sheet.dart CHANGED
@@ -10,16 +10,15 @@ class ActionsSheet extends StatelessWidget {
10
10
  Widget build(BuildContext context) {
11
11
  final app = AppProvider.of(context);
12
12
  final bottom = isIOS() ? 20.0 : 0.0;
13
- final height = isIOS() ? 100.0 : 65.0;
14
13
  final iconColor = app.darkMode ? Colors.white.withOpacity(0.9) : Colors.black.withOpacity(0.9);
15
14
  final audioIcon = app.isPlaying ? Icons.pause_circle_outline : Icons.play_circle_outline;
16
15
  final audioEnabled = app.hasAudio(context);
17
16
  return Container(
18
- height: height,
17
+ height: context.actionsHeight,
19
18
  color: Theme.of(context).colorScheme.background,
20
19
  padding: EdgeInsets.only(left: 20, right: 20, bottom: bottom),
21
20
  child: Row(
22
- mainAxisAlignment: context.isWide ? MainAxisAlignment.spaceEvenly : MainAxisAlignment.spaceBetween,
21
+ mainAxisAlignment: context.isWide ? MainAxisAlignment.spaceEvenly : MainAxisAlignment.spaceAround,
23
22
  children: [
24
23
  IconButton(
25
24
  padding: EdgeInsets.zero,
@@ -37,7 +36,7 @@ class ActionsSheet extends StatelessWidget {
37
36
  if (audioEnabled) {
38
37
  context.appEvent.onPlay(context);
39
38
  } else {
40
- showError(context, context.l10n.audioNotAvailable);
39
+ showError(context, context.l10nEvent.audioNotAvailable);
41
40
  }
42
41
  },
43
42
  icon: Icon(audioIcon, size: 34, color: audioEnabled ? iconColor : Colors.grey),
lib/sheets/highlight_sheet.dart CHANGED
@@ -9,7 +9,6 @@ class HighlightSheet extends StatelessWidget {
9
9
  @override
10
10
  Widget build(BuildContext context) {
11
11
  final bottom = isIOS() ? 20.0 : 0.0;
12
- final height = isIOS() ? 100.0 : 65.0;
13
12
  final iconColor = context.app.darkMode ? Colors.white.withOpacity(0.9) : Colors.black.withOpacity(0.9);
14
13
  void onHighlight(int index) {
15
14
  final verses = context.appEvent.selectedVerses;
@@ -18,11 +17,11 @@ class HighlightSheet extends StatelessWidget {
18
17
  }
19
18
 
20
19
  return Container(
21
- height: height,
20
+ height: context.actionsHeight,
22
21
  color: context.theme.colorScheme.background,
23
22
  padding: EdgeInsets.only(left: 20, right: 20, bottom: bottom),
24
23
  child: Row(
25
- mainAxisAlignment: context.isWide ? MainAxisAlignment.spaceEvenly : MainAxisAlignment.spaceBetween,
24
+ mainAxisAlignment: context.isWide ? MainAxisAlignment.spaceEvenly : MainAxisAlignment.spaceAround,
26
25
  children: [
27
26
  IconButton(
28
27
  padding: EdgeInsets.zero,
lib/utils.dart CHANGED
@@ -21,6 +21,10 @@ extension AppContext on BuildContext {
21
21
  ? lookupAppLocalizations(const Locale("en"))
22
22
  : AppLocalizations.of(this)!;
23
23
 
24
+ AppLocalizations get l10nEvent => appEvent.engTitles && appEvent.locale.languageCode != "en"
25
+ ? lookupAppLocalizations(const Locale("en"))
26
+ : AppLocalizations.of(this)!;
27
+
24
28
  AppProvider get app => Provider.of(this, listen: true);
25
29
 
26
30
  AppProvider get appEvent => Provider.of(this, listen: false);
@@ -29,6 +33,16 @@ extension AppContext on BuildContext {
29
33
 
30
34
  ChapterProvider get chapterEvent => Provider.of(this, listen: false);
31
35
 
36
+ double get actionsHeight {
37
+ if (isIOS()) {
38
+ return 80.0;
39
+ }
40
+ if (isWide) {
41
+ return 60;
42
+ }
43
+ return 50.0;
44
+ }
45
+
32
46
  bool get isWide {
33
47
  if (defaultTargetPlatform == TargetPlatform.android || defaultTargetPlatform == TargetPlatform.iOS) {
34
48
  return false;
lib/widgets/highlight_button.dart CHANGED
@@ -17,7 +17,7 @@ class HighlightButton extends StatelessWidget {
17
17
  color: color.withOpacity(1),
18
18
  shape: BoxShape.circle,
19
19
  ),
20
- child: const SizedBox(width: 28, height: 28),
20
+ child: const SizedBox(width: 24, height: 24),
21
21
  ),
22
22
  );
23
23
  }