// ignore_for_file: must_be_immutable import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class FikoYTButtonTheme extends ThemeExtension { FikoYTButtonTheme({ this.textColor, this.textStrokeColor, this.backgroundColor, this.borderColor, this.textStrokeWidth, this.fontSize, this.radius, borderRadius, this.edgePadding, this.textAlign, this.fontWeight, animationDuration, this.textShadow, this.elevation, }); Color? textColor; Color? textStrokeColor; Color? backgroundColor; Color? borderColor; double? textStrokeWidth; double? fontSize; double? radius; double? elevation; Duration? animationDuration; List? textShadow; BorderRadiusGeometry? borderRadius; EdgeInsetsGeometry? edgePadding; TextAlign? textAlign; FontWeight? fontWeight; @override FikoYTButtonTheme copyWith({ Color? textColor, Color? textStrokeColor, Color? arkaPlanRengi, Color? borderColor, double? textStrokeWidth, double? fontSize, double? radius, double? elevation, Duration? animationDuration, BorderRadiusGeometry? borderRadius, EdgeInsetsGeometry? edgePadding, TextAlign? textAlign, FontWeight? fontWeight, List? textShadow, }) { return FikoYTButtonTheme( textColor: textColor ?? this.textColor, textStrokeColor: textStrokeColor ?? this.textStrokeColor, backgroundColor: arkaPlanRengi ?? backgroundColor, animationDuration: animationDuration ?? this.animationDuration, borderRadius: borderRadius ?? this.borderRadius, fontSize: fontSize ?? this.fontSize, textStrokeWidth: textStrokeWidth ?? this.textStrokeWidth, edgePadding: edgePadding ?? this.edgePadding, fontWeight: fontWeight ?? this.fontWeight, radius: radius ?? this.radius, borderColor: borderColor ?? this.borderColor, textAlign: textAlign ?? this.textAlign, textShadow: textShadow ?? this.textShadow, elevation: elevation ?? this.elevation, ); } static FikoYTButtonTheme karistir( FikoYTButtonTheme tema1, FikoYTButtonTheme gecerliTema, ) { FikoYTButtonTheme rslt = FikoYTButtonTheme(); rslt.textColor = gecerliTema.textColor ?? tema1.textColor; rslt.textStrokeColor = gecerliTema.textStrokeColor ?? tema1.textStrokeColor; rslt.backgroundColor = gecerliTema.backgroundColor ?? tema1.backgroundColor; rslt.animationDuration = gecerliTema.animationDuration ?? tema1.animationDuration; rslt.borderRadius = gecerliTema.borderRadius ?? tema1.borderRadius; rslt.fontSize = gecerliTema.fontSize ?? tema1.fontSize; rslt.textStrokeWidth = gecerliTema.textStrokeWidth ?? tema1.textStrokeWidth; rslt.edgePadding = gecerliTema.edgePadding ?? tema1.edgePadding; rslt.fontWeight = gecerliTema.fontWeight ?? tema1.fontWeight; rslt.radius = gecerliTema.radius ?? tema1.radius; rslt.borderColor = gecerliTema.borderColor ?? tema1.borderColor; rslt.textAlign = gecerliTema.textAlign ?? tema1.textAlign; rslt.textShadow = gecerliTema.textShadow ?? tema1.textShadow; return rslt; } @override static FikoYTButtonTheme lerp(ThemeExtension other, double t) { if (other is! FikoYTButtonTheme) { return this; } return FikoYTButtonTheme( textColor: Color.lerp(textColor, other.textColor, t), textStrokeColor: Color.lerp(textStrokeColor, other.textStrokeColor, t), backgroundColor: Color.lerp(backgroundColor, other.backgroundColor, t), animationDuration: lerpDuration(animationDuration ?? Duration.zero, other.animationDuration ?? Duration.zero, t), borderRadius: BorderRadius.lerp(borderRadius?.resolve(TextDirection.ltr), other.borderRadius?.resolve(TextDirection.ltr), t), fontSize: lerpDouble(fontSize, other.fontSize, t), elevation: lerpDouble(elevation, other.elevation, t), textStrokeWidth: lerpDouble(textStrokeWidth, other.textStrokeWidth, t), edgePadding: EdgeInsets.lerp(edgePadding?.resolve(TextDirection.ltr), other.edgePadding?.resolve(TextDirection.ltr), t), fontWeight: FontWeight.lerp(fontWeight, other.fontWeight, t), radius: lerpDouble(radius, other.radius, t), borderColor: Color.lerp(borderColor, other.borderColor, t), textAlign: textAlign, textShadow: Shadow.lerpList(textShadow, other.textShadow, t), ); } }