From 5dc62a59bf12dcc0190c26eb3712c1b7eec3cfcd Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 7 Apr 2026 17:09:45 +0200 Subject: Display available covers This does not yet allow control of the covers but existence is shown. --- lib/ui.dart | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/ui.dart b/lib/ui.dart index 3a98be9..94b6b8e 100644 --- a/lib/ui.dart +++ b/lib/ui.dart @@ -90,14 +90,25 @@ class DevicesPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text("Contacts")), - body: const Column( - children: [ - Expanded(child: ContactList()), - ], + return const Scaffold( + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(15.0), + child: Text("Contacts", style: TextStyle(fontSize: 22)), + ), + ContactList(), + Padding( + padding: EdgeInsets.all(15.0), + child: Text("Covers", style: TextStyle(fontSize: 22)), + ), + CoverList(), + ], + ), ), - bottomNavigationBar: const ConnectionStatus(), + bottomNavigationBar: ConnectionStatus(), ); } } @@ -110,6 +121,8 @@ class ContactList extends StatelessWidget { return Consumer( builder: (BuildContext context, AppState state, Widget? child) { return ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), itemCount: state.contacts.length, itemBuilder: (BuildContext context, int index) { MapEntry data = state.contacts.entries.elementAt(index); @@ -129,6 +142,33 @@ class ContactList extends StatelessWidget { } } +class CoverList extends StatelessWidget { + const CoverList({super.key}); + + @override + Widget build(BuildContext context) { + return Consumer( + builder: (BuildContext context, AppState state, Widget? child) { + return ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: state.covers.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + ListTile( + leading: const Icon(Icons.roller_shades), + title: Text(state.covers.elementAt(index)), + ), + ], + ); + }, + ); + }, + ); + } +} + class ConnectionStatus extends StatelessWidget { const ConnectionStatus({super.key}); -- cgit v1.3