From afc35fc2fbe3833f6e1e1c8c1e015daacfa4cbfb Mon Sep 17 00:00:00 2001 From: MSOB7YY Date: Fri, 27 Sep 2024 00:58:19 +0300 Subject: [PATCH] chore: smol ui change - refreshState instead of setState to always update info in channel subpage - show tooltip on tap when pressing volume bar while replay gain enabled --- lib/ui/pages/equalizer_page.dart | 2 ++ lib/ui/widgets/custom_widgets.dart | 3 +++ lib/youtube/pages/yt_channel_subpage.dart | 10 ++++------ pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/ui/pages/equalizer_page.dart b/lib/ui/pages/equalizer_page.dart index d5c63305..23c8408f 100644 --- a/lib/ui/pages/equalizer_page.dart +++ b/lib/ui/pages/equalizer_page.dart @@ -111,6 +111,7 @@ class EqualizerMainSlidersColumn extends StatelessWidget { ); return replayGainEnabled ? NamidaTooltip( + triggerMode: TooltipTriggerMode.tap, message: () => lang.NORMALIZE_AUDIO, child: AnimatedEnabled( enabled: !replayGainEnabled, @@ -135,6 +136,7 @@ class EqualizerMainSlidersColumn extends StatelessWidget { ); return replayGainEnabled ? NamidaTooltip( + triggerMode: TooltipTriggerMode.tap, message: () => lang.NORMALIZE_AUDIO, child: AnimatedEnabled( enabled: !replayGainEnabled, diff --git a/lib/ui/widgets/custom_widgets.dart b/lib/ui/widgets/custom_widgets.dart index 8a9672ad..8d58f714 100644 --- a/lib/ui/widgets/custom_widgets.dart +++ b/lib/ui/widgets/custom_widgets.dart @@ -3110,12 +3110,14 @@ class NamidaHero extends StatelessWidget { class NamidaTooltip extends StatelessWidget { final String Function()? message; final bool? preferBelow; + final TooltipTriggerMode? triggerMode; final Widget child; const NamidaTooltip({ super.key, required this.message, this.preferBelow, + this.triggerMode, required this.child, }); @@ -3125,6 +3127,7 @@ class NamidaTooltip extends StatelessWidget { return Tooltip( message: message, preferBelow: preferBelow, + triggerMode: triggerMode, child: child, ); } diff --git a/lib/youtube/pages/yt_channel_subpage.dart b/lib/youtube/pages/yt_channel_subpage.dart index 5e6ec5bd..5a1e54a2 100644 --- a/lib/youtube/pages/yt_channel_subpage.dart +++ b/lib/youtube/pages/yt_channel_subpage.dart @@ -176,12 +176,10 @@ class _YTChannelSubpageState extends State with TickerProvider if (value != null) { _channelInfoSubButton.value = value; final tabToBeSelected = _setTabsData(value); - if (mounted) { - setState(() { - if (_tabIndex == 0 && tabToBeSelected != null) _tabIndex = tabToBeSelected; // only set if tab wasnt changed - _channelInfo = value; - }); - } + refreshState(() { + if (_tabIndex == 0 && tabToBeSelected != null) _tabIndex = tabToBeSelected; // only set if tab wasnt changed + _channelInfo = value; + }); onRefresh(() => _fetchCurrentTab(value, forceRequest: true), forceProceed: true); } }, diff --git a/pubspec.yaml b/pubspec.yaml index 4b77144a..4c47590d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: namida description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter publish_to: "none" -version: 4.4.78-beta+240926211 +version: 4.4.79-beta+240926219 environment: sdk: ">=3.4.0 <4.0.0"