import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';

import '../../core/utils/utils.dart';

class ServiceInfoPage extends StatelessWidget {
  final String serviceName;
  final String serviceHeader;
  final String serviceDescription;
  final String serviceImage;

  const ServiceInfoPage({required this.serviceName, required this.serviceHeader, required this.serviceDescription, required this.serviceImage, super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColors.bgScaffoldColor,
      body: Column(
        children: [
          Expanded(
            child: CollapsingListView(
              title: "",
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  ClipRRect(
                    borderRadius: BorderRadius.circular(24.r),
                    child: Transform.flip(
                      flipX: getIt.get<AppState>().isArabic(),
                      child: Utils.buildImgWithAssets(
                        icon: serviceImage,
                        fit: BoxFit.fitHeight,
                        // height: 480.h,
                        // width: 520.w,
                      ),
                    ),
                  ).paddingSymmetrical(24.h, 0.h),
                  SizedBox(height: 32.h),
                  AppCustomChipWidget(
                    richText: serviceName.toText14(color: AppColors.infoColor, isBold: true),
                    backgroundColor: AppColors.infoColor.withAlpha(50),
                    textColor: AppColors.infoColor,
                  ).paddingSymmetrical(24.h, 0.h),
                  SizedBox(height: 24.h),
                  serviceHeader.toText28(isBold: true, height: 1.4).paddingSymmetrical(24.h, 0.h),
                  SizedBox(height: 24.h),
                  serviceDescription.toText14(isBold: true, color: AppColors.greyTextColor).paddingSymmetrical(24.h, 0.h),
                  SizedBox(height: 24.h),
                ],
              ),
            ),
          ),
          Container(
            decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
              color: AppColors.whiteColor,
              borderRadius: 24.r,
              hasShadow: true,
            ),
            child: CustomButton(
              text: LocaleKeys.login.tr(context: context),
              onPressed: () {
                getIt<AuthenticationViewModel>().onLoginPressed();
              },
              backgroundColor: AppColors.primaryRedColor,
              borderColor: AppColors.primaryRedColor,
              textColor: AppColors.whiteColor,
              fontSize: 16.f,
              isBold: true,
              borderRadius: 12.r,
              padding: EdgeInsets.symmetric(horizontal: 10.w),
              height: 56.h,
              icon: AppAssets.login1,
              iconColor: AppColors.whiteColor,
              iconSize: 18.h,
            ).paddingSymmetrical(24.h, 24.h),
          )
        ],
      ),
    );
  }
}
