import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_images.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/shared/components/bloc/toggle/toggle_bloc.dart';
import 'package:tanami_app/shared/components/text_widget.dart';

import '../../../../../shared/components/toggle_widget.dart';
import 'settings_list_tile_item.dart';

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

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(
        horizontal: 16,
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          TextWidget().text14W600(
            AppText.generalText,
            clr: AppColor.hintTextColor,
          ),
          const Gap(5),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              TextWidget().text14W600(
                AppText.notificationText,
                clr: AppColor.textLabelColor,
              ),
              BlocProvider(
                create: (_) => ToggleBloc(),
                child: const CustomToggle(),
              )
            ],
          ),
          const Gap(12),
          SettingsListItem(
            onTapFunc: () {
              goRouter.pushNamed(RouteName.languageChangeScreen);
            },
            icon: AppImages.languageIcon,
            title: AppText.languageText,
            trailing: AppText.englishText,
          ),
          const Gap(10),
          const Divider(
            color: AppColor.academyCardTextColor,
          ),
        ],
      ),
    );
  }
}
