feat: CallPage UI, ReceivingCall UI, Default dialer app, can call/receive calls and hangup #45
@ -126,7 +126,9 @@ class _ContactModalState extends State<ContactModal> {
|
|||||||
|
|
||||||
// Show success message
|
// Show success message
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
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
|
// Close the modal
|
||||||
@ -134,7 +136,9 @@ class _ContactModalState extends State<ContactModal> {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle errors and show a failure message
|
// Handle errors and show a failure message
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
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(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey[900],
|
color: Colors.grey[900],
|
||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.vertical(top: Radius.circular(20)),
|
const BorderRadius.vertical(top: Radius.circular(20)),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -216,7 +220,7 @@ class _ContactModalState extends State<ContactModal> {
|
|||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'create_shortcut',
|
value: 'create_shortcut',
|
||||||
child:
|
child:
|
||||||
Text('Create shortcut (to home screen)'),
|
Text('Create shortcut (to home screen)'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'set_ringtone',
|
value: 'set_ringtone',
|
||||||
@ -238,12 +242,13 @@ class _ContactModalState extends State<ContactModal> {
|
|||||||
imageBytes: widget.contact.thumbnail,
|
imageBytes: widget.contact.thumbnail,
|
||||||
radius: 50,
|
radius: 50,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
generateColorFromName(widget.contact.displayName),
|
generateColorFromName(widget.contact.displayName),
|
||||||
fallbackInitial: widget.contact.displayName,
|
fallbackInitial: widget.contact.displayName,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
_obfuscateService.obfuscateData(widget.contact.displayName),
|
_obfuscateService
|
||||||
|
.obfuscateData(widget.contact.displayName),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@ -262,21 +267,10 @@ class _ContactModalState extends State<ContactModal> {
|
|||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (widget.contact.phones.isNotEmpty) {
|
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(
|
ListTile(
|
||||||
leading: const Icon(Icons.message, color: Colors.blue),
|
leading: const Icon(Icons.message, color: Colors.blue),
|
||||||
@ -319,9 +313,8 @@ class _ContactModalState extends State<ContactModal> {
|
|||||||
icon: Icon(widget.isFavorite
|
icon: Icon(widget.isFavorite
|
||||||
? Icons.star
|
? Icons.star
|
||||||
: Icons.star_border),
|
: Icons.star_border),
|
||||||
label: Text(widget.isFavorite
|
label: Text(
|
||||||
? 'Unfavorite'
|
widget.isFavorite ? 'Unfavorite' : 'Favorite'),
|
||||||
: 'Favorite'),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
Loading…
Reference in New Issue
Block a user