Files
flutter_server_box/lib/view/page/home/appbar.dart
lollipopkit🏳️‍⚧️ ddd32e82d4 opt.: migrate to new fl_lib (#649)
Fixes #648
2024-12-02 21:06:44 +08:00

27 lines
618 B
Dart

part of 'home.dart';
final class _AppBar extends StatelessWidget implements PreferredSizeWidget {
final double paddingTop;
const _AppBar(this.paddingTop);
@override
Widget build(BuildContext context) {
return SizedBox(
height: preferredSize.height,
child: isIOS
? const Center(child: Text(BuildData.name, style: UIs.text15Bold))
: null,
);
}
@override
Size get preferredSize {
final height = switch (Pfs.type) {
Pfs.macos => paddingTop + (CustomAppBar.sysStatusBarHeight ?? 0),
_ => paddingTop,
};
return Size.fromHeight(height);
}
}