Skip to content

Instantly share code, notes, and snippets.

@prafullakumar
Last active March 12, 2020 09:55
Show Gist options
  • Save prafullakumar/68ab6ee46744acddb82dd1babb769d0b to your computer and use it in GitHub Desktop.
Save prafullakumar/68ab6ee46744acddb82dd1babb769d0b to your computer and use it in GitHub Desktop.
Dart: Blur effect
import 'dart:ui';
import 'package:flutter/material.dart';
class FrostedDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
body: Center (
child: Stack(
children: <Widget>[
Positioned.fromRect(
child: FlutterLogo(),
rect: Rect.fromLTRB(50, 50, 250, 250),
),
Positioned.fill(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(
color: Colors.white.withOpacity(0),
),
),
)
]
)
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment