From c0428e12c1006af20f60d36d313c3fe12a6c4115 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 7 Jan 2025 13:11:45 +0800 Subject: [PATCH] :bug: Fixed the drawer styling issue --- .../navigation/app_drawer_navigation.dart | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/widgets/navigation/app_drawer_navigation.dart b/lib/widgets/navigation/app_drawer_navigation.dart index 3585e1e..a71b935 100644 --- a/lib/widgets/navigation/app_drawer_navigation.dart +++ b/lib/widgets/navigation/app_drawer_navigation.dart @@ -1,9 +1,13 @@ +import 'dart:io'; + +import 'package:bitsdojo_window/bitsdojo_window.dart'; import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:provider/provider.dart'; -import 'package:responsive_framework/responsive_framework.dart'; import 'package:styled_widget/styled_widget.dart'; +import 'package:surface/providers/config.dart'; import 'package:surface/providers/navigation.dart'; import 'package:surface/widgets/version_label.dart'; @@ -28,8 +32,9 @@ class _AppNavigationDrawerState extends State { @override Widget build(BuildContext context) { final nav = context.watch(); + final cfg = context.watch(); - final backgroundColor = ResponsiveBreakpoints.of(context).largerThan(TABLET) ? Colors.transparent : null; + final backgroundColor = cfg.drawerIsExpanded ? Colors.transparent : null; return ListenableBuilder( listenable: nav, @@ -44,6 +49,18 @@ class _AppNavigationDrawerState extends State { backgroundColor: backgroundColor, selectedIndex: nav.currentIndex, children: [ + if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 1 / MediaQuery.of(context).devicePixelRatio, + ), + ), + ), + child: WindowTitleBarBox(), + ), Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,