mirrored_repositories/Flutter--Pokedex/lib/features/pokedex/screens/home/pages
import 'package:flutter/material.dart';
import 'package:pokedex_app/common/models/pokemon.dart';
import 'package:pokedex_app/features/pokedex/screens/details/container/detail_container.dart';
import 'package:pokedex_app/features/pokedex/screens/home/pages/widgets/type_widget.dart';

class PokemonItemWidget extends StatelessWidget {
  const PokemonItemWidget({Key? key, required this.pokemon, /*required this.onTap*/}) : super(key: key);
  final Pokemon pokemon;
  //final Function(String, DetailArguments) onTap;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      //onTap: () => onTap,
      child: Stack(
        children: [
          Container(
            decoration: BoxDecoration(
              color: pokemon.baseColor!.withOpacity(0.9),
              borderRadius: BorderRadius.circular(16)
            ),
            child: Padding(
              padding: const EdgeInsets.all(16),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Flexible(
                        child: Text(pokemon.name, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold,
                                fontSize: 16)),
                      ),
                      Text('#${pokemon.num}', style: TextStyle(color: Colors.black.withOpacity(0.4), fontWeight: FontWeight.bold,
                fontSize: 14),)
                    ],
                  ),
                  Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: pokemon.type.map((e) => TypeWidget(name: e)).toList()
                      ),
                      Flexible(child: Container(
                        height: 100,
                        width: 100,
                      )),
                    ],
                  )
                ],
              ),
            )
          ),
          Positioned(
            bottom: 12,
            right: 2,
            child: Image.network(pokemon.image),
          )
        ],
      ),
    );
  }
}
