import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:test_sa/new_views/swipe_module/dialoge/confirm_dialog.dart';

import '../controllers/providers/settings/setting_provider.dart';

extension BuildContextExtension on BuildContext {
  AppLocalizations get translation => AppLocalizations.of(this)!;

  List<String> get getIssues => [translation.reason1, translation.reason2, translation.reason3, translation.reason4, translation.reason5];

  bool get isDark => Provider.of<SettingProvider>(this).theme == "dark";

  bool get isAr => Provider.of<SettingProvider>(this).language == "ar";

  void showConfirmDialog(String message, {String? title, VoidCallback? onTap}) => showDialog(
        context: this,
        builder: (BuildContext cxt) => ConfirmDialog(
          message: message,
          onTap: onTap,
        ),
      );
}
