From ee38d5671e0d6b8d0e1d3708a37b43a65682329f Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 5 Jan 2026 14:48:50 +0100 Subject: Move state to data.dart The UI should not store the application logic state. --- lib/data.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/data.dart') diff --git a/lib/data.dart b/lib/data.dart index f2e3531..5cd59ec 100644 --- a/lib/data.dart +++ b/lib/data.dart @@ -1,3 +1,14 @@ +import 'package:flutter/foundation.dart'; + +class AppState with ChangeNotifier { + List contacts = [ + Contact(address: "Living Room Window", isOpen: false), + Contact(address: "Front Door", isOpen: true), + Contact(address: "Back Door", isOpen: false), + Contact(address: "Garage Window", isOpen: true), + ]; +} + class Contact { final String address; bool isOpen; -- cgit v1.2.3-70-g09d2