Add iOS-style circular back button to terminal page

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-30 16:30:50 +00:00
parent 322225734a
commit a45a1954e7

View File

@@ -196,6 +196,8 @@ class _TerminalPageState extends State<TerminalPage>
),
),
if (_showTerminalExtraKeys) _buildFloatingKeyboard(),
// iOS-style circular back button in top-right corner
if (isIOS) _buildBackButton(),
],
),
);
@@ -246,6 +248,37 @@ class _TerminalPageState extends State<TerminalPage>
return scaffold;
}
Widget _buildBackButton() {
return Positioned(
top: 16, // iOS standard margin
right: 16, // iOS standard margin
child: SafeArea(
child: Container(
width: 44, // iOS standard tap target size
height: 44,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.5), // Half transparency
shape: BoxShape.circle,
),
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(22),
onTap: () {
clientClose(sessionId, _ffi);
},
child: Icon(
Icons.chevron_left, // iOS-style back arrow
color: Colors.white,
size: 28,
),
),
),
),
),
);
}
Widget _buildFloatingKeyboard() {
return AnimatedPositioned(
duration: const Duration(milliseconds: 200),