Skip to content

[Web]ImageFilter.blur not blurring #34364

@NicTanghe

Description

@NicTanghe

Imagefilter.blur not working as expected.

Code

import 'package:flutter_web/material.dart';
import 'package:flutter_web_ui/ui.dart';

void main() {
  runApp(new MaterialApp(home: new FrostedDemo()));
}

class FrostedDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Stack(
        children: <Widget>[
          new ConstrainedBox(
            constraints: const BoxConstraints.expand(),
            child: new FlutterLogo()
          ),
          new Center(
            child: new ClipRect(
              child: new BackdropFilter(
                filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
                child: new Container(
                  width: 200.0,
                  height: 200.0,
                  decoration: new BoxDecoration(
                    color: Colors.grey.shade200.withOpacity(0.5)
                  ),
                  child: new Center(
                    child: new Text(
                      'Frosted',
                      style: Theme.of(context).textTheme.display3
                    ),
                  ),
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

###Result
https://i.imgur.com/8d946ZK.png

Expected result
https://stackoverflow.com/questions/43550853/how-do-i-do-the-frosted-glass-effect-in-flutter

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions