Compare commits
No commits in common. "27e2b7adbd82c52852fac472049a593d8851c7ee" and "3e7845d3d899bc7ff1e87c2353c20917e5426b84" have entirely different histories.
27e2b7adbd
...
3e7845d3d8
@ -22,10 +22,12 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _fetchContacts() async {
|
Future<void> _fetchContacts() async {
|
||||||
|
if (await FlutterContacts.requestPermission()) {
|
||||||
_allContacts = await _contactService.fetchContacts();
|
_allContacts = await _contactService.fetchContacts();
|
||||||
_filteredContacts = _allContacts;
|
_filteredContacts = _allContacts;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void _filterContacts() {
|
void _filterContacts() {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -79,9 +81,9 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
// Top half: Display contacts matching dialed number
|
// Top half: Display contacts matching dialed number
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Container(
|
child:
|
||||||
padding: const EdgeInsets.only(
|
Container(
|
||||||
top: 42.0, left: 16.0, right: 16.0, bottom: 16.0),
|
padding: const EdgeInsets.only(top: 42.0, left: 16.0, right: 16.0, bottom: 16.0),
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -93,14 +95,12 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
contact.displayName,
|
contact.displayName,
|
||||||
style:
|
style: const TextStyle(color: Colors.white),
|
||||||
const TextStyle(color: Colors.white),
|
|
||||||
),
|
),
|
||||||
subtitle: contact.phones.isNotEmpty
|
subtitle: contact.phones.isNotEmpty
|
||||||
? Text(
|
? Text(
|
||||||
contact.phones.first.number,
|
contact.phones.first.number,
|
||||||
style: const TextStyle(
|
style: const TextStyle(color: Colors.grey),
|
||||||
color: Colors.grey),
|
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
@ -108,22 +108,16 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
children: [
|
children: [
|
||||||
// Call button
|
// Call button
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.phone,
|
icon: Icon(Icons.phone, color: Colors.green[300], size: 20),
|
||||||
color: Colors.green[300],
|
|
||||||
size: 20),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
print(
|
print('Calling ${contact.displayName}');
|
||||||
'Calling ${contact.displayName}');
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
// Text button
|
// Text button
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.message,
|
icon: Icon(Icons.message, color: Colors.blue[300], size: 20),
|
||||||
color: Colors.blue[300],
|
|
||||||
size: 20),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
print(
|
print('Texting ${contact.displayName}');
|
||||||
'Texting ${contact.displayName}');
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -133,12 +127,7 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList()
|
||||||
: [
|
: [Center(child: Text('No contacts found', style: TextStyle(color: Colors.white)))],
|
||||||
Center(
|
|
||||||
child: Text('No contacts found',
|
|
||||||
style:
|
|
||||||
TextStyle(color: Colors.white)))
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -163,16 +152,14 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
dialedNumber,
|
dialedNumber,
|
||||||
style: const TextStyle(
|
style: const TextStyle(fontSize: 24, color: Colors.white),
|
||||||
fontSize: 24, color: Colors.white),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: _onClearPress,
|
onPressed: _onClearPress,
|
||||||
icon: const Icon(Icons.backspace,
|
icon: const Icon(Icons.backspace, color: Colors.white),
|
||||||
color: Colors.white),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -185,8 +172,7 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
children: [
|
||||||
_buildDialButton('1'),
|
_buildDialButton('1'),
|
||||||
_buildDialButton('2'),
|
_buildDialButton('2'),
|
||||||
@ -194,8 +180,7 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
children: [
|
||||||
_buildDialButton('4'),
|
_buildDialButton('4'),
|
||||||
_buildDialButton('5'),
|
_buildDialButton('5'),
|
||||||
@ -203,8 +188,7 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
children: [
|
||||||
_buildDialButton('7'),
|
_buildDialButton('7'),
|
||||||
_buildDialButton('8'),
|
_buildDialButton('8'),
|
||||||
@ -212,8 +196,7 @@ class _CompositionPageState extends State<CompositionPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
children: [
|
||||||
_buildDialButton('*'),
|
_buildDialButton('*'),
|
||||||
_buildDialButton('0'),
|
_buildDialButton('0'),
|
||||||
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_contacts/flutter_contacts.dart';
|
import 'package:flutter_contacts/flutter_contacts.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:dialer/widgets/username_color_generator.dart';
|
import 'package:dialer/widgets/username_color_generator.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class ContactModal extends StatelessWidget {
|
class ContactModal extends StatelessWidget {
|
||||||
final Contact contact;
|
final Contact contact;
|
||||||
@ -70,12 +69,7 @@ class ContactModal extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
// Modal Handle
|
// Modal Handle
|
||||||
// Top Bar with Handle and Three-Dot Menu
|
Padding(
|
||||||
Stack(
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 50,
|
width: 50,
|
||||||
@ -86,48 +80,6 @@ class ContactModal extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 10, right: 10),
|
|
||||||
child: PopupMenuButton<String>(
|
|
||||||
icon: Icon(Icons.more_vert, color: Colors.white),
|
|
||||||
onSelected: (String choice) {
|
|
||||||
print(
|
|
||||||
'Selected: $choice'); // Placeholder for menu actions
|
|
||||||
},
|
|
||||||
itemBuilder: (BuildContext context) {
|
|
||||||
return <PopupMenuEntry<String>>[
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
value: 'show_associated_contacts',
|
|
||||||
child: Text('Show associated contacts'),
|
|
||||||
),
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
value: 'delete',
|
|
||||||
child: Text('Delete'),
|
|
||||||
),
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
value: 'share',
|
|
||||||
child: Text('Share (via QR code)'),
|
|
||||||
),
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
value: 'create_shortcut',
|
|
||||||
child:
|
|
||||||
Text('Create shortcut (to home screen)'),
|
|
||||||
),
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
value: 'set_ringtone',
|
|
||||||
child: Text('Set ringtone'),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
// Contact Profile
|
// Contact Profile
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
Loading…
Reference in New Issue
Block a user