import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'matches_ended_controller.dart';

class MatchesEndedPage extends GetWidget<MatchesEndedController>{
  final controller = Get.put(MatchesEndedController());

  @override
  Widget build(BuildContext context) {
  return
    Center(
  child: Container(
    padding: EdgeInsets.symmetric(horizontal: 16.w),
    width: double.infinity,
    color: const Color.fromRGBO(254, 254, 254, 1),
    child: Column(
      children: [
        SizedBox(height: 8.h,),
        Text('MATCH ENDED', style:  TextStyle(color: Colors.black, fontSize: 14.sp, fontWeight: FontWeight.bold),),
        SizedBox(height: 4.h,),
     controller.itemMatchesEnded.value.status == 'FINISHED'  ?
     Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              alignment: Alignment.center,
              width: 50.w,
              height: 24.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(2),
                color: Colors.black54,
              ),

              padding: EdgeInsets.symmetric(horizontal:8.w, vertical: 2.h),
              child: Text(controller.itemMatchesEnded.value.ftScore!.substring(0,2), style: TextStyle(color: Colors.white, fontWeight:FontWeight.bold, fontSize:16.sp),),
            ),
            SizedBox(width: 6.w,),
            Text(':', style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 24.sp),),
            SizedBox(width: 6.w,),
            Container(
              alignment: Alignment.center,
              width: 50.w,
              height: 24.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(2),
                color: Colors.black54,
              ),

              padding: EdgeInsets.symmetric(horizontal:8.w, vertical: 2.h),
              child: Text(controller.itemMatchesEnded.value.ftScore!.substring(3,5), style: TextStyle(color: Colors.white, fontWeight:FontWeight.bold, fontSize:16.sp),),
            )
          ],
        ): Container(),
        SizedBox(height: 4.h,),
        Text('HT ${controller.itemMatchesEnded.value.htScore}', style:  TextStyle(color: Colors.grey, fontSize: 12.sp, fontWeight: FontWeight.w400),),
        SizedBox(height: 4.h,),
        Container(
          color: Colors.grey,
          height: 1,
          width: double.infinity,
        ),
        SizedBox(height: 4.h,),

        Text('Diaz de Mera Escuderosm, Isidro', style:  TextStyle(color: Colors.black, fontSize: 12.sp, fontWeight: FontWeight.bold),),
        Text('REFEREE', style:  TextStyle(color: Colors.grey, fontSize: 12.sp, fontWeight: FontWeight.w400),),
        SizedBox(height: 4.h,),

        Container(
          color: Colors.grey,
          height: 1,
          width: double.infinity,
        ),
        Row(
          children: [
            Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text('Ancelototi, Carlo', style:  TextStyle(color: Colors.black, fontSize: 12.sp, fontWeight: FontWeight.bold),),
                    SizedBox(height: 4.h,),
                    Text('REFEREE', style:  TextStyle(color: Colors.grey, fontSize: 12.sp, fontWeight: FontWeight.w400),),
                  ],
                )),
            Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.end,
                  children: [
                    Text('Ancelototi, Carlo', style:  TextStyle(color: Colors.black, fontSize: 12.sp, fontWeight: FontWeight.bold),),
                    SizedBox(height: 4.h,),
                    Text('REFEREE', style:  TextStyle(color: Colors.grey, fontSize: 12.sp, fontWeight: FontWeight.w400),),
                  ],
                ))
          ],
        ),
        SizedBox(height: 4.h,),

      ],
    ),
  ),
);
  }
}