diff --git a/lib/home_screen.dart b/lib/home_screen.dart index fbac1f2..e71b82d 100644 --- a/lib/home_screen.dart +++ b/lib/home_screen.dart @@ -157,7 +157,7 @@ class _HomeScreenState extends State { var typeNames = pokemon['types'].map((item) => item['type']['name']).toList(); String type1 = typeNames.first.toString().capitalize(); String type2 = typeNames.last.toString().capitalize(); - String type = typeNames.join(',\n').toString().capitalizeEach(); + String type = typeNames.join('\n').toString().capitalizeEach(); String id = pokemon['id'].toString(); String Pokename = "#${id} ${pokemon['name'].toString().capitalize()}"; return InkWell( @@ -231,8 +231,9 @@ class _HomeScreenState extends State { ), ), child: Padding( - padding: const EdgeInsets.only(left: 4, right: 4, - top: 1, bottom: 1), + padding: typeNames.length==2 ? + const EdgeInsets.only(left: 5, right: 5, top: 2, bottom: 2) : + const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4), child: Text(type, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12), diff --git a/lib/pokemon_detail_screen.dart b/lib/pokemon_detail_screen.dart index b89bac8..064e061 100644 --- a/lib/pokemon_detail_screen.dart +++ b/lib/pokemon_detail_screen.dart @@ -25,7 +25,7 @@ class _PokemonDetailScreenState extends State { var typeNames = pokemon['types'].map((item) => item['type']['name']).toList(); String type1 = typeNames.first.toString().capitalize(); String type2 = typeNames.last.toString().capitalize(); - String type = typeNames.join(', ').toString().capitalizeEach(); + String type = typeNames.join(' | ').toString().capitalizeEach(); String id = pokemon['id'].toString(); String name = pokemon['name'].toString().capitalize(); String PokeHeight = "${(pokemon['height'] / 10).toString()} m"; @@ -49,8 +49,8 @@ class _PokemonDetailScreenState extends State { left: 20, child: Text(name,style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, - fontSize: 30, - ),)), + fontSize: 30, ),) + ), Positioned( top: 140, @@ -74,9 +74,10 @@ class _PokemonDetailScreenState extends State { ), Positioned( - top: height * 0.18, - right: -120, - child: Image.asset("images/pokeball.png", height: 250, fit: BoxFit.fitHeight,), + top: height * 0.15, + right: -20, + child: Image.asset("images/pokeball.png", height: 275, + fit: BoxFit.fitHeight,), ), Positioned(