-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: silverengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
I'm having an issue with a GridView of blurred tiles using BackdropFilter with ImageFilter.blur where any surrounding color leaks into them:
Here is a Dartpad example: https://dartpad.dev/?id=1196002918293fdd251557b037d2d786
Here is the code sample:
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ImageFilter Color Leak Issue',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: const Text('ImageFilter.blur Color Leak Issue'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: Container(
color: Colors.white,
width: double.infinity,
child: FittedBox(
fit: BoxFit.contain,
child: Padding(
padding: const EdgeInsets.all(40),
child: Container(
width: 400,
height: 400,
color: const Color(0xFF0000FF),
child: GridView.count(
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
crossAxisCount: 3,
children: tiles(),
),
),
),
),
),
),
Expanded(
child: Container(
color: Colors.black,
width: double.infinity,
child: FittedBox(
fit: BoxFit.contain,
child: Padding(
padding: const EdgeInsets.all(40),
child: Container(
width: 400,
height: 400,
color: const Color(0xFF0000FF),
child: GridView.count(
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
crossAxisCount: 3,
children: tiles(),
),
),
),
),
),
),
],
),
),
);
}
List<Widget> tiles() => List<Widget>.generate(
9,
(_) => ClipRRect(
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 20,
sigmaY: 20,
),
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(12),
),
),
),
),
);
}flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.3, on macOS 11.5.1 20G80 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.66.0-insider)
[✓] Connected device (1 available)
! Device emulator-5562 is offline.
[✓] HTTP Host Availability
• No issues found!
Moncader, Maatteogekko, red282, ercantomac, zssnyder and 16 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: silverengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Type
Projects
Status
Done

