import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';

import '../../../../../../core/styles/app_color.dart';
import '../../../../../../core/styles/app_text.dart';
import '../../../../../../core/utils/language/localizations_delegate.dart';
import '../../../../../../shared/components/button_widget.dart';
import '../../../../../countrySelection/bloc/choose_country_bloc.dart';
import '../../widgets/deposit_pay_method_section.dart';

class SelectDepositMethodScreen extends StatelessWidget {
  const SelectDepositMethodScreen({super.key});

  @override
  Widget build(BuildContext context) {
    var localizations = AppLocalizations.of(context);
    final radioBloc = context.read<RadioBloc>();
    return Scaffold(
      backgroundColor: Colors.white,
      bottomNavigationBar: Container(
        margin: const EdgeInsets.symmetric(
          horizontal: 16,
          vertical: 16,
        ),
        width: 1.sw,
        height: 56.h,
        child: ButtonWidget().elevatedBtn(
          txtClr: AppColor.plainWhite,
          function: () {
            if (radioBloc.selectedCountry == 0) {
              goRouter.pushNamed(RouteName.depositStepScreen);
            } else {
              goRouter.pushNamed(RouteName.depositScreen);
            }
          },
          text: localizations.translate(AppText.next),
          clr: AppColor.primaryColor2,
        ),
      ),
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        scrolledUnderElevation: 0.0,
        centerTitle: true,
        title: Text(
          localizations.translate(AppText.deposit),
          style: GoogleFonts.dmSans(
            color: const Color(0xFF272727),
            fontSize: 20.sp,
            fontWeight: FontWeight.w700,
          ),
        ),
      ),
      body: const Padding(
        padding: EdgeInsets.all(16.0),
        child: Column(
          children: [
            DepositPayMethodSection(),
          ],
        ),
      ),
    );
  }
}
