fix: click blank to show fab

This commit is contained in:
lollipopkit
2024-05-10 21:46:05 +08:00
parent 5bc28a0560
commit 6b5f98cb2d
2 changed files with 29 additions and 12 deletions

View File

@@ -57,6 +57,7 @@ class _ServerPageState extends State<ServerPage>
bool _useDoubleColumn = false;
final _scrollController = ScrollController();
final _autoHideKey = GlobalKey<AutoHideState>();
@override
void initState() {
@@ -97,14 +98,19 @@ class _ServerPageState extends State<ServerPage>
Widget _buildPortrait() {
return Scaffold(
appBar: _buildTagsSwitcher(Pros.server),
body: ListenableBuilder(
listenable: Stores.setting.textFactor.listenable(),
builder: (_, __) {
_updateTextScaler();
return _buildBody();
},
body: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _autoHideKey.currentState?.show(),
child: ListenableBuilder(
listenable: Stores.setting.textFactor.listenable(),
builder: (_, __) {
_updateTextScaler();
return _buildBody();
},
),
),
floatingActionButton: AutoHide(
key: _autoHideKey,
direction: AxisDirection.right,
controller: _scrollController,
child: FloatingActionButton(