feat: can't use return button and exit callpage during call
All checks were successful
/ mirror (push) Successful in 4s
/ build (push) Successful in 9m59s
/ build-stealth (push) Successful in 9m59s

This commit is contained in:
Florian Griffon 2025-04-30 00:16:31 +03:00
parent ce7a5b10b0
commit a80b6da426

View File

@ -226,7 +226,10 @@ class _CallPageState extends State<CallPage> {
print(
'CallPage: Building UI, _callStatus: $_callStatus, route: ${ModalRoute.of(context)?.settings.name ?? "unknown"}');
return Scaffold(
return PopScope(
canPop:
_callStatus == "Call Ended", // Allow navigation only if call ended
child: Scaffold(
body: Container(
color: Colors.black,
child: SafeArea(
@ -251,14 +254,16 @@ class _CallPageState extends State<CallPage> {
children: [
Icon(
icingProtocolOk ? Icons.lock : Icons.lock_open,
color: icingProtocolOk ? Colors.green : Colors.red,
color:
icingProtocolOk ? Colors.green : Colors.red,
size: 16,
),
const SizedBox(width: 4),
Text(
'Icing protocol: ${icingProtocolOk ? "ok" : "ko"}',
style: TextStyle(
color: icingProtocolOk ? Colors.green : Colors.red,
color:
icingProtocolOk ? Colors.green : Colors.red,
fontSize: 12,
fontWeight: FontWeight.bold,
),
@ -293,7 +298,8 @@ class _CallPageState extends State<CallPage> {
if (isKeypadVisible) ...[
const Spacer(flex: 2),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
padding:
const EdgeInsets.symmetric(horizontal: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -313,8 +319,8 @@ class _CallPageState extends State<CallPage> {
IconButton(
padding: EdgeInsets.zero,
onPressed: _toggleKeypad,
icon:
const Icon(Icons.close, color: Colors.white),
icon: const Icon(Icons.close,
color: Colors.white),
),
],
),
@ -363,12 +369,14 @@ class _CallPageState extends State<CallPage> {
] else ...[
const Spacer(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32.0),
padding:
const EdgeInsets.symmetric(horizontal: 32.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
Column(
mainAxisSize: MainAxisSize.min,
@ -386,7 +394,8 @@ class _CallPageState extends State<CallPage> {
Text(
isMuted ? 'Unmute' : 'Mute',
style: const TextStyle(
color: Colors.white, fontSize: 14),
color: Colors.white,
fontSize: 14),
),
],
),
@ -404,7 +413,8 @@ class _CallPageState extends State<CallPage> {
const Text(
'Keypad',
style: TextStyle(
color: Colors.white, fontSize: 14),
color: Colors.white,
fontSize: 14),
),
],
),
@ -426,7 +436,8 @@ class _CallPageState extends State<CallPage> {
const Text(
'Speaker',
style: TextStyle(
color: Colors.white, fontSize: 14),
color: Colors.white,
fontSize: 14),
),
],
),
@ -434,7 +445,8 @@ class _CallPageState extends State<CallPage> {
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
if (isNumberUnknown)
Column(
@ -451,7 +463,8 @@ class _CallPageState extends State<CallPage> {
const Text(
'Add Contact',
style: TextStyle(
color: Colors.white, fontSize: 14),
color: Colors.white,
fontSize: 14),
),
],
),
@ -469,7 +482,8 @@ class _CallPageState extends State<CallPage> {
const Text(
'Change SIM',
style: TextStyle(
color: Colors.white, fontSize: 14),
color: Colors.white,
fontSize: 14),
),
],
),
@ -505,6 +519,6 @@ class _CallPageState extends State<CallPage> {
),
),
),
);
));
}
}