fix: not showing call UI on long press
All checks were successful
/ mirror (push) Successful in 4s
/ build-stealth (push) Successful in 8m21s
/ build (push) Successful in 8m30s

This commit is contained in:
Florian Griffon 2025-03-14 15:59:54 +02:00
parent da0c5d1991
commit 0d6322a714

View File

@ -126,7 +126,9 @@ class _ContactModalState extends State<ContactModal> {
// Show success message
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('${_obfuscateService.obfuscateData(widget.contact.displayName)} deleted')),
SnackBar(
content: Text(
'${_obfuscateService.obfuscateData(widget.contact.displayName)} deleted')),
);
// Close the modal
@ -134,7 +136,9 @@ class _ContactModalState extends State<ContactModal> {
} catch (e) {
// Handle errors and show a failure message
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to delete ${widget.contact.displayName}: $e')),
SnackBar(
content:
Text('Failed to delete ${widget.contact.displayName}: $e')),
);
}
}
@ -162,7 +166,7 @@ class _ContactModalState extends State<ContactModal> {
decoration: BoxDecoration(
color: Colors.grey[900],
borderRadius:
const BorderRadius.vertical(top: Radius.circular(20)),
const BorderRadius.vertical(top: Radius.circular(20)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
@ -216,7 +220,7 @@ class _ContactModalState extends State<ContactModal> {
const PopupMenuItem<String>(
value: 'create_shortcut',
child:
Text('Create shortcut (to home screen)'),
Text('Create shortcut (to home screen)'),
),
const PopupMenuItem<String>(
value: 'set_ringtone',
@ -238,12 +242,13 @@ class _ContactModalState extends State<ContactModal> {
imageBytes: widget.contact.thumbnail,
radius: 50,
backgroundColor:
generateColorFromName(widget.contact.displayName),
generateColorFromName(widget.contact.displayName),
fallbackInitial: widget.contact.displayName,
),
const SizedBox(height: 10),
Text(
_obfuscateService.obfuscateData(widget.contact.displayName),
_obfuscateService
.obfuscateData(widget.contact.displayName),
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
@ -262,21 +267,10 @@ class _ContactModalState extends State<ContactModal> {
),
onTap: () async {
if (widget.contact.phones.isNotEmpty) {
await _callService.makeGsmCall(context, phoneNumber: phoneNumber);
await _callService.makeGsmCall(context,
phoneNumber: phoneNumber);
}
},
onLongPress: () {
// Navigate to the beautiful calling page demo
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => CallPage(
displayName: widget.contact.displayName,
thumbnail: widget.contact.thumbnail,
),
),
);
},
),
ListTile(
leading: const Icon(Icons.message, color: Colors.blue),
@ -319,9 +313,8 @@ class _ContactModalState extends State<ContactModal> {
icon: Icon(widget.isFavorite
? Icons.star
: Icons.star_border),
label: Text(widget.isFavorite
? 'Unfavorite'
: 'Favorite'),
label: Text(
widget.isFavorite ? 'Unfavorite' : 'Favorite'),
),
),
const SizedBox(height: 10),