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