Skip to content

Commit

Permalink
fix: display devices with no description (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
huffSamuel authored Sep 24, 2024
1 parent f004efb commit a1026e7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/presentation/device/widgets/service_expansion_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,27 @@ class ServiceExpansionTile extends StatelessWidget {
child: Icon(Icons.account_tree_outlined),
),
children: [
if (service.description!.actions.isEmpty)
if (service.description?.actions.isEmpty == true)
ListTile(
title: Text(AppLocalizations.of(context)!.noActionsForThisService),
leading: LeadingIconBuilder(
builder: (context) => Icon(Icons.warning_amber_rounded),
),
),
...service.description!.actions.map(
(x) => _ActionListTile(
action: x,
serviceStateTable: service.description!.serviceStateTable,
if (service.description != null)
...service.description!.actions.map(
(x) => _ActionListTile(
action: x,
serviceStateTable: service.description!.serviceStateTable,
),
),
if (service.description == null)
ListTile(
title: Text(AppLocalizations.of(context)!.nothingHere),
leading: LeadingIconBuilder(
builder: (context) => Icon(Icons.warning_amber_rounded),
),
),
),
],
);
}
Expand Down

0 comments on commit a1026e7

Please sign in to comment.