Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import 'dart:ui';
import 'package:flutter/material.dart';
class BlurredBackground extends StatelessWidget {
final Widget child;
final Image image;
final double blurSize;
final Color maskColor;
const BlurredBackground({Key key, this.image, this.child, this.blurSize = 5.0, this.maskColor = Colors.transparent}) : super(key: key);
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand,
children: <Widget>[
child: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: this.blurSize,
sigmaY: this.blurSize
child: Container(
color: this.maskColor,
child: this.child,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment