import 'package:betting/commom/utils/textstyle.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SquadItemWidget extends StatelessWidget {
  const SquadItemWidget(
      {Key? key, this.shirtNumber, required this.namePlayers, required this.nation, required this.flag})
      : super(key: key);

  final int? shirtNumber;
  final String namePlayers;
  final String flag;
  final String nation;

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            const SizedBox(
              width: 8,
            ),
            (shirtNumber == null)? const SizedBox():Container(
              alignment: Alignment.center,
              width: 20.sp,
              height: 20.sp,
              decoration: BoxDecoration(
                border: Border.all(width: 1, color: Colors.white),
                borderRadius: BorderRadius.circular(50),
              ),
              child: Text(
                shirtNumber.toString(), style: TextStyle(color: Colors.white),),
            ),
            const SizedBox(
              width: 15,
            ),
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  namePlayers,
                  style: TextStyleUtils.sizeText14Weight400()!
                      .copyWith(color: Colors.white),
                ),
                const SizedBox(
                  height: 5,
                ),
                Row(
                  children: [
                    Image.network(flag, width: 20, height: 20,),
                    const SizedBox(width: 10,),
                    Text(
                      nation,
                      style: TextStyleUtils.sizeText12Weight400()!
                          .copyWith(color: Colors.white54),
                    ),
                  ],
                ),
              ],
            ),
          ],
        ),
        Icon(Icons.navigate_next_rounded, color: Colors.white70,)
      ],
    );
  }
}
