From 4a3cc0acc7ada8569b56180ade3b829d72cf1719 Mon Sep 17 00:00:00 2001 From: Predidit <34627277+Predidit@users.noreply.github.com> Date: Tue, 28 May 2024 10:26:01 +0800 Subject: [PATCH] better popular page --- lib/pages/popular/popular_page.dart | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/pages/popular/popular_page.dart b/lib/pages/popular/popular_page.dart index 5198db38..3a9b5dea 100644 --- a/lib/pages/popular/popular_page.dart +++ b/lib/pages/popular/popular_page.dart @@ -126,6 +126,7 @@ class _PopularPageState extends State popularController .queryBangumi(popularController.searchKeyword); } else { + popularController.searchKeyword = ''; popularController.queryBangumiListFeed(); } }, @@ -191,13 +192,22 @@ class _PopularPageState extends State })), ], ), - floatingActionButton: FloatingActionButton( - onPressed: () { - scrollController.jumpTo(0.0); - popularController.scrollOffset = 0.0; - }, - child: const Icon(Icons.arrow_upward), - ), + floatingActionButton: (Platform.isAndroid || Platform.isIOS) + ? FloatingActionButton( + onPressed: () { + scrollController.jumpTo(0.0); + popularController.scrollOffset = 0.0; + }, + child: const Icon(Icons.arrow_upward), + ) + : FloatingActionButton( + onPressed: () { + _controller.clear(); + popularController.searchKeyword = ''; + popularController.queryBangumiListFeed(); + }, + child: const Icon(Icons.refresh), + ), // backgroundColor: themedata.colorScheme.primaryContainer, ), ),