Preserve stock Navigator Back for native phone chat panes
This commit is contained in:
@@ -93,6 +93,7 @@ class ChatThreadView extends StatefulWidget {
|
||||
this.paneControls = const [],
|
||||
this.sidebarControl,
|
||||
this.showBackButton,
|
||||
this.useNativeBack = false,
|
||||
});
|
||||
|
||||
final ApiGateway gateway;
|
||||
@@ -103,6 +104,7 @@ class ChatThreadView extends StatefulWidget {
|
||||
final List<Widget> paneControls;
|
||||
final Widget? sidebarControl;
|
||||
final bool? showBackButton;
|
||||
final bool useNativeBack;
|
||||
|
||||
/// Sets the chat's shared colour (a palette name, null for none) from the
|
||||
/// information sheet; null leaves the sheet without the Colour choice.
|
||||
@@ -1199,7 +1201,9 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
showBack: canGoBack,
|
||||
// A pushed page keeps the platform's stock Back (pop this route); a
|
||||
// standalone conversation calls its owner.
|
||||
onBack: widget.showBackButton == true
|
||||
onBack: widget.useNativeBack
|
||||
? null
|
||||
: widget.showBackButton == true
|
||||
? widget.onBack
|
||||
: (inShellBar ? null : widget.onBack),
|
||||
// Each control is its own action, so each pops in (and sinks) on its
|
||||
|
||||
@@ -432,6 +432,7 @@ class _ChatScreenState extends State<ChatScreen> with _ChatScreenWorkspace {
|
||||
onNextChat: _nextAfter(selected) != null
|
||||
? () => _openNext(selected)
|
||||
: null,
|
||||
useNativeBack: _page.open,
|
||||
showBackButton: pane == null
|
||||
? null
|
||||
: _page.open || !showsListBesideDetail(context),
|
||||
|
||||
Reference in New Issue
Block a user