import 'package:flutter/material.dart';

@immutable
class PluriWaveMotion extends ThemeExtension<PluriWaveMotion> {
  const PluriWaveMotion({
    required this.quick,
    required this.normal,
    required this.emphasisCurve,
    required this.standardCurve,
  });

  final Duration quick;
  final Duration normal;
  final Curve emphasisCurve;
  final Curve standardCurve;

  static const dark = PluriWaveMotion(
    quick: Duration(milliseconds: 140),
    normal: Duration(milliseconds: 240),
    emphasisCurve: Curves.easeOutCubic,
    standardCurve: Curves.easeInOut,
  );

  @override
  PluriWaveMotion copyWith({
    Duration? quick,
    Duration? normal,
    Curve? emphasisCurve,
    Curve? standardCurve,
  }) {
    return PluriWaveMotion(
      quick: quick ?? this.quick,
      normal: normal ?? this.normal,
      emphasisCurve: emphasisCurve ?? this.emphasisCurve,
      standardCurve: standardCurve ?? this.standardCurve,
    );
  }

  @override
  ThemeExtension<PluriWaveMotion> lerp(covariant ThemeExtension<PluriWaveMotion>? other, double t) {
    if (other is! PluriWaveMotion) return this;
    return t < 0.5 ? this : other;
  }
}
