mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt.: redesigned settings page (#587)
This commit is contained in:
@@ -1,40 +1,20 @@
|
||||
part of 'home.dart';
|
||||
|
||||
final class _AppBar extends CustomAppBar {
|
||||
final ValueNotifier<int> selectIndex;
|
||||
final ValueNotifier<bool> landscape;
|
||||
final class _AppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final double paddingTop;
|
||||
|
||||
const _AppBar({
|
||||
required this.selectIndex,
|
||||
required this.landscape,
|
||||
super.title,
|
||||
super.actions,
|
||||
super.centerTitle,
|
||||
});
|
||||
const _AppBar(this.paddingTop);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final placeholder = SizedBox(
|
||||
height: CustomAppBar.sysStatusBarHeight ??
|
||||
0 + MediaQuery.of(context).padding.top,
|
||||
);
|
||||
return selectIndex.listenVal(
|
||||
(idx) {
|
||||
if (isDesktop) return super.build(context);
|
||||
|
||||
if (idx == AppTab.ssh.index) {
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
return ValBuilder(
|
||||
listenable: landscape,
|
||||
builder: (ls) {
|
||||
if (ls) return placeholder;
|
||||
|
||||
return super.build(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
return SizedBox(
|
||||
height: paddingTop,
|
||||
child: isIOS
|
||||
? const Center(child: Text(BuildData.name, style: UIs.text15Bold))
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => Size.fromHeight(paddingTop);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user