feat(learn): the assistant's conversation a dialog on the desktop and in expanded windows (Todo's ADR 0033, D11)
- halkyon_ui's sheetShowsAsDialog says whether showAdaptiveSheet shows a dialog here, for a sheet of its own that can't go through it. - Learn's conversation, a half-height sheet dragged up, asks it: where sheets are dialogs it is a dialog up to 720 wide and as tall as the window, with no handle to drag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
c83f7c46ff
commit
4898d0a04a
1 changed files with 145 additions and 23 deletions
|
|
@ -28,7 +28,7 @@ Future<T?> showAdaptiveSheet<T>(
|
|||
required WidgetBuilder builder,
|
||||
bool swipeable = true,
|
||||
}) {
|
||||
if (!context.windowSize.isAtLeastExpanded && !_onDesktop) {
|
||||
if (!sheetShowsAsDialog(context)) {
|
||||
return showModalBottomSheet<T>(
|
||||
context: context,
|
||||
useRootNavigator: true,
|
||||
|
|
@ -63,6 +63,13 @@ Future<T?> showAdaptiveSheet<T>(
|
|||
);
|
||||
}
|
||||
|
||||
/// Whether [showAdaptiveSheet] shows a sheet as a dialog here: from
|
||||
/// expanded windows on, and on the desktop at every width. For a sheet of
|
||||
/// its own that can't go through it (one dragged to its height, as Learn's
|
||||
/// conversation), so that it follows the same rule.
|
||||
bool sheetShowsAsDialog(BuildContext context) =>
|
||||
context.windowSize.isAtLeastExpanded || _onDesktop;
|
||||
|
||||
/// Whether the app runs on the desktop, where sheets are dialogs at every
|
||||
/// width.
|
||||
bool get _onDesktop => switch (defaultTargetPlatform) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue