From 36d9b57929a0c1077e86bb6c9a76bea03e9c90f7 Mon Sep 17 00:00:00 2001 From: Ghassen Ben Zahra Date: Fri, 5 Apr 2024 13:24:50 +0100 Subject: [PATCH 1/4] wip waiting feedback --- .../sub_screens/AfterSalahAzkarScreen.dart | 1 - .../home/sub_screens/DuaaEftarScreen.dart | 1 - .../sub_screens/IqamaaCountDownSubScreen.dart | 3 +- .../home/sub_screens/RandomHadithScreen.dart | 1 - .../home/sub_screens/fajr_wake_up_screen.dart | 1 - .../mini_horizontal_salah_item.dart | 1 + .../responsive_mini_salah_bar_widget.dart | 47 ++++++++++++++----- 7 files changed, 37 insertions(+), 18 deletions(-) diff --git a/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart b/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart index 3790caa38..7dca54788 100644 --- a/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart +++ b/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart @@ -86,7 +86,6 @@ class _AfterSalahAzkarState extends State { ), ), ResponsiveMiniSalahBarWidget(), - SizedBox(height: 10), ], ); } diff --git a/lib/src/pages/home/sub_screens/DuaaEftarScreen.dart b/lib/src/pages/home/sub_screens/DuaaEftarScreen.dart index 0fe901280..a1a0e690e 100644 --- a/lib/src/pages/home/sub_screens/DuaaEftarScreen.dart +++ b/lib/src/pages/home/sub_screens/DuaaEftarScreen.dart @@ -50,7 +50,6 @@ class _DuaaEftarScreenState extends State { ), ), ResponsiveMiniSalahBarWidget(), - SizedBox(height: 10), ], ); } diff --git a/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart b/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart index fde3ede81..acbac4bbd 100644 --- a/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart +++ b/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart @@ -115,7 +115,8 @@ class _IqamaaCountDownSubScreenState extends State { }), Spacer(), ResponsiveMiniSalahBarWidget(), - SizedBox(height: 10), + SizedBox(height: 1.vh), + ], ); } diff --git a/lib/src/pages/home/sub_screens/RandomHadithScreen.dart b/lib/src/pages/home/sub_screens/RandomHadithScreen.dart index bf61c5c3b..d840f11c3 100644 --- a/lib/src/pages/home/sub_screens/RandomHadithScreen.dart +++ b/lib/src/pages/home/sub_screens/RandomHadithScreen.dart @@ -57,7 +57,6 @@ class _RandomHadithScreenState extends State { ), ), ResponsiveMiniSalahBarWidget(), - SizedBox(height: 4.vh), ], ); } diff --git a/lib/src/pages/home/sub_screens/fajr_wake_up_screen.dart b/lib/src/pages/home/sub_screens/fajr_wake_up_screen.dart index f0f5c909c..d09222a2f 100644 --- a/lib/src/pages/home/sub_screens/fajr_wake_up_screen.dart +++ b/lib/src/pages/home/sub_screens/fajr_wake_up_screen.dart @@ -99,7 +99,6 @@ class _FajrWakeUpSubScreenState extends State { ), ), ResponsiveMiniSalahBarWidget(), - SizedBox(height: 2.vw), ], ), ); diff --git a/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart b/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart index b7f7e4d23..c91c723d6 100644 --- a/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart +++ b/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart @@ -66,6 +66,7 @@ class MiniHorizontalSalahItem extends StatelessWidget { color: Colors.white, ), ), + ], ), ), diff --git a/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart b/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart index f604cba1a..4796fb2d0 100644 --- a/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart +++ b/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart @@ -34,12 +34,17 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { final todayTimes = mosqueProvider.useTomorrowTimes ? times.dayTimesStrings(now.add(1.days), salahOnly: false) : times.dayTimesStrings(now, salahOnly: false); + final iqamas = mosqueProvider.times!.dayIqamaStrings(now); final turkishImask = todayTimes.length == 7 ? todayTimes.removeAt(0) : null; todayTimes.removeAt(1); + final isIqamaMoreImportant = + mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; /// on jumuaa we disable duhr highlight for mosques only - bool duhrHighlightDisable = mosqueProvider.mosqueDate().weekday == DateTime.friday && mosqueProvider.typeIsMosque; + bool duhrHighlightDisable = + mosqueProvider.mosqueDate().weekday == DateTime.friday && + mosqueProvider.typeIsMosque; return Padding( padding: EdgeInsets.symmetric(horizontal: 3.vw), @@ -47,16 +52,23 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ if (turkishImask != null) - SalahItemWidget(time: turkishImask) + SalahItemWidget( + removeBackground: true, + time: turkishImask, + isIqamaMoreImportant: isIqamaMoreImportant) .animate() .fadeIn(duration: _duration) .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) .addRepaintBoundary(), for (var i = 0; i < 5; i++) SalahItemWidget( - time: todayTimes[i], - active: i == 1 ? nextActiveIqama == i && !duhrHighlightDisable : nextActiveIqama == i, - ) + withDivider: false, + iqama: iqamas[i], + time: todayTimes[i], + active: i == 1 + ? nextActiveIqama == i && !duhrHighlightDisable + : nextActiveIqama == i, + isIqamaMoreImportant: isIqamaMoreImportant) .animate(delay: _step * (i + 1)) .fadeIn(duration: _duration) .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) @@ -76,16 +88,21 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { final todayTimes = mosqueProvider.useTomorrowTimes ? times.dayTimesStrings(now.add(1.days), salahOnly: false) : times.dayTimesStrings(now, salahOnly: false); - + final iqamas = mosqueProvider.times!.dayIqamaStrings(now); + final isIqamaMoreImportant = + mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; final turkishImask = todayTimes.length == 7 ? todayTimes.removeAt(0) : null; todayTimes.removeAt(1); /// on jumuaa we disable duhr highlight for mosques only - bool duhrHighlightDisable = AppDateTime.isFriday && mosqueProvider.typeIsMosque; + bool duhrHighlightDisable = + AppDateTime.isFriday && mosqueProvider.typeIsMosque; return Padding( padding: EdgeInsets.symmetric(horizontal: 1.vh), child: Wrap( + spacing: 5.vh, + runSpacing: 2.vw, crossAxisAlignment: WrapCrossAlignment.center, alignment: WrapAlignment.center, children: [ @@ -103,12 +120,15 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { ), for (var i = 0; i < 5; i++) SizedBox( - width: 30.vw, - child: MiniHorizontalSalahItem( - title: mosqueProvider.salahName(i), - time: todayTimes[i], - active: i == 1 ? nextActiveIqama == i && !duhrHighlightDisable : nextActiveIqama == i, - ) + width: 25.vw, + child: SalahItemWidget( + withDivider: false, + iqama: iqamas[i], + time: todayTimes[i], + active: i == 1 + ? nextActiveIqama == i && !duhrHighlightDisable + : nextActiveIqama == i, + isIqamaMoreImportant: isIqamaMoreImportant) .animate(delay: _step * (i + 1)) .fadeIn(duration: _duration) .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) @@ -116,6 +136,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { ), ], ), + ); } } From 4d998e92fb4a0ce8458af3e6ca07b4f235b83aac Mon Sep 17 00:00:00 2001 From: Ghassen Ben Zahra Date: Tue, 9 Apr 2024 20:10:51 +0100 Subject: [PATCH 2/4] working draft to further refactor --- .../sub_screens/IqamaaCountDownSubScreen.dart | 2 + .../home/widgets/salah_items/SalahItem.dart | 84 +++++++------ .../responsive_mini_salah_bar_widget.dart | 113 +++++++++++++----- 3 files changed, 123 insertions(+), 76 deletions(-) diff --git a/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart b/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart index acbac4bbd..511ea7bcc 100644 --- a/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart +++ b/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart @@ -89,6 +89,8 @@ class _IqamaaCountDownSubScreenState extends State { height: 1, ), ).animate().slide(delay: .5.seconds).fade().addRepaintBoundary(), + SizedBox(height: 1.vh), + StreamBuilder( stream: Stream.periodic(Duration(seconds: 1)), builder: (context, snapshot) { diff --git a/lib/src/pages/home/widgets/salah_items/SalahItem.dart b/lib/src/pages/home/widgets/salah_items/SalahItem.dart index 09c8dcbda..2630f9a4b 100644 --- a/lib/src/pages/home/widgets/salah_items/SalahItem.dart +++ b/lib/src/pages/home/widgets/salah_items/SalahItem.dart @@ -118,9 +118,9 @@ class SalahItemWidget extends StatelessOrientationWidget { @override Widget buildPortrait(BuildContext context) { - double titleFont = 3.vwr; - double bigFont = 3.5.vwr; - double smallFont = 2.6.vwr; + double titleFont = 3.5.vwr; + double bigFont = 4.vwr; + double smallFont = 3.vwr; final mosqueProvider = context.watch(); final mosqueConfig = mosqueProvider.mosqueConfig; @@ -138,10 +138,11 @@ class SalahItemWidget extends StatelessOrientationWidget { ? null : Colors.black.withOpacity(.5), ), - padding: EdgeInsets.symmetric(vertical: 1.6.vr, horizontal: 1.vwr), + padding: EdgeInsets.symmetric(vertical: 1.vr, horizontal: 1.vwr), child: FittedBox( fit: BoxFit.scaleDown, - child: Row( + child: Column( + mainAxisSize: MainAxisSize.min, children: [ if (title != null && title!.trim().isNotEmpty) Text( @@ -154,45 +155,40 @@ class SalahItemWidget extends StatelessOrientationWidget { height: 1.5, ), ), - SizedBox(width: 2.vr), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (time.trim().isEmpty) - Icon(Icons.dnd_forwardslash, size: 6.vwr) - else - TimeWidget.fromString( - show24hFormat: !is12period, - time: time, - style: TextStyle( - fontSize: isIqamaMoreImportant ? smallFont : bigFont, - fontWeight: FontWeight.w700, - shadows: kHomeTextShadow, - color: Colors.white, - // fontFamily: StringManager.getFontFamily(context), - ), - ), - if (iqama != null && showIqama) - SizedBox( - height: isArabic ? 1.5.vr : 1.3.vwr, - child: Divider( - thickness: 1, - color: withDivider ? Colors.white : Colors.transparent, - ), - ), - if (iqama != null && showIqama) - TimeWidget.fromString( - show24hFormat: !is12period, - time: iqama!, - style: TextStyle( - fontSize: isIqamaMoreImportant ? bigFont : smallFont, - fontWeight: FontWeight.bold, - shadows: kHomeTextShadow, - letterSpacing: 1, - color: Colors.white, - ), - ), - ], + SizedBox(height: 1.vh), + if (time.trim().isEmpty) + Icon(Icons.dnd_forwardslash, size: 6.vwr) + else + TimeWidget.fromString( + show24hFormat: !is12period, + time: time, + style: TextStyle( + fontSize: isIqamaMoreImportant ? smallFont : bigFont, + fontWeight: FontWeight.w700, + shadows: kHomeTextShadow, + color: Colors.white, + // fontFamily: StringManager.getFontFamily(context), + ), + ), + if (iqama != null && showIqama) + SizedBox( + height: isArabic ? 1.5.vr : 1.3.vwr, + child: Divider( + thickness: 1, + color: withDivider ? Colors.white : Colors.transparent, + ), + ), + if (iqama != null && showIqama) + TimeWidget.fromString( + show24hFormat: !is12period, + time: iqama!, + style: TextStyle( + fontSize: isIqamaMoreImportant ? bigFont : smallFont, + fontWeight: FontWeight.bold, + shadows: kHomeTextShadow, + letterSpacing: 1, + color: Colors.white, + ), ), ], ), diff --git a/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart b/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart index 4796fb2d0..d32f8082d 100644 --- a/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart +++ b/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart @@ -78,7 +78,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { ); } - @override +@override Widget buildPortrait(BuildContext context) { final mosqueProvider = context.watch(); final nextActiveIqama = activeItem ?? mosqueProvider.nextIqamaIndex(); @@ -92,11 +92,34 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { final isIqamaMoreImportant = mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; final turkishImask = todayTimes.length == 7 ? todayTimes.removeAt(0) : null; - todayTimes.removeAt(1); + todayTimes.removeAt(0); // Remove the first element (Fajr) - /// on jumuaa we disable duhr highlight for mosques only - bool duhrHighlightDisable = - AppDateTime.isFriday && mosqueProvider.typeIsMosque; + // Helper function to generate SalahItemWidget + Widget buildSalahItemWidget({ + required String title, + required String time, + required String iqama, + required bool active, + }) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: SizedBox( + width: MediaQuery.of(context).size.width / 4, + height: 60.0, + child: SalahItemWidget( + title: title, + time: time, + iqama: iqama, + active: active, + isIqamaMoreImportant: isIqamaMoreImportant, + ) + .animate() + .fadeIn(duration: _duration) + .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) + .addRepaintBoundary(), + ), + ); + } return Padding( padding: EdgeInsets.symmetric(horizontal: 1.vh), @@ -106,37 +129,63 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { crossAxisAlignment: WrapCrossAlignment.center, alignment: WrapAlignment.center, children: [ - if (turkishImask != null) - SizedBox( - width: 30.vw, - child: MiniHorizontalSalahItem( + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (turkishImask != null) + buildSalahItemWidget( title: S.of(context).imsak, - time: turkishImask, - ) - .animate() - .fadeIn(duration: _duration) - .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) - .addRepaintBoundary(), - ), - for (var i = 0; i < 5; i++) - SizedBox( - width: 25.vw, - child: SalahItemWidget( - withDivider: false, - iqama: iqamas[i], - time: todayTimes[i], - active: i == 1 - ? nextActiveIqama == i && !duhrHighlightDisable - : nextActiveIqama == i, - isIqamaMoreImportant: isIqamaMoreImportant) - .animate(delay: _step * (i + 1)) - .fadeIn(duration: _duration) - .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) - .addRepaintBoundary(), + time: todayTimes[0], + iqama: iqamas[0], + active: nextActiveIqama == 0, + ), + for (int index = 0; + index < (turkishImask != null ? 2 : 3); + index++) + buildSalahItemWidget( + title: mosqueProvider.salahName(index), + time: todayTimes[index], + iqama: iqamas[index], + active: index == 1 + ? nextActiveIqama == index + : nextActiveIqama == index, + ), + ], + ), + if (turkishImask != null) + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate( + 3, + (index) => buildSalahItemWidget( + title: mosqueProvider.salahName(index + 2), + time: todayTimes[index + 2], + iqama: iqamas[index + 2], + active: (index + 2) == 1 + ? nextActiveIqama == (index + 2) + : nextActiveIqama == (index + 2), + ), + ), + ) + else + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate( + 2, + (index) => buildSalahItemWidget( + title: mosqueProvider.salahName(index + 3), + time: todayTimes[index + 3], + iqama: iqamas[index + 3], + active: (index + 3) == 1 + ? nextActiveIqama == (index + 3) + : nextActiveIqama == (index + 3), + ), + ), ), ], ), - ); } + + } From 462664c04543055a2b066a74f9779b601f4b0e86 Mon Sep 17 00:00:00 2001 From: Ghassen Ben Zahra Date: Tue, 9 Apr 2024 20:42:15 +0100 Subject: [PATCH 3/4] add bottom margin --- lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart | 2 ++ lib/src/pages/home/sub_screens/RandomHadithScreen.dart | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart b/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart index 7dca54788..11689f549 100644 --- a/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart +++ b/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart @@ -86,6 +86,8 @@ class _AfterSalahAzkarState extends State { ), ), ResponsiveMiniSalahBarWidget(), + SizedBox(height: 10), + ], ); } diff --git a/lib/src/pages/home/sub_screens/RandomHadithScreen.dart b/lib/src/pages/home/sub_screens/RandomHadithScreen.dart index d840f11c3..59e76d961 100644 --- a/lib/src/pages/home/sub_screens/RandomHadithScreen.dart +++ b/lib/src/pages/home/sub_screens/RandomHadithScreen.dart @@ -57,6 +57,8 @@ class _RandomHadithScreenState extends State { ), ), ResponsiveMiniSalahBarWidget(), + SizedBox(height: 10), + ], ); } From ec28e41485e36d6237d368a10b1fc01e18f5790e Mon Sep 17 00:00:00 2001 From: Yassin Nouh <70436855+YassinNouh21@users.noreply.github.com> Date: Sat, 13 Apr 2024 00:59:17 +0200 Subject: [PATCH 4/4] fix: format of files --- lib/src/pages/developer/DeveloperScreen.dart | 3 +- .../sub_screens/AfterSalahAzkarScreen.dart | 1 - .../sub_screens/IqamaaCountDownSubScreen.dart | 2 - .../home/sub_screens/RandomHadithScreen.dart | 1 - .../home/widgets/salah_items/SalahItem.dart | 2 +- .../mini_horizontal_salah_item.dart | 1 - .../responsive_mini_salah_bar_widget.dart | 41 +++++-------------- lib/src/services/mixins/audio_mixin.dart | 2 +- 8 files changed, 15 insertions(+), 38 deletions(-) diff --git a/lib/src/pages/developer/DeveloperScreen.dart b/lib/src/pages/developer/DeveloperScreen.dart index b90ed4987..8b68bf772 100644 --- a/lib/src/pages/developer/DeveloperScreen.dart +++ b/lib/src/pages/developer/DeveloperScreen.dart @@ -79,7 +79,7 @@ class _DeveloperScreenState extends State { walkThrowScreensSubscription?.cancel(); setState(() { walkThrowScreensSubscription = null; - forcedScreen = null; // clear the forcedScreen when canceling the walkthrough + forcedScreen = null; // clear the forcedScreen when canceling the walkthrough }); } @@ -109,6 +109,7 @@ class _DeveloperScreenState extends State { cancelWalkThrowScreens(); super.dispose(); } + @override Widget build(BuildContext context) { context.watch(); diff --git a/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart b/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart index 11689f549..3790caa38 100644 --- a/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart +++ b/lib/src/pages/home/sub_screens/AfterSalahAzkarScreen.dart @@ -87,7 +87,6 @@ class _AfterSalahAzkarState extends State { ), ResponsiveMiniSalahBarWidget(), SizedBox(height: 10), - ], ); } diff --git a/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart b/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart index 511ea7bcc..11e5b19c6 100644 --- a/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart +++ b/lib/src/pages/home/sub_screens/IqamaaCountDownSubScreen.dart @@ -90,7 +90,6 @@ class _IqamaaCountDownSubScreenState extends State { ), ).animate().slide(delay: .5.seconds).fade().addRepaintBoundary(), SizedBox(height: 1.vh), - StreamBuilder( stream: Stream.periodic(Duration(seconds: 1)), builder: (context, snapshot) { @@ -118,7 +117,6 @@ class _IqamaaCountDownSubScreenState extends State { Spacer(), ResponsiveMiniSalahBarWidget(), SizedBox(height: 1.vh), - ], ); } diff --git a/lib/src/pages/home/sub_screens/RandomHadithScreen.dart b/lib/src/pages/home/sub_screens/RandomHadithScreen.dart index 59e76d961..1310cda13 100644 --- a/lib/src/pages/home/sub_screens/RandomHadithScreen.dart +++ b/lib/src/pages/home/sub_screens/RandomHadithScreen.dart @@ -58,7 +58,6 @@ class _RandomHadithScreenState extends State { ), ResponsiveMiniSalahBarWidget(), SizedBox(height: 10), - ], ); } diff --git a/lib/src/pages/home/widgets/salah_items/SalahItem.dart b/lib/src/pages/home/widgets/salah_items/SalahItem.dart index 2630f9a4b..41567b358 100644 --- a/lib/src/pages/home/widgets/salah_items/SalahItem.dart +++ b/lib/src/pages/home/widgets/salah_items/SalahItem.dart @@ -189,7 +189,7 @@ class SalahItemWidget extends StatelessOrientationWidget { letterSpacing: 1, color: Colors.white, ), - ), + ), ], ), ), diff --git a/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart b/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart index c91c723d6..b7f7e4d23 100644 --- a/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart +++ b/lib/src/pages/home/widgets/salah_items/mini_horizontal_salah_item.dart @@ -66,7 +66,6 @@ class MiniHorizontalSalahItem extends StatelessWidget { color: Colors.white, ), ), - ], ), ), diff --git a/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart b/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart index d32f8082d..30a8a6507 100644 --- a/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart +++ b/lib/src/pages/home/widgets/salah_items/responsive_mini_salah_bar_widget.dart @@ -38,13 +38,10 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { final turkishImask = todayTimes.length == 7 ? todayTimes.removeAt(0) : null; todayTimes.removeAt(1); - final isIqamaMoreImportant = - mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; + final isIqamaMoreImportant = mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; /// on jumuaa we disable duhr highlight for mosques only - bool duhrHighlightDisable = - mosqueProvider.mosqueDate().weekday == DateTime.friday && - mosqueProvider.typeIsMosque; + bool duhrHighlightDisable = mosqueProvider.mosqueDate().weekday == DateTime.friday && mosqueProvider.typeIsMosque; return Padding( padding: EdgeInsets.symmetric(horizontal: 3.vw), @@ -52,10 +49,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ if (turkishImask != null) - SalahItemWidget( - removeBackground: true, - time: turkishImask, - isIqamaMoreImportant: isIqamaMoreImportant) + SalahItemWidget(removeBackground: true, time: turkishImask, isIqamaMoreImportant: isIqamaMoreImportant) .animate() .fadeIn(duration: _duration) .slideY(begin: 1, duration: _duration, curve: Curves.easeOut) @@ -65,9 +59,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { withDivider: false, iqama: iqamas[i], time: todayTimes[i], - active: i == 1 - ? nextActiveIqama == i && !duhrHighlightDisable - : nextActiveIqama == i, + active: i == 1 ? nextActiveIqama == i && !duhrHighlightDisable : nextActiveIqama == i, isIqamaMoreImportant: isIqamaMoreImportant) .animate(delay: _step * (i + 1)) .fadeIn(duration: _duration) @@ -78,7 +70,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { ); } -@override + @override Widget buildPortrait(BuildContext context) { final mosqueProvider = context.watch(); final nextActiveIqama = activeItem ?? mosqueProvider.nextIqamaIndex(); @@ -89,8 +81,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { ? times.dayTimesStrings(now.add(1.days), salahOnly: false) : times.dayTimesStrings(now, salahOnly: false); final iqamas = mosqueProvider.times!.dayIqamaStrings(now); - final isIqamaMoreImportant = - mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; + final isIqamaMoreImportant = mosqueProvider.mosqueConfig!.iqamaMoreImportant == true; final turkishImask = todayTimes.length == 7 ? todayTimes.removeAt(0) : null; todayTimes.removeAt(0); // Remove the first element (Fajr) @@ -134,21 +125,17 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { children: [ if (turkishImask != null) buildSalahItemWidget( - title: S.of(context).imsak, + title: S.of(context).imsak, time: todayTimes[0], iqama: iqamas[0], active: nextActiveIqama == 0, ), - for (int index = 0; - index < (turkishImask != null ? 2 : 3); - index++) + for (int index = 0; index < (turkishImask != null ? 2 : 3); index++) buildSalahItemWidget( title: mosqueProvider.salahName(index), time: todayTimes[index], iqama: iqamas[index], - active: index == 1 - ? nextActiveIqama == index - : nextActiveIqama == index, + active: index == 1 ? nextActiveIqama == index : nextActiveIqama == index, ), ], ), @@ -161,9 +148,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { title: mosqueProvider.salahName(index + 2), time: todayTimes[index + 2], iqama: iqamas[index + 2], - active: (index + 2) == 1 - ? nextActiveIqama == (index + 2) - : nextActiveIqama == (index + 2), + active: (index + 2) == 1 ? nextActiveIqama == (index + 2) : nextActiveIqama == (index + 2), ), ), ) @@ -176,9 +161,7 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { title: mosqueProvider.salahName(index + 3), time: todayTimes[index + 3], iqama: iqamas[index + 3], - active: (index + 3) == 1 - ? nextActiveIqama == (index + 3) - : nextActiveIqama == (index + 3), + active: (index + 3) == 1 ? nextActiveIqama == (index + 3) : nextActiveIqama == (index + 3), ), ), ), @@ -186,6 +169,4 @@ class ResponsiveMiniSalahBarWidget extends StatelessOrientationWidget { ), ); } - - } diff --git a/lib/src/services/mixins/audio_mixin.dart b/lib/src/services/mixins/audio_mixin.dart index 031e06f3d..9287fd309 100644 --- a/lib/src/services/mixins/audio_mixin.dart +++ b/lib/src/services/mixins/audio_mixin.dart @@ -10,7 +10,7 @@ mixin AudioMixin on ChangeNotifier { String? adhanName = mosqueConfig?.adhanVoice; Duration duration = Duration(seconds: mosqueConfig!.adhanDuration!); - if(isFajrPray && adhanName != null){ + if (isFajrPray && adhanName != null) { adhanName = adhanName + '-fajr'; }