diff --git a/lib/src/pages/base/base_page.dart b/lib/src/pages/base/base_page.dart index e181223b..ebf4c517 100644 --- a/lib/src/pages/base/base_page.dart +++ b/lib/src/pages/base/base_page.dart @@ -61,26 +61,28 @@ abstract class BasePageFlutterState extends State { } Widget buildList(BuildContext context) { - return GetBuilder( - id: logic.bodyId, - global: false, - init: logic, - builder: (_) => state.gallerys.isEmpty && state.loadingState != LoadingState.idle - ? buildCenterStatusIndicator() - : EHWheelSpeedController( - scrollController: state.scrollController, - child: CustomScrollView( - key: PageStorageKey(runtimeType), - controller: state.scrollController, - physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), - scrollBehavior: ScrollConfiguration.of(context), - slivers: [ - buildPullDownIndicator(), - buildGalleryCollection(), - buildLoadMoreIndicator(), - ], + return SafeArea( + child: GetBuilder( + id: logic.bodyId, + global: false, + init: logic, + builder: (_) => state.gallerys.isEmpty && state.loadingState != LoadingState.idle + ? buildCenterStatusIndicator() + : EHWheelSpeedController( + scrollController: state.scrollController, + child: CustomScrollView( + key: PageStorageKey(runtimeType), + controller: state.scrollController, + physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), + scrollBehavior: ScrollConfiguration.of(context), + slivers: [ + buildPullDownIndicator(), + buildGalleryCollection(), + buildLoadMoreIndicator(), + ], + ), ), - ), + ), ); } @@ -90,13 +92,11 @@ abstract class BasePageFlutterState extends State { id: logic.loadingStateId, global: false, init: logic, - builder: (logic) { - return LoadingStateIndicator( - loadingState: state.loadingState, - errorTapCallback: () => logic.loadMore(), - noDataTapCallback: () => logic.loadMore(), - ); - }), + builder: (_) => LoadingStateIndicator( + loadingState: state.loadingState, + errorTapCallback: () => logic.loadMore(), + noDataTapCallback: () => logic.loadMore(), + )), ); } diff --git a/lib/src/pages/layout/desktop/desktop_layout_page.dart b/lib/src/pages/layout/desktop/desktop_layout_page.dart index e1cf3b1e..bfc735bf 100644 --- a/lib/src/pages/layout/desktop/desktop_layout_page.dart +++ b/lib/src/pages/layout/desktop/desktop_layout_page.dart @@ -87,14 +87,14 @@ class DesktopLayoutPage extends StatelessWidget { state.leftColumnFocusScopeNode.requestFocus(); } }, - child: Container( - decoration: state.selectedTabIndex == index - ? BoxDecoration(border: Border(left: BorderSide(width: 4, color: Theme.of(context).appBarTheme.foregroundColor!))) - : null, - child: InkWell( - canRequestFocus: false, + child: GestureDetector( + onTap: () => logic.handleTapTabBarButton(index), + behavior: HitTestBehavior.opaque, + child: Container( + height: 36, + width: 48, + decoration: state.selectedTabIndex == index ? BoxDecoration(border: Border(left: BorderSide(width: 4, color: Theme.of(context).appBarTheme.foregroundColor!))) : null, child: state.selectedTabIndex == index ? state.icons[index].selectedIcon : state.icons[index].unselectedIcon, - onTap: () => logic.handleTapTabBarButton(index), ).paddingAll(8), ), ), diff --git a/lib/src/pages/search/simple/simple_search_page.dart b/lib/src/pages/search/simple/simple_search_page.dart index 46d09105..3db5a495 100644 --- a/lib/src/pages/search/simple/simple_search_page.dart +++ b/lib/src/pages/search/simple/simple_search_page.dart @@ -64,60 +64,57 @@ class _SimpleSearchPageFlutterState extends BasePageFlutterState { return GetBuilder( id: logic.pageId, builder: (_) => Scaffold( - body: Column( - children: [ - GetBuilder( - id: logic.searchFieldId, - builder: (_) => Container( - height: GlobalConfig.searchBarHeight, - margin: const EdgeInsets.only(top: 8, bottom: 8, left: 2, right: 2), - child: Row( - children: [ - Expanded(child: _buildSearchField().marginSymmetric(horizontal: 16)), - ExcludeFocus(child: IconButton(icon: const Icon(Icons.attach_file), onPressed: logic.handleFileSearch)), - if (state.gallerys.isNotEmpty && state.bodyType == SearchPageBodyType.gallerys) - ExcludeFocus( - child: FadeIn( - child: IconButton( - icon: const Icon(FontAwesomeIcons.paperPlane, size: 20), - onPressed: logic.handleTapJumpButton, + body: SafeArea( + child: Column( + children: [ + GetBuilder( + id: logic.searchFieldId, + builder: (_) => Container( + height: GlobalConfig.searchBarHeight, + margin: const EdgeInsets.only(top: 8, bottom: 8, left: 2, right: 2), + child: Row( + children: [ + Expanded(child: _buildSearchField().marginSymmetric(horizontal: 16)), + ExcludeFocus(child: IconButton(icon: const Icon(Icons.attach_file), onPressed: logic.handleFileSearch)), + if (state.gallerys.isNotEmpty && state.bodyType == SearchPageBodyType.gallerys) + ExcludeFocus( + child: FadeIn( + child: IconButton( + icon: const Icon(FontAwesomeIcons.paperPlane, size: 20), + onPressed: logic.handleTapJumpButton, + ), ), ), + ExcludeFocus( + child: IconButton( + icon: Icon(state.bodyType == SearchPageBodyType.gallerys ? Icons.update_disabled : Icons.history, size: 24), + onPressed: logic.toggleBodyType, + ), ), - ExcludeFocus( - child: IconButton( - icon: Icon(state.bodyType == SearchPageBodyType.gallerys ? Icons.update_disabled : Icons.history, size: 24), - onPressed: logic.toggleBodyType, - ), - ), - ExcludeFocus( + ExcludeFocus(child: IconButton(icon: const Icon(Icons.filter_alt), onPressed: () => logic.handleTapFilterButton(EHSearchConfigDialogType.filter))), + ExcludeFocus( child: IconButton( - icon: const Icon(Icons.filter_alt), onPressed: () => logic.handleTapFilterButton(EHSearchConfigDialogType.filter))), - ExcludeFocus( - child: IconButton( - icon: const Icon(Icons.add_circle_outline, size: 24), - onPressed: logic.addQuickSearch, + icon: const Icon(Icons.add_circle_outline, size: 24), + onPressed: logic.addQuickSearch, + ), ), - ), - ExcludeFocus( - child: IconButton( - icon: Icon( - FontAwesomeIcons.bars, - color: Get.theme.appBarTheme.actionsIconTheme?.color, - size: 20, + ExcludeFocus( + child: IconButton( + icon: Icon( + FontAwesomeIcons.bars, + color: Get.theme.appBarTheme.actionsIconTheme?.color, + size: 20, + ), + onPressed: () => toNamed(Routes.quickSearch), ), - onPressed: () => toNamed(Routes.quickSearch), ), - ), - ], + ], + ), ), ), - ), - if (state.bodyType == SearchPageBodyType.suggestionAndHistory) - Expanded(child: _buildSuggestionAndHistoryBody(context)) - else if (state.hasSearched) - Expanded(child: buildList(context)), - ], + if (state.bodyType == SearchPageBodyType.suggestionAndHistory) Expanded(child: _buildSuggestionAndHistoryBody(context)) else if (state.hasSearched) Expanded(child: buildList(context)), + ], + ), ), ), ); @@ -222,9 +219,7 @@ class _SimpleSearchPageFlutterState extends BasePageFlutterState { duration: const Duration(milliseconds: 500), child: ListTile( title: RichText(text: _highlightKeyword(context, '${tagData.namespace} : ${tagData.key}', false)), - subtitle: tagData.tagName == null - ? null - : RichText(text: _highlightKeyword(context, '${tagData.namespace.tr} : ${tagData.tagName}', true)), + subtitle: tagData.tagName == null ? null : RichText(text: _highlightKeyword(context, '${tagData.namespace.tr} : ${tagData.tagName}', true)), leading: const Icon(Icons.search), dense: true, minLeadingWidth: 20, diff --git a/lib/src/pages/setting/setting_page.dart b/lib/src/pages/setting/setting_page.dart index dd3f98a5..de551aed 100644 --- a/lib/src/pages/setting/setting_page.dart +++ b/lib/src/pages/setting/setting_page.dart @@ -53,7 +53,7 @@ class SettingPage extends StatelessWidget { title: Text('download'.tr), onTap: () => toNamed(Routes.settingPrefix + 'download'), ), - if (StyleSetting.actualLayoutMode.value == LayoutMode.desktop) + if (StyleSetting.actualLayoutMode.value == LayoutMode.desktop && GetPlatform.isDesktop) ListTile( leading: const Icon(Icons.mouse), title: Text('mouseWheel'.tr),