Files
flutter_server_box/lib/view/page/home/appbar.dart
lollipopkit🏳️‍⚧️ 4d8268c614 fix: ssh tab focus mgmt (#525)
Fixes #522
2024-08-11 22:36:52 +08:00

40 lines
856 B
Dart

part of 'home.dart';
final class _AppBar extends CustomAppBar {
final ValueNotifier<int> selectIndex;
final ValueNotifier<bool> landscape;
const _AppBar({
required this.selectIndex,
required this.landscape,
super.title,
super.actions,
super.centerTitle,
});
@override
Widget build(BuildContext context) {
final placeholder = SizedBox(
height: CustomAppBar.barHeight ?? 0 + MediaQuery.of(context).padding.top,
);
return selectIndex.listenVal(
(idx) {
if (idx == AppTab.ssh.index) {
return placeholder;
}
if (isDesktop) return super.build(context);
return ValBuilder(
listenable: landscape,
builder: (ls) {
if (ls) return placeholder;
return super.build(context);
},
);
},
);
}
}