diff options
| author | xengineering <me@xengineering.eu> | 2026-01-05 14:48:50 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2026-01-10 21:29:45 +0100 |
| commit | ee38d5671e0d6b8d0e1d3708a37b43a65682329f (patch) | |
| tree | b26ca93159c46fbe59bb9244d139cdc61fc64758 /lib/data.dart | |
| parent | 14d7ef0101400f531092ee4abfc42e9a0dfd218e (diff) | |
| download | sia-app-ee38d5671e0d6b8d0e1d3708a37b43a65682329f.tar sia-app-ee38d5671e0d6b8d0e1d3708a37b43a65682329f.tar.zst sia-app-ee38d5671e0d6b8d0e1d3708a37b43a65682329f.zip | |
Move state to data.dart
The UI should not store the application logic state.
Diffstat (limited to 'lib/data.dart')
| -rw-r--r-- | lib/data.dart | 11 |
1 files changed, 11 insertions, 0 deletions
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<Contact> contacts = <Contact>[ + 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; |
