refactor: deduplicate

This commit is contained in:
edde746
2025-12-07 15:00:28 +01:00
parent 223065cab0
commit d9ea099727
58 changed files with 3376 additions and 3061 deletions
+7 -6
View File
@@ -6,13 +6,11 @@ import '../services/fullscreen_state_manager.dart';
/// When present, app bars should skip their left padding since the side nav
/// already handles the macOS traffic lights area.
class SideNavigationScope extends InheritedWidget {
const SideNavigationScope({
super.key,
required super.child,
});
const SideNavigationScope({super.key, required super.child});
static bool isPresent(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<SideNavigationScope>() != null;
return context.dependOnInheritedWidgetOfExactType<SideNavigationScope>() !=
null;
}
@override
@@ -126,7 +124,10 @@ class DesktopAppBarHelper {
/// Calculates the leading width for SliverAppBar to account for macOS traffic lights
/// [context] - Required to check if side navigation is visible
static double? calculateLeadingWidth(Widget? leading, {BuildContext? context}) {
static double? calculateLeadingWidth(
Widget? leading, {
BuildContext? context,
}) {
if (!Platform.isMacOS || leading == null) {
return null;
}