Skip to content

Commit

Permalink
chore: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Losses committed Oct 25, 2024
1 parent 60ee5be commit 0e38496
Showing 1 changed file with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:rune/widgets/turntile/managed_turntile_screen_item.dart';

import '../../../widgets/turntile/managed_turntile_screen_item.dart';
import '../../../messages/collection.pb.dart';

import './search_card.dart';
Expand All @@ -24,30 +24,23 @@ class SmallScreenSearchTrackListImplementation extends StatelessWidget {

@override
Widget build(BuildContext context) {
final list = (items ?? defaultList).asMap().entries.map(
(x) {
final index = x.key;
final key = '${collectionType.toString()}-$index';

return ManagedTurntileScreenItem(
key: Key(key),
prefix: collectionType.toString(),
groupId: groupId,
row: index,
column: 1,
child: x.value,
);
},
).toList();

if (direction == Axis.vertical) {
return Column(
children: list,
);
}

return Row(
children: list,
return Flex(
direction: direction,
children: (items ?? defaultList).asMap().entries.map(
(x) {
final index = x.key;
final key = '${collectionType.toString()}-$index';

return ManagedTurntileScreenItem(
key: Key(key),
prefix: collectionType.toString(),
groupId: groupId,
row: index,
column: 1,
child: x.value,
);
},
).toList(),
);
}
}

0 comments on commit 0e38496

Please sign in to comment.