Files
flutter_server_box/lib/view/page/home/appbar.dart
2024-05-09 13:39:11 +08:00

36 lines
809 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 ValBuilder(
listenable: landscape,
builder: (ls) {
if (ls) return placeholder;
return ValBuilder(
listenable: selectIndex,
builder: (idx) {
if (idx == AppTab.ssh.index) return placeholder;
return super.build(context);
},
);
},
);
}
}