Blur Effect On Background Image using Backdrop Filter
Complete Code For Blur Effect On Background Image using Backdrop Filter In Flutter
Main.dart
import 'package:flutter/material.dart'; import 'dart:ui'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( appBar: AppBar( backgroundColor: Colors.red[300], title: Text('Blur Background Image')), body: Center( child: Container( constraints: BoxConstraints.expand(), decoration: BoxDecoration( image: DecorationImage( image: NetworkImage("https://flutter-examples.com/wp-content/uploads/2020/02/dice.jpg"), fit: BoxFit.cover) ), child: ClipRRect( child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), child: Container( alignment: Alignment.center, color: Colors.grey.withOpacity(0.1), child: Text( "Blur Background Image", textAlign: TextAlign.center, style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold), ), ), ), ), ) ) ) ); } }