Complete the code to apply a blur effect using BackdropFilter.
BackdropFilter( filter: ImageFilter.blur(sigmaX: [1], sigmaY: 5), child: Container(color: Colors.black.withOpacity(0)), )
The sigmaX controls the horizontal blur amount. Setting it to 5 applies a moderate blur.
Complete the code to import the package needed for ImageFilter.
import 'package:flutter/material.dart'; import '[1]';
The dart:ui package provides the ImageFilter class needed for blur effects.
Fix the error in the code by completing the missing widget to apply the blur effect.
Stack(
children: [
Image.asset('background.jpg'),
[1](
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(color: Colors.white.withOpacity(0.2)),
),
],
)The BackdropFilter widget applies a filter to the background behind its child.
Fill both blanks to create a blurred background with a semi-transparent overlay.
Stack(
children: [
Image.network('https://example.com/image.jpg'),
[1](
filter: ImageFilter.blur(sigmaX: 8, sigmaY: 8),
child: Container(color: Colors.black.withOpacity([2])),
),
],
)Use BackdropFilter to blur the background and set the overlay opacity to 0.3 for a subtle dark effect.
Fill all three blanks to create a blurred circular avatar with a blur radius and opacity.
ClipOval(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: [1], sigmaY: [2]),
child: Container(
width: 100,
height: 100,
color: Colors.white.withOpacity([3]),
child: Image.asset('avatar.png'),
),
),
)Using sigmaX and sigmaY as 6 applies a strong blur. Opacity 0.5 gives a balanced transparent overlay.