create project
This commit is contained in:
55
frontend/lib/widgets/glass_card.dart
Normal file
55
frontend/lib/widgets/glass_card.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme/colors.dart';
|
||||
|
||||
class GlassCard extends StatelessWidget {
|
||||
final Widget child;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final EdgeInsetsGeometry? margin;
|
||||
final double borderRadius;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final Color? borderColor;
|
||||
final List<BoxShadow>? boxShadow;
|
||||
|
||||
const GlassCard({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.padding,
|
||||
this.margin,
|
||||
this.borderRadius = 16,
|
||||
this.width,
|
||||
this.height,
|
||||
this.borderColor,
|
||||
this.boxShadow,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: width,
|
||||
height: height,
|
||||
margin: margin,
|
||||
padding: padding ?? const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.cardBg,
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
border: Border.all(color: borderColor ?? Colors.white.withOpacity(0.8)),
|
||||
boxShadow: boxShadow ?? [
|
||||
BoxShadow(
|
||||
color: AppColors.brand.withOpacity(0.06),
|
||||
blurRadius: 32,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user