import 'package:cargocalculaterapp/core/theme/colors/app_colors.dart';
import 'package:flutter/material.dart';

import 'app_text_styles.dart';

@immutable
class ThemeTextStyles extends ThemeExtension<ThemeTextStyles> {
  final TextStyle profileCategory;
  final TextStyle titleBig;
  final TextStyle authTitle;
  final TextStyle categoryName;
  final TextStyle bigTitle;
  final TextStyle statusText;
  final TextStyle authDesc;
  final TextStyle orderListTitle;
  final TextStyle orderTitle;
  final TextStyle statusNumber;
  final TextStyle statusDesc;
  final TextStyle secondaryText14;

  @override
  ThemeExtension<ThemeTextStyles> copyWith({
    TextStyle? profileCategory,
    TextStyle? titleBig,
    TextStyle? authTitle,
    TextStyle? categoryName,
    TextStyle? bigTitle,
    TextStyle? statusText,
    TextStyle? authDesc,
    TextStyle? orderListTitle,
    TextStyle? orderTitle,
    TextStyle? statusNumber,
    TextStyle? statusDesc,
    TextStyle? secondaryText14,
  }) {
    return ThemeTextStyles(
      profileCategory: profileCategory ?? this.profileCategory,
      titleBig: titleBig ?? this.titleBig,
      authTitle: authTitle ?? this.authTitle,
      categoryName: categoryName ?? this.categoryName,
      bigTitle: bigTitle ?? this.bigTitle,
      statusText: statusText ?? this.statusText,
      authDesc: authDesc ?? this.authDesc,
      orderListTitle: orderListTitle ?? this.orderListTitle,
      orderTitle: orderTitle ?? this.orderTitle,
      statusNumber: statusNumber ?? this.statusNumber,
      statusDesc: statusDesc ?? this.statusDesc,
      secondaryText14: secondaryText14 ?? this.secondaryText14,
    );
  }

  const ThemeTextStyles({
    required this.profileCategory,
    required this.titleBig,
    required this.authTitle,
    required this.categoryName,
    required this.bigTitle,
    required this.statusText,
    required this.authDesc,
    required this.orderListTitle,
    required this.orderTitle,
    required this.statusNumber,
    required this.statusDesc,
    required this.secondaryText14,
  });

  static get light => const ThemeTextStyles(
    profileCategory: AppTextStyles.profileCategory,
    titleBig: AppTextStyles.titleBig,
    authTitle: AppTextStyles.authTitle,
    categoryName: AppTextStyles.categoryName,
    bigTitle: AppTextStyles.bigTitle,
    statusText: AppTextStyles.statusText,
    authDesc: AppTextStyles.authDesc,
    orderListTitle: AppTextStyles.orderListTitle,
    orderTitle: AppTextStyles.orderTitle,
    statusNumber: AppTextStyles.statusNumber,
    statusDesc: AppTextStyles.statusDesc,
    secondaryText14: AppTextStyles.secondaryText14,
  );

  static get dark => ThemeTextStyles(
    profileCategory: AppTextStyles.profileCategory.copyWith(
      color: DarkThemeColors.textColor,
    ),
    titleBig: AppTextStyles.titleBig.copyWith(color: DarkThemeColors.textColor),
    authTitle: AppTextStyles.authTitle.copyWith(color: DarkThemeColors.textColor),
    categoryName: AppTextStyles.categoryName.copyWith(color: DarkThemeColors.textColor),
    bigTitle: AppTextStyles.bigTitle.copyWith(color: DarkThemeColors.textColor),
    statusText: AppTextStyles.statusText.copyWith(color: DarkThemeColors.buttonColorText),
    authDesc: AppTextStyles.authDesc.copyWith(color: DarkThemeColors.secondaryText),
    orderListTitle: AppTextStyles.orderListTitle.copyWith(color: DarkThemeColors.secondaryText),
    orderTitle: AppTextStyles.orderTitle.copyWith(color: DarkThemeColors.textColor),
    statusNumber: AppTextStyles.statusNumber.copyWith(color: DarkThemeColors.secondaryText),
    statusDesc: AppTextStyles.statusDesc.copyWith(color: DarkThemeColors.textColor),
    secondaryText14: AppTextStyles.secondaryText14.copyWith(color: DarkThemeColors.lightSecondary),
  );

  @override
  ThemeTextStyles lerp(ThemeExtension<ThemeTextStyles>? other, double t) {
    if (other is! ThemeTextStyles) return this;

    return ThemeTextStyles(
      profileCategory: TextStyle.lerp(profileCategory, other.profileCategory, t)!,
      titleBig: TextStyle.lerp(titleBig, other.titleBig, t)!,
      authTitle: TextStyle.lerp(authTitle, other.authTitle, t)!,
      categoryName: TextStyle.lerp(categoryName, other.categoryName, t)!,
      bigTitle: TextStyle.lerp(bigTitle, other.bigTitle, t)!,
      statusText: TextStyle.lerp(statusText, other.statusText, t)!,
      authDesc: TextStyle.lerp(authDesc, other.authDesc, t)!,
      orderListTitle: TextStyle.lerp(orderListTitle, other.orderListTitle, t)!,
      orderTitle: TextStyle.lerp(orderTitle, other.orderTitle, t)!,
      statusNumber: TextStyle.lerp(statusNumber, other.statusNumber, t)!,
      statusDesc: TextStyle.lerp(statusDesc, other.statusDesc, t)!,
      secondaryText14: TextStyle.lerp(secondaryText14, other.secondaryText14, t)!,
    );
  }
}
