mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-23 08:34:39 +01:00
opt.: server tab navigation bar when landscape
This commit is contained in:
@@ -175,20 +175,19 @@ class _HomePageState extends State<HomePage>
|
||||
: ValBuilder(
|
||||
listenable: _isLandscape,
|
||||
builder: (ls) {
|
||||
if (ls) return const SizedBox();
|
||||
return ListenableBuilder(
|
||||
listenable: _selectIndex,
|
||||
builder: (_, __) => _buildBottomBar(),
|
||||
builder: (_, __) => _buildBottomBar(ls),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomBar() {
|
||||
Widget _buildBottomBar(bool ls) {
|
||||
return NavigationBar(
|
||||
selectedIndex: _selectIndex.value,
|
||||
height: kBottomNavigationBarHeight * 1.1,
|
||||
height: kBottomNavigationBarHeight * (ls ? 0.75 : 1.1),
|
||||
animationDuration: const Duration(milliseconds: 250),
|
||||
onDestinationSelected: (int index) {
|
||||
if (_selectIndex.value == index) return;
|
||||
@@ -203,7 +202,9 @@ class _HomePageState extends State<HomePage>
|
||||
_switchingPage = false;
|
||||
});
|
||||
},
|
||||
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
||||
labelBehavior: ls
|
||||
? NavigationDestinationLabelBehavior.alwaysHide
|
||||
: NavigationDestinationLabelBehavior.onlyShowSelected,
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: const Icon(BoxIcons.bx_server),
|
||||
|
||||
@@ -18,7 +18,7 @@ import 'package:toolbox/data/model/server/try_limiter.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/auto_hide_fab.dart';
|
||||
import 'package:toolbox/view/widget/auto_hide.dart';
|
||||
import 'package:toolbox/view/widget/percent_circle.dart';
|
||||
|
||||
import '../../../core/route.dart';
|
||||
@@ -101,7 +101,8 @@ class _ServerPageState extends State<ServerPage>
|
||||
return _buildBody();
|
||||
},
|
||||
),
|
||||
floatingActionButton: AutoHideFab(
|
||||
floatingActionButton: AutoHide(
|
||||
direction: AxisDirection.right,
|
||||
controller: _scrollController,
|
||||
child: FloatingActionButton(
|
||||
heroTag: 'addServer',
|
||||
|
||||
Reference in New Issue
Block a user