Skip to content

Commit

Permalink
fix: use title correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoenig134 committed Oct 1, 2024
1 parent b7564ac commit 91180de
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/renderers/lib/src/request/request_item_group_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,26 @@ class RequestItemGroupRenderer extends StatelessWidget {
);
}).toList();

final title = requestItemGroup.title != null
? Text(requestItemGroup.title ?? '', style: Theme.of(context).textTheme.bodyLarge!.copyWith(color: Theme.of(context).colorScheme.onSurface))
: null;

final subtitle = requestItemGroup.description != null
? Text(
requestItemGroup.description!,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant),
)
: null;

return ExpansionTile(
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
collapsedBackgroundColor: Theme.of(context).colorScheme.surfaceContainer,
maintainState: true,
initiallyExpanded: true,
shape: const LinearBorder(side: BorderSide.none),
// TODO: render anything else than empty string when title is not defined
title: Text(
requestItemGroup.title ?? '',
style: Theme.of(context).textTheme.bodyLarge!.copyWith(color: Theme.of(context).colorScheme.onSurface),
),
subtitle: requestItemGroup.description != null
? Text(
requestItemGroup.description!,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant),
)
: null,
title: title ?? subtitle ?? const Text(''),
subtitle: requestItemGroup.title != null ? subtitle : null,
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
children: requestItems,
);
Expand Down

0 comments on commit 91180de

Please sign in to comment.