import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/lottie_consts.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart';
import 'package:mohem_flutter_app/ui/marathon/widgets/custom_status_widget.dart';
import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_qualifiers_container.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:provider/provider.dart';

class MarathonWinnerSelection extends StatelessWidget {
  const MarathonWinnerSelection({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    MarathonProvider provider = context.read<MarathonProvider>();
    return Scaffold(
      appBar: AppBarWidget(context, title: LocaleKeys.brainMarathon.tr()),
      body: SingleChildScrollView(
        child: Column(
          children: [
            20.height,
            QualifiersContainer(provider: provider,).paddingOnly(left: 21, right: 21),
            12.height,
            InkWell(
              onTap: () {
                Navigator.pushNamed(context, AppRoutes.marathonWinnerScreen);
              },
              child: Container(
                height: 50,
                decoration: BoxDecoration(
                  color: MyColors.greenColor,
                  borderRadius: BorderRadius.circular(15),
                  boxShadow: [
                    BoxShadow(
                      color: const Color(0xff000000).withOpacity(.05),
                      blurRadius: 26,
                      offset: const Offset(0, -3),
                    ),
                  ],
                ),
                child: Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 20),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      "Muhammad Shrouff".toText17(isBold: true, color: MyColors.white),
                      "837436".toText17(isBold: true, color: MyColors.white),
                    ],
                  ),
                ),
              ).paddingOnly(left: 20, right: 20),
            ),
            CustomStatusWidget(
                asset: Lottie.asset(
                  MyLottieConsts.winnerLottie,
                  height: 168,
                ),
                title: Text(
                  LocaleKeys.fingersCrossed.tr(),
                  style: const TextStyle(
                    height: 27 / 27,
                    color: MyColors.greenColor,
                    fontSize: 27,
                    letterSpacing: -1.08,
                    fontWeight: FontWeight.w600,
                  ),
                ),
                subTitle: Text(
                  LocaleKeys.winnerSelectedRandomly.tr(),
                  textAlign: TextAlign.center,
                  style: const TextStyle(
                    color: MyColors.darkTextColor,
                    fontSize: 18,
                    letterSpacing: -0.72,
                    fontWeight: FontWeight.w600,
                  ),
                )).paddingOnly(left: 21, right: 21, top: 20, bottom: 20),
          ],
        ),
      ),
    );
  }
}
