mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
23 lines
634 B
Dart
23 lines
634 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:macos_window_utils/window_manipulator.dart';
|
|
|
|
double? _titlebarHeight;
|
|
|
|
class CustomAppBar extends AppBar implements PreferredSizeWidget {
|
|
CustomAppBar({
|
|
super.key,
|
|
super.title,
|
|
super.actions,
|
|
super.centerTitle,
|
|
super.leading,
|
|
super.backgroundColor,
|
|
}) : super(toolbarHeight: (_titlebarHeight ?? 0) + kToolbarHeight);
|
|
|
|
static Future<void> updateTitlebarHeight() async {
|
|
final newTitlebarHeight = await WindowManipulator.getTitlebarHeight();
|
|
if (_titlebarHeight != newTitlebarHeight) {
|
|
_titlebarHeight = newTitlebarHeight;
|
|
}
|
|
}
|
|
}
|