// favorites.dart
import 'package:dialer/classes/contactClass.dart';
import 'package:dialer/classes/displayContact.dart';
import 'package:flutter/material.dart';
class FavoritePage extends StatefulWidget {
const FavoritePage({super.key});
@override
_FavoritePageState createState() => _FavoritePageState();
}
class _FavoritePageState extends State<FavoritePage> {
Widget build(BuildContext context) {
// Filter favorite contacts
final favoriteContacts =
contacts.where((contact) => contact.isFavorite).toList();
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: const Text('Favorites'),
),
body: ListView.builder(
itemCount: favoriteContacts.length,
itemBuilder: (context, index) {
return DisplayContact(contact: favoriteContacts[index]);
},
);