import 'package:flutter/material.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_button.dart';
import 'package:tour_travel_agr/helper/widget_responsive.dart';
import 'package:tour_travel_agr/resource/assets.dart';
import 'package:tour_travel_agr/resource/colors.dart';
import 'package:tour_travel_agr/resource/font.dart';
import 'package:tour_travel_agr/resource/routes.dart';
import 'package:tour_travel_agr/resource/size.dart';
import 'package:tour_travel_agr/resource/style.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ColorManager.backgroundColor,
      body: ScreenResponsive(
        widget: const BodyWidget(),
        widthScreen: MediaQuery.of(context).size.width,
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned(
          top: 0,
          left: 0,
          child: Image(
            height: 200,
            image: AssetImage(
              Assets.elipse,
            ),
          ),
        ),
        Container(
          padding: EdgeInsets.only(
            top: AppPadding.safeAreaTop(context) + 40,
          ),
          child: Column(
            children: [
              Stack(
                children: [
                  Positioned(
                    top: 0,
                    right: 0,
                    child: Image(
                      width: 200,
                      image: AssetImage(
                        Assets.elipseRight,
                      ),
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.symmetric(
                      horizontal: AppPadding.p20,
                    ),
                    child: Image(
                      image: AssetImage(
                        Assets.resetSuccess,
                      ),
                      width: double.infinity,
                      height: 342,
                    ),
                  ),
                ],
              ),
              SizedBox(
                height: AppMargin.m12,
              ),
              Padding(
                padding: EdgeInsets.symmetric(
                  horizontal: AppPadding.p20,
                ),
                child: Text(
                  '''Reset Password
Success''',
                  style: getSemiBoldStyle(
                    color: Colors.black,
                    fontSize: 32,
                    fontFamily: FontConstants.inter,
                  ),
                  textAlign: TextAlign.center,
                ),
              ),
              const SizedBox(
                height: 70,
              ),
              Padding(
                padding: EdgeInsets.symmetric(
                  horizontal: AppPadding.p20,
                ),
                child: CustomButton(
                  text: "Back to Login",
                  onTap: () {
                    Navigator.pushNamedAndRemoveUntil(
                      context,
                      Routes.loginRoute,
                      (route) => false,
                    );
                  },
                ),
              )
            ],
          ),
        ),
      ],
    );
  }
}
