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