fix(ui): Fix search list

This commit is contained in:
PapaTutuWawa 2023-02-03 23:39:45 +01:00
parent d6ad200afd
commit 4907eb9f2c

View File

@ -52,59 +52,61 @@ class AnimeSearchPage extends StatelessWidget {
), ),
) )
else else
ListView.builder( Expanded(
shrinkWrap: true, child: ListView.builder(
itemCount: state.searchResults.length, //shrinkWrap: true,
itemBuilder: (context, index) { itemCount: state.searchResults.length,
final item = state.searchResults[index]; itemBuilder: (context, index) {
return InkWell( final item = state.searchResults[index];
onTap: () { return InkWell(
context.read<AnimeSearchBloc>().add( onTap: () {
AnimeAddedEvent(item), context.read<AnimeSearchBloc>().add(
); AnimeAddedEvent(item),
}, );
child: Padding( },
padding: const EdgeInsets.all(8), child: Padding(
child: Row( padding: const EdgeInsets.all(8),
crossAxisAlignment: CrossAxisAlignment.start, child: Row(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
AnimeCoverImage( children: [
url: item.thumbnailUrl, AnimeCoverImage(
), url: item.thumbnailUrl,
),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
item.title, item.title,
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,
maxLines: 2, maxLines: 2,
softWrap: true, softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
Text( Text(
item.description, item.description,
style: Theme.of(context).textTheme.bodyMedium, style: Theme.of(context).textTheme.bodyMedium,
maxLines: 4, maxLines: 4,
softWrap: true, softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
], ],
),
), ),
), ),
), ],
], ),
), ),
), );
); }
} ),
), ),
], ],
), ),
); );
}, },
); );