50 lines
1.2 KiB
Dart
50 lines
1.2 KiB
Dart
import 'dart:ui';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
class GlassCard extends StatelessWidget {
|
|
final Widget child;
|
|
final double? width;
|
|
final double? height;
|
|
final EdgeInsetsGeometry padding;
|
|
|
|
const GlassCard({
|
|
super.key,
|
|
required this.child,
|
|
this.width,
|
|
this.height,
|
|
this.padding = const EdgeInsets.all(16),
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ClipRRect(
|
|
borderRadius: BorderRadius.circular(20),
|
|
child: BackdropFilter(
|
|
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
|
child: Container(
|
|
width: width,
|
|
height: height,
|
|
padding: padding,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white.withOpacity(0.65),
|
|
borderRadius: BorderRadius.circular(20),
|
|
border: Border.all(
|
|
color: Colors.white.withOpacity(0.6),
|
|
width: 1.0,
|
|
),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withOpacity(0.03),
|
|
blurRadius: 15,
|
|
offset: const Offset(0, 5),
|
|
),
|
|
],
|
|
),
|
|
child: child,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|