import 'dart:io'; import 'dart:ui'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class FikoYTCard extends StatelessWidget { const FikoYTCard({super.key, children}) : children = children ?? const []; final List children; @override Widget build(BuildContext context) { return Container( margin: const EdgeInsets.all(5.0), decoration: BoxDecoration( color: Theme.of(context).extension()?.cardBackgroundColor, //Colors.white, borderRadius: const BorderRadius.all( Radius.circular(5), ), boxShadow: [ BoxShadow( color: Theme.of(context).extension()!.shadowColor!, offset: const Offset(0, 0), spreadRadius: -1, blurRadius: 5.0, blurStyle: BlurStyle.outer, ), ], // border: Border.all( // color: Theme.of(context).extension()!.cardBackgroundColor!.withAlpha(255), // ), ), child: Column( children: [], ), ); } } class FikoYTCardTheme extends ThemeExtension { FikoYTCardTheme({ this.backgroundColor, this.borderColor, this.textStrokeWidth, this.fontSize, this.radius, borderRadius, this.edgePadding, this.textAlign, this.fontWeight, animationDuration, this.textShadow, }); Color? backgroundColor; Color? borderColor; double? textStrokeWidth; double? fontSize; double? radius; Duration? animationDuration; List? textShadow; BorderRadiusGeometry? borderRadius; EdgeInsetsGeometry? edgePadding; TextAlign? textAlign; FontWeight? fontWeight; @override FikoYTCardTheme copyWith({ Color? textColor, Color? textStrokeColor, Color? backgroundColor, Color? borderColor, double? textStrokeWidth, double? fontSize, double? radius, Duration? animationDuration, BorderRadiusGeometry? borderRadius, EdgeInsetsGeometry? edgePadding, TextAlign? textAlign, FontWeight? fontWeight, List? textShadow, }) { return FikoYTCardTheme( backgroundColor: backgroundColor ?? this.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, ); } static FikoYTCardTheme karistir( FikoYTCardTheme tema1, FikoYTCardTheme gecerliTema, ) { FikoYTCardTheme rslt = FikoYTCardTheme(); 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 FikoYTCardTheme lerp(ThemeExtension other, double t) { if (other is! FikoYTCardTheme) { return this; } return FikoYTCardTheme( 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), 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: textShadow, ); } }