G-EIP-700-TLS-7-1-eip-steph.../lib/pages/favorites.dart
2024-09-16 18:07:04 +03:00

33 lines
847 B
Dart

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