Skip to content

Commit

Permalink
Reduce unnecessary SliverToBoxAdapter usage
Browse files Browse the repository at this point in the history
  • Loading branch information
r52 committed Jun 15, 2024
1 parent 5bc985b commit 6904773
Show file tree
Hide file tree
Showing 6 changed files with 355 additions and 372 deletions.
20 changes: 9 additions & 11 deletions lib/mangadex/creator_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ class MangaDexCreatorViewWidget extends HookConsumerWidget {
child: TitleFlexBar(title: creator.attributes.name),
),
),
if (creator.attributes.biography.isNotEmpty)
SliverToBoxAdapter(
child: ExpansionTile(
SliverList.list(children: [
if (creator.attributes.biography.isNotEmpty)
ExpansionTile(
title: const Text('Biography'),
children: [
for (final MapEntry(key: prop, value: desc)
Expand Down Expand Up @@ -167,13 +167,11 @@ class MangaDexCreatorViewWidget extends HookConsumerWidget {
)
],
),
),
if (creator.attributes.twitter != null ||
creator.attributes.pixiv != null ||
creator.attributes.youtube != null ||
creator.attributes.website != null)
SliverToBoxAdapter(
child: ExpansionTile(
if (creator.attributes.twitter != null ||
creator.attributes.pixiv != null ||
creator.attributes.youtube != null ||
creator.attributes.website != null)
ExpansionTile(
expandedAlignment: Alignment.centerLeft,
title: const Text('Follow'),
children: [
Expand Down Expand Up @@ -204,7 +202,7 @@ class MangaDexCreatorViewWidget extends HookConsumerWidget {
),
],
),
),
]),
],
title: const Text(
'Works',
Expand Down
16 changes: 7 additions & 9 deletions lib/mangadex/group_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ class MangaDexGroupViewWidget extends HookConsumerWidget {
controller: controllers[0],
scrollBehavior: const MouseTouchScrollBehavior(),
slivers: <Widget>[
if (group.attributes.description != null)
SliverToBoxAdapter(
child: ExpansionTile(
SliverList.list(children: [
if (group.attributes.description != null)
ExpansionTile(
initiallyExpanded: true,
title: const Text('Group Description'),
children: [
Expand All @@ -179,11 +179,9 @@ class MangaDexGroupViewWidget extends HookConsumerWidget {
),
],
),
),
if (group.attributes.website != null ||
group.attributes.discord != null)
SliverToBoxAdapter(
child: ExpansionTile(
if (group.attributes.website != null ||
group.attributes.discord != null)
ExpansionTile(
initiallyExpanded: true,
expandedAlignment: Alignment.centerLeft,
title: const Text('Links'),
Expand Down Expand Up @@ -220,7 +218,7 @@ class MangaDexGroupViewWidget extends HookConsumerWidget {
),
],
),
),
]),
],
),
_ViewType.feed => Consumer(
Expand Down
Loading

0 comments on commit 6904773

Please sign in to comment.