import 'dart:ui'; import 'package:flutter/material.dart'; class FikoYTDrawer extends StatelessWidget { final List childs; final FikoYTDrawerTheme? tema; const FikoYTDrawer({super.key, required this.childs, this.tema}); @override Widget build(BuildContext context) { return SafeArea( child: Drawer( elevation: tema?.elevation ?? 16.0, // Varsayılan yükseklik width: tema?.width ?? 250.0, // Varsayılan genişlik shape: tema?.shape ?? RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(right: Radius.circular(16.0))), backgroundColor: tema?.backgroundColor ?? Colors.white.withAlpha(155), shadowColor: tema?.shadowColor, surfaceTintColor: tema?.surfaceTintColor, child: Column(children: childs), ), ); } } class FikoYTDrawerTheme extends ThemeExtension { final double? elevation; final double? width; final ShapeBorder? shape; final Color? backgroundColor; final Color? shadowColor; final Color? surfaceTintColor; FikoYTDrawerTheme({this.elevation, this.width, this.shape, this.backgroundColor, this.shadowColor, this.surfaceTintColor}); @override ThemeExtension copyWith({ double? elevation, double? width, ShapeBorder? shape, Color? arkaPlanRengi, Color? shadowColor, }) { return FikoYTDrawerTheme( elevation: elevation ?? this.elevation, width: this.width, shape: this.shape, backgroundColor: backgroundColor, shadowColor: this.shadowColor, surfaceTintColor: this.shadowColor, ); } @override ThemeExtension lerp(covariant ThemeExtension? other, double t) { if (other is! FikoYTDrawerTheme) { return this; } return FikoYTDrawerTheme( elevation: lerpDouble(elevation, other.elevation, t), width: lerpDouble(width, other.width, t), shape: ShapeBorder.lerp(shape, other.shape, t), backgroundColor: Color.lerp(backgroundColor, other.backgroundColor, t), shadowColor: Color.lerp(shadowColor, other.shadowColor, t), surfaceTintColor: Color.lerp(surfaceTintColor, other.surfaceTintColor, t), ); } }