Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/redesign group tiles #271

Merged
merged 22 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1d9c3ee
refactor: redesign group tiles
nicole-eb Sep 10, 2024
1f63a37
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 18, 2024
2bb5f77
fix: add missing description to RequestItemGroupDVO
Siolto Sep 19, 2024
00dc0ed
refactor: display requestItemGroup according to design
Siolto Sep 19, 2024
f591301
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 19, 2024
00f1a93
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 20, 2024
70b3394
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 20, 2024
e1156b8
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 20, 2024
6eeed7b
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 20, 2024
71816ad
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 24, 2024
96b8e68
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 24, 2024
1627e56
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 25, 2024
228a8cb
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 30, 2024
544df64
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 30, 2024
dfc5296
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 30, 2024
647a53d
Merge branch 'main' into refactor/redesign-request-item-group
mergify[bot] Sep 30, 2024
66a0acc
refactor: add trailing comma and remove unnecessary container widget
Siolto Oct 1, 2024
070f236
refactor: add backgroundColor to RequestItemRenderer
Siolto Oct 1, 2024
467420e
refactor: don't limit description to two lines and fix trailing comma
Siolto Oct 1, 2024
b7564ac
refactor: use correct styling for texts
Siolto Oct 1, 2024
91180de
fix: use title correctly
jkoenig134 Oct 1, 2024
16aa647
refactor: use correct title
Siolto Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class RequestItemGroupDVO extends RequestItemDVO {
required super.isDecidable,
required this.items,
this.title,
super.description,
this.response,
}) : super(id: 'n/a', name: 'n/a', type: 'RequestItemGroupDVO');

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,30 @@ class RequestItemGroupRenderer extends StatelessWidget {
expandFileReference: expandFileReference,
chooseFile: chooseFile,
openFileDetails: openFileDetails,
backgroundColor: Theme.of(context).colorScheme.surface,
);
}).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,
// TODO: render anything else than empty string when title is not defined
title: Text(requestItemGroup.title ?? ''),
subtitle: requestItemGroup.description != null ? Text(requestItemGroup.description!) : null,
shape: const LinearBorder(side: BorderSide.none),
title: title ?? subtitle ?? const Text(''),
subtitle: title != null ? subtitle : null,
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
children: requestItems,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class RequestItemRenderer extends StatelessWidget {
final Future<FileDVO?> Function() chooseFile;
final void Function(FileDVO) openFileDetails;

final Color? backgroundColor;

const RequestItemRenderer({
super.key,
required this.currentAddress,
Expand All @@ -33,11 +35,13 @@ class RequestItemRenderer extends StatelessWidget {
required this.expandFileReference,
required this.chooseFile,
required this.openFileDetails,
this.backgroundColor,
});

@override
Widget build(BuildContext context) {
return Padding(
return Container(
color: backgroundColor,
padding: const EdgeInsets.symmetric(vertical: 12),
child: switch (item) {
final DecidableReadAttributeRequestItemDVO dvo => DecidableReadAttributeRequestItemRenderer(
Expand Down