Keep compact bar insets inside the floating chat window

This commit is contained in:
2026-11-10 13:37:16 +00:00
parent c944bcb55b
commit a33c8d6bbe
3 changed files with 31 additions and 1 deletions
+6
View File
@@ -44,6 +44,12 @@ class WindowMargins extends StatelessWidget {
context.dependOnInheritedWidgetOfExactType<_WindowMarginsScope>()?.wide ??
false;
/// Gives [child] the phone's margins inside a wide window: a small window
/// of its own (a floating chat) whose bars sit close to its frame. It
/// changes only the side inset; the window drops the top padding itself.
static Widget compact({required Widget child}) =>
_WindowMarginsScope(wide: false, child: child);
/// A top bar piece's distance from the sides at [context].
static double sideOf(BuildContext context) =>
wideOf(context) ? wideMargin : narrowSide;