Space between pokemon types on pokemon_info screen
JoaoLSA opened this issue · 2 comments
JoaoLSA commented
hungps commented
Hi @JoaoLSA,
Thanks for your contribution. I recognized it too, and I added some spaces between them in #15. But if you want to know how to fix it by yourself, take a look at this file: /lib/screens/pokemon_info/widgets/info.dart
In _buildPokemonTypes
method you can find this block of code:
Row(
children: pokemon.types
.map((type) => Hero(tag: type, child: PokemonType(type, large: true)))
.toList(),
),
This is the code to render all types of pokemon. To add space between them, you can wrap each card with Padding
, or simply use the expand
and take
method like this to add a SizeBox
between each card:
Row(
children: pokemon.types
.map((type) => Hero(tag: type, child: PokemonType(type, large: true)))
.expand((item) => [item, SizedBox(width: 6)])
.take(pokemon.types.length * 2 - 1)
.toList(),
),
JoaoLSA commented
Thanks a lot @scitbiz I couldn't figure out how to make that.