// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import 'package:flutter/widgets.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';

class GradientTextStyle extends TextStyle {
  const GradientTextStyle({
    this.gradientColors,
    super.inherit,
    super.color,
    super.backgroundColor,
    super.fontSize,
    super.fontWeight,
    super.fontStyle,
    super.letterSpacing,
    super.wordSpacing,
    super.textBaseline,
    super.height,
    super.leadingDistribution,
    super.locale,
    super.foreground,
    super.background,
    super.shadows,
    super.fontFeatures,
    super.fontVariations,
    super.decoration,
    super.decorationColor,
    super.decorationStyle,
    super.decorationThickness,
    super.debugLabel,
    super.fontFamily,
    super.fontFamilyFallback,
    super.package,
    super.overflow,
  });

  factory GradientTextStyle.from(
    TextStyle? textStyle,
    MultiColor? gradientColors,
  ) =>
      GradientTextStyle(
        gradientColors: gradientColors,
        inherit: textStyle?.inherit ?? true,
        color: textStyle?.color,
        backgroundColor: textStyle?.backgroundColor,
        fontSize: textStyle?.fontSize,
        fontWeight: textStyle?.fontWeight,
        fontStyle: textStyle?.fontStyle,
        letterSpacing: textStyle?.letterSpacing,
        wordSpacing: textStyle?.wordSpacing,
        textBaseline: textStyle?.textBaseline,
        height: textStyle?.height,
        leadingDistribution: textStyle?.leadingDistribution,
        locale: textStyle?.locale,
        foreground: textStyle?.foreground,
        background: textStyle?.background,
        shadows: textStyle?.shadows,
        fontFeatures: textStyle?.fontFeatures,
        fontVariations: textStyle?.fontVariations,
        decoration: textStyle?.decoration,
        decorationColor: textStyle?.decorationColor,
        decorationStyle: textStyle?.decorationStyle,
        decorationThickness: textStyle?.decorationThickness,
        debugLabel: textStyle?.debugLabel,
        fontFamily: textStyle?.fontFamily,
        fontFamilyFallback: textStyle?.fontFamilyFallback,
        overflow: textStyle?.overflow,
      );

  final MultiColor? gradientColors;
}
