import 'package:flutter/material.dart';
import 'package:food_delivery_client/core/constants/app_locale_keys.dart';
import 'package:food_delivery_client/core/core.dart';

class AppThemeTextStyles extends ThemeExtension<AppThemeTextStyles> {
  //Regular fonts
  final TextStyle size14Regular;
  final TextStyle size14Regular1;


  //Medium

  final TextStyle size16Medium;

  //SemiBold

  final TextStyle size16SemiBold;
  final TextStyle size24SemiBold;
  final TextStyle size24SemiBold1;


  //Bold

  final TextStyle size14Bold;
  final TextStyle size24Bold;

  //Black
  final TextStyle size64Black;

  AppThemeTextStyles({
    required this.size14Regular,
    required this.size14Regular1,
    required this.size16Medium,
    required this.size16SemiBold,
    required this.size24SemiBold,
    required this.size24SemiBold1,
    required this.size14Bold,
    required this.size24Bold,
    required this.size64Black,
  });

  static const String _fontBlack = AppLocaleKeys.fontBlack;
  static const String _fontBold = AppLocaleKeys.fontBold;
  static const String _fontSemiBold = AppLocaleKeys.fontSemiBold;
  static const String _fontMedium = AppLocaleKeys.fontMedium;
  static const String _fontRegular = AppLocaleKeys.fontRegular;

  static AppThemeTextStyles light = AppThemeTextStyles(
    size14Regular: TextStyle(
      fontSize: 14,
      height: 1.6,
      fontWeight: FontWeight.w400,
      fontFamily: _fontRegular,
      color: AppColors.c151B33,
    ),
    size14Regular1: TextStyle(
      fontSize: 14,
      height: 1.6,
      fontWeight: FontWeight.w400,
      fontFamily: _fontRegular,
      color: AppColors.c151B33,
    ),
    size16Medium: TextStyle(
      fontSize: 16,
      height: 1.3,
      fontWeight: FontWeight.w500,
      fontFamily: _fontMedium,
      color: AppColors.c151B33,
    ),
    size16SemiBold: TextStyle(
      fontSize: 16,
      fontWeight: FontWeight.w600,
      fontFamily: _fontSemiBold,
    ),
    size24SemiBold: TextStyle(
      fontSize: 24,
      height: 1.3,
      letterSpacing: -.48,
      fontWeight: FontWeight.w600,
      fontFamily: _fontSemiBold,
      color: AppColors.c1A202C,
    ),
    size24SemiBold1: TextStyle(
      fontSize: 24,
      height: 1.25,
      letterSpacing: -.48,
      fontWeight: FontWeight.w600,
      fontFamily: _fontSemiBold,
      color: AppColors.c000000,
    ),
    size14Bold: TextStyle(
      fontSize: 14,
      fontWeight: FontWeight.w700,
      fontFamily: _fontBold,
    ),
    size24Bold: TextStyle(
      fontSize: 24,
      height: 1.3,
      fontWeight: FontWeight.w700,
      fontFamily: _fontBold,
      color: AppColors.c151B33,
    ),
    size64Black: TextStyle(
      fontSize: 64,
      fontWeight: FontWeight.w900,
      fontFamily: _fontBlack,
      color: AppColors.cFFFFFF,
    ),
  );

  static AppThemeTextStyles dark = AppThemeTextStyles(
    size14Regular: TextStyle(
      fontSize: 14,
      height: 1.6,
      fontWeight: FontWeight.w400,
      fontFamily: _fontRegular,
      color: AppColors.cFFFFFF,
    ),
    size14Regular1: TextStyle(
      fontSize: 14,
      height: 1.6,
      fontWeight: FontWeight.w400,
      fontFamily: _fontRegular,
      color: AppColors.cA9A9A9,
    ),
    size16Medium: TextStyle(
      fontSize: 16,
      height: 1.3,
      fontWeight: FontWeight.w500,
      fontFamily: _fontMedium,
      color: AppColors.cFFFFFF,
    ),
    size16SemiBold: TextStyle(
      fontSize: 16,
      fontWeight: FontWeight.w600,
      fontFamily: _fontSemiBold,
    ),
    size24SemiBold: TextStyle(
      fontSize: 24,
      height: 1.3,
      letterSpacing: -.48,
      fontWeight: FontWeight.w600,
      fontFamily: _fontSemiBold,
      color: AppColors.cFFFFFF,
    ),
    size24SemiBold1: TextStyle(
      fontSize: 24,
      height: 1.25,
      letterSpacing: -.48,
      fontWeight: FontWeight.w600,
      fontFamily: _fontSemiBold,
      color: AppColors.cFFFFFF,
    ),
    size14Bold: TextStyle(
      fontSize: 14,
      fontWeight: FontWeight.w700,
      fontFamily: _fontBold,
    ),
    size24Bold: TextStyle(
      fontSize: 24,
      height: 1.3,
      fontWeight: FontWeight.w700,
      fontFamily: _fontBold,
      color: AppColors.cFFFFFF,
    ),
    size64Black: TextStyle(
      fontSize: 64,
      fontWeight: FontWeight.w900,
      fontFamily: _fontBlack,
      color: AppColors.cFFFFFF,
    ),
  );

  @override
  ThemeExtension<AppThemeTextStyles> copyWith({
    TextStyle? size14Regular,
    TextStyle? size14Regular1,
    TextStyle? size16Medium,
    TextStyle? size16SemiBold,
    TextStyle? size24SemiBold,
    TextStyle? size24SemiBold1,
    TextStyle? size14Bold,
    TextStyle? size24Bold,
    TextStyle? size64Black,
  }) {
    return AppThemeTextStyles(
      size14Regular: size14Regular ?? this.size14Regular,
      size14Regular1: size14Regular1 ?? this.size14Regular1,
      size16Medium: size16Medium ?? this.size16Medium,
      size16SemiBold: size16SemiBold ?? this.size16SemiBold,
      size24SemiBold: size24SemiBold ?? this.size24SemiBold,
      size24SemiBold1: size24SemiBold1 ?? this.size24SemiBold1,
      size14Bold: size14Bold ?? this.size14Bold,
      size24Bold: size24Bold ?? this.size24Bold,
      size64Black: size64Black ?? this.size64Black,
    );
  }

  @override
  ThemeExtension<AppThemeTextStyles> lerp(
    covariant ThemeExtension<AppThemeTextStyles>? other,
    double t,
  ) {
    if (other is! AppThemeTextStyles) return this;
    return AppThemeTextStyles(
      size14Regular: TextStyle.lerp(size14Regular, other.size14Regular, t)!,
      size14Regular1: TextStyle.lerp(size14Regular1, other.size14Regular1, t)!,
      size16Medium: TextStyle.lerp(size16Medium, other.size16Medium, t)!,
      size16SemiBold: TextStyle.lerp(size16SemiBold, other.size16SemiBold, t)!,
      size24SemiBold: TextStyle.lerp(size24SemiBold, other.size24SemiBold, t)!,
      size24SemiBold1: TextStyle.lerp(size24SemiBold1, other.size24SemiBold1, t)!,
      size14Bold: TextStyle.lerp(size14Bold, other.size14Bold, t)!,
      size24Bold: TextStyle.lerp(size24Bold, other.size24Bold, t)!,
      size64Black: TextStyle.lerp(size64Black, other.size64Black, t)!,
    );
  }
}
