Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import 'dart:ui';
  2. import 'package:flutter/material.dart';
  3.  
  4. void main() {
  5. runApp(new MaterialApp(home: new FrostedDemo()));
  6. }
  7.  
  8. class FrostedDemo extends StatelessWidget {
  9. @override
  10. Widget build(BuildContext context) {
  11. return new Scaffold(
  12. body: new Stack(
  13. children: <Widget>[
  14. new ConstrainedBox(
  15. constraints: const BoxConstraints.expand(),
  16. child: new FlutterLogo()
  17. ),
  18. new Center(
  19. child: new ClipRect(
  20. child: new BackdropFilter(
  21. filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
  22. child: new Container(
  23. width: 200.0,
  24. height: 200.0,
  25. decoration: new BoxDecoration(
  26. color: Colors.grey.shade200.withOpacity(0.5)
  27. ),
  28. child: new Center(
  29. child: new Text(
  30. 'Frosted',
  31. style: Theme.of(context).textTheme.display3
  32. ),
  33. ),
  34. ),
  35. ),
  36. ),
  37. ),
  38. ],
  39. ),
  40. );
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement