From 3b6a6fb66668a68ceec9811031b5206a8e594183 Mon Sep 17 00:00:00 2001 From: Anand kumar Date: Thu, 11 Jan 2024 19:48:36 +0530 Subject: [PATCH] wrap up --- lib/services/downloader.dart | 1 + lib/ui/screens/Home/home_screen.dart | 21 +++++++++---------- .../screens/Home/home_screen_controller.dart | 1 + .../Settings/settings_screen_controller.dart | 1 + .../widgets/animated_screen_transition.dart | 5 +++-- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/services/downloader.dart b/lib/services/downloader.dart index b72958c3..2c81d831 100644 --- a/lib/services/downloader.dart +++ b/lib/services/downloader.dart @@ -176,6 +176,7 @@ class Downloader extends GetxService { final thumbnailPath = "${settingsScreenController.supportDirPath}/thumbnails/${song.id}.png"; await Dio().downloadUri(song.artUri!, thumbnailPath); + // ignore: empty_catches } catch (e) {} Hive.box("SongDownloads").put(song.id, songJson); diff --git a/lib/ui/screens/Home/home_screen.dart b/lib/ui/screens/Home/home_screen.dart index 5bf71a4d..51ce1b16 100644 --- a/lib/ui/screens/Home/home_screen.dart +++ b/lib/ui/screens/Home/home_screen.dart @@ -28,8 +28,9 @@ class HomeScreen extends StatelessWidget { return Scaffold( floatingActionButton: Obx( - () => homeScreenController.tabIndex.value == 0 || - homeScreenController.tabIndex.value == 2 + () => (homeScreenController.tabIndex.value == 0 || + homeScreenController.tabIndex.value == 2) && + settingsScreenController.isBottomNavBarEnabled.isFalse ? Obx( () => Padding( padding: EdgeInsets.only( @@ -80,15 +81,13 @@ class HomeScreen extends StatelessWidget { //const VerticalDivider(thickness: 1, width: 2), Expanded( child: Obx(() => AnimatedScreenTransition( - resverse: homeScreenController.reverseAnimationtransiton, - horizontalTransition: settingsScreenController - .isBottomNavBarEnabled.isTrue, - child: Center( - key: ValueKey( - homeScreenController.tabIndex.value), - child: const Body(), - )) - ), + resverse: homeScreenController.reverseAnimationtransiton, + horizontalTransition: + settingsScreenController.isBottomNavBarEnabled.isTrue, + child: Center( + key: ValueKey(homeScreenController.tabIndex.value), + child: const Body(), + ))), ), ], ), diff --git a/lib/ui/screens/Home/home_screen_controller.dart b/lib/ui/screens/Home/home_screen_controller.dart index 326634fd..9fe1d8a0 100644 --- a/lib/ui/screens/Home/home_screen_controller.dart +++ b/lib/ui/screens/Home/home_screen_controller.dart @@ -153,6 +153,7 @@ class HomeScreenController extends GetxController { QuickPicks(List.from(value[0]["contents"])); Hive.box("AppPrefs").put("recentSongId", songId); } + // ignore: empty_catches } catch (e) {} } } diff --git a/lib/ui/screens/Settings/settings_screen_controller.dart b/lib/ui/screens/Settings/settings_screen_controller.dart index 3973cbbf..e4e91055 100644 --- a/lib/ui/screens/Settings/settings_screen_controller.dart +++ b/lib/ui/screens/Settings/settings_screen_controller.dart @@ -154,6 +154,7 @@ class SettingsScreenController extends GetxController { if (await tempImgDir.exists()) { await tempImgDir.delete(recursive: true); } + // ignore: empty_catches } catch (e) {} } diff --git a/lib/ui/widgets/animated_screen_transition.dart b/lib/ui/widgets/animated_screen_transition.dart index fb6d1a71..46fd9214 100644 --- a/lib/ui/widgets/animated_screen_transition.dart +++ b/lib/ui/widgets/animated_screen_transition.dart @@ -31,12 +31,13 @@ class AnimatedScreenTransition extends StatelessWidget { : Tween(begin: const Offset(0, -1), end: Offset.zero); } return PageTransitionSwitcher( - duration: const Duration(milliseconds: 450), + duration: horizontalTransition + ? const Duration(milliseconds: 400) + : const Duration(milliseconds: 450), transitionBuilder: (child, primaryAnimation, secondaryAnimation) { return DualTransitionBuilder( animation: primaryAnimation, forwardBuilder: (context, animation, child) => SlideTransition( - transformHitTests: true, position: forwardTween.animate(primaryAnimation), child: child, ),