import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kmobile/config/theme_type.dart';
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
import '../../../l10n/app_localizations.dart';

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

  @override
  Widget build(BuildContext context) {
    return SimpleDialog(
      title: Text(AppLocalizations.of(context).selectThemeColor),
      children: [
        ListTile(
          leading: const CircleAvatar(backgroundColor: Colors.deepPurple),
          title: Text(AppLocalizations.of(context).violet),
          onTap: () {
            context.read<ThemeCubit>().changeTheme(ThemeType.violet);
            Navigator.pop(context);
          },
        ),
        ListTile(
          leading: const CircleAvatar(backgroundColor: Colors.green),
          title: Text(AppLocalizations.of(context).green),
          onTap: () {
            context.read<ThemeCubit>().changeTheme(ThemeType.green);
            Navigator.pop(context);
          },
        ),
        ListTile(
          leading: const CircleAvatar(backgroundColor: Colors.orange),
          title: Text(AppLocalizations.of(context).orange),
          onTap: () {
            context.read<ThemeCubit>().changeTheme(ThemeType.orange);
            Navigator.pop(context);
          },
        ),
        ListTile(
          leading: const CircleAvatar(backgroundColor: Colors.blue),
          title: Text(AppLocalizations.of(context).blue),
          onTap: () {
            context.read<ThemeCubit>().changeTheme(ThemeType.blue);
            Navigator.pop(context);
          },
        ),
      ],
    );
  }
}
