Skip to content

[web][html] ImageFilter.matrix in BackdropFilter does not work #109207

@guchengxi1994

Description

@guchengxi1994

I was using magnifier with BackdropFilter and ImageFilter.matrix , but when I run codes with --web-renderer html , ImageFilter.matrix did not work well. Here are sample codes.

Code sample
import 'dart:ui';

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Homepage(),
  ));
}

class Homepage extends StatelessWidget {
  const Homepage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Matrix4 newMatrix = Matrix4.identity()..scale(1.5);

    return Scaffold(
        appBar: AppBar(title: Text("BackdropFilterDemo")),
        body: Stack(
          children: <Widget>[
            Container(
              alignment: Alignment.center,
              child: Text("BackdropFilterDemo" * 10),
            ),
            BackdropFilter(
              // filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
              filter: ImageFilter.matrix(newMatrix.storage),
              child: Container(
                color: Colors.white.withAlpha(0),
              ),
            )
          ],
        ));
  }
}

Here are results.

HTML Canvaskit

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: web_htmlHTML rendering backend for Webengineflutter/engine related. See also e: labels.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: solvedIssue is closed as solvedteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions