Merge commit '19b1d1326afb7902a5546bc47696547534c67de8' into pipelines/run-20261112-1907-phone-content-ends-above-the-bottom-tab-d4e2
This commit is contained in:
@@ -349,6 +349,8 @@ class _ChatScreenState extends State<ChatScreen>
|
||||
/// On a phone the open chat is a real page above the main screen.
|
||||
final DetailPageHost _page = DetailPageHost();
|
||||
|
||||
void _closeChat() => _page.open ? _page.close() : _back();
|
||||
|
||||
/// The list rows the phone's chat page grows from and shrinks back into:
|
||||
/// the open chat's row, also after the page switched to another chat.
|
||||
final ContainerTransformSources _rowSources = ContainerTransformSources();
|
||||
@@ -410,13 +412,15 @@ class _ChatScreenState extends State<ChatScreen>
|
||||
sessionId: selected,
|
||||
placement: ChatPanePlacement(
|
||||
syncToken: widget.syncToken,
|
||||
onBack: _back,
|
||||
// Back from a chat page pops that page itself (its completion runs
|
||||
// [_back]); otherwise it leaves the open chat directly. The button
|
||||
// never falls back to popping whichever route is nearest.
|
||||
onBack: _closeChat,
|
||||
onNewSession: _startedNewSession,
|
||||
onSessionClosed: () => _closed(selected),
|
||||
onNextChat: _nextAfter(selected) != null
|
||||
? () => _openNext(selected)
|
||||
: null,
|
||||
useNativeBack: _page.open,
|
||||
pasteTarget: _workspaceVisible && pane.id == _workspace.activePaneId,
|
||||
showBackButton: _page.open || !showsListBesideDetail(context),
|
||||
paneCommands: _paneCommands,
|
||||
|
||||
@@ -68,6 +68,21 @@ class DetailPageHost {
|
||||
}
|
||||
}
|
||||
|
||||
/// Closes the open page as its Back would: the page's own route is popped
|
||||
/// explicitly, never whichever route happens to be nearest a button, and
|
||||
/// its completion then clears the owner's selection.
|
||||
void close() {
|
||||
final route = _route;
|
||||
if (route == null || !route.isActive) return;
|
||||
final navigator = route.navigator;
|
||||
if (navigator == null) return;
|
||||
if (route.isCurrent) {
|
||||
navigator.pop();
|
||||
} else {
|
||||
navigator.removeRoute(route);
|
||||
}
|
||||
}
|
||||
|
||||
/// Removes the page with its owner.
|
||||
void dispose() {
|
||||
// The notifier is left to the page: a page still animating out keeps
|
||||
|
||||
Reference in New Issue
Block a user