From a17bb2c1785cd70028c62dcfd21db6b4fcfd06a8 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 3 Jan 2026 11:13:05 +0100 Subject: Make ContactList a StatefulWidget This is required to change the contact states during runtime. --- lib/main.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/main.dart b/lib/main.dart index 34eab88..db8fcd2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,9 +22,15 @@ class Contact { const Contact({required this.address, required this.isOpen}); } -class ContactList extends StatelessWidget { +class ContactList extends StatefulWidget { const ContactList({super.key}); + @override + State createState() => _ContactListState(); +} + +class _ContactListState extends State { + final List contacts = const [ Contact(address: "Living Room Window", isOpen: false), Contact(address: "Front Door", isOpen: true), -- cgit v1.2.3-70-g09d2