-
-
Save kazhuyo/006fb423bd112a91a59d6c6b3c8a4a7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'dart:ui' as ui; | |
| void main() => runApp(new MaterialApp( | |
| home: new MyApp(), | |
| )); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return new Scaffold( | |
| body: new Stack( | |
| overflow: Overflow.visible, | |
| children: <Widget>[ | |
| new Container( | |
| decoration: new BoxDecoration( | |
| image: new DecorationImage( | |
| image: new ExactAssetImage('assets/pics/newbook.jpg'), | |
| fit: BoxFit.cover, | |
| ), | |
| ), | |
| child: new BackdropFilter( | |
| filter: new ui.ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0), | |
| child: new Container( | |
| decoration: new BoxDecoration(color: Colors.white.withOpacity(0.0)), | |
| ), | |
| ), | |
| ), | |
| new Positioned( | |
| top: 150.0, | |
| left: 60.0, | |
| child: new ClipPath( | |
| clipper: new customclipper(), | |
| child: new Container( | |
| height: 350.0, | |
| width: 300.0, | |
| color: Colors.white70, | |
| ), | |
| ), | |
| ), | |
| ], | |
| ), | |
| ); | |
| } | |
| } | |
| class customclipper extends CustomClipper<Path> { | |
| @override | |
| Path getClip(Size size) { | |
| var path = new Path(); | |
| path.lineTo(0.0, size.height - 20); | |
| path.quadraticBezierTo(0.0, size.height, 20.0, size.height); | |
| path.lineTo(size.width - 20.0, size.height); | |
| path.quadraticBezierTo(size.width, size.height, size.width, size.height - 20); | |
| path.lineTo(size.width, 50.0); | |
| path.quadraticBezierTo(size.width, 30.0, size.width - 20.0, 30.0); | |
| path.lineTo(20.0, 5.0); | |
| path.quadraticBezierTo(0.0, 0.0, 0.0, 20.0); | |
| return path; | |
| } | |
| @override | |
| bool shouldReclip(CustomClipper<Path> oldClipper) => false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment