import 'package:flutter/material.dart'; class ClipLogin14 extends StatelessWidget { const ClipLogin14({ Key? key,}) : super(key: key); @override Widget build(BuildContext context) { Size screenSize=MediaQuery.of(context).size; Color myColor=Colors.brown; return SafeArea( child: Scaffold( body: Stack( children: [ CustomPaint( painter: _ClipShadowShadowPainter( clipper: WaveClipper(), shadow: const Shadow( color: Colors.grey, offset: Offset(0, 0), blurRadius: 20), ), child: ClipPath(child: Container(width: screenSize.width, height: screenSize.height,color: myColor,) , clipper: WaveClipper()), ), Container( alignment: Alignment.topLeft, margin: EdgeInsets.only(top: screenSize.height*.2,left: 40), child: Text('Sign In',style: TextStyle( fontSize: 40,color: myColor, shadows: const [ Shadow( color: Colors.grey, offset: Offset(0, 5), blurRadius: 10 ) ] ), ), ), Padding( padding: EdgeInsets.only(top: screenSize.height*.3,left: 40,right: 60), child: Column( children: [ TextFormField( style: TextStyle(color: myColor,fontSize: 25), decoration: InputDecoration( labelText: "Email", labelStyle: TextStyle(color: myColor,fontSize: 20), enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: myColor,width: 2) ) ), ), SizedBox(height: 15,), TextFormField( obscureText: true, style: TextStyle(color: myColor,fontSize: 25), decoration: InputDecoration( labelText: "Password", labelStyle: TextStyle(color: myColor,fontSize: 20), enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: myColor,width: 2) ) ), ), Container( margin: EdgeInsets.only(top: 20), alignment: Alignment.centerRight, child: Text('Forgot Password?',style: TextStyle(color: myColor),), ), SizedBox(height: 15,), ElevatedButton( onPressed: (){}, style: ElevatedButton.styleFrom( padding: EdgeInsets.symmetric(vertical: 15,horizontal: 60), backgroundColor: Colors.white ), child: Text("Sign In",style: TextStyle( color: myColor, fontSize: 25, fontWeight: FontWeight.bold),), ), const SizedBox(height: 10,), Text("Don't have an account?",style: TextStyle(color: myColor),), Text('Register',style: TextStyle( color: myColor, fontSize: 18, decoration: TextDecoration.underline),) ], ), ) ] ), ), ); } } class _ClipShadowShadowPainter extends CustomPainter { final Shadow shadow; final CustomClipper clipper; _ClipShadowShadowPainter({required this.shadow, required this.clipper}); @override void paint(Canvas canvas, Size size) { var paint = shadow.toPaint(); var clipPath = clipper.getClip(size).shift(shadow.offset); canvas.drawPath(clipPath, paint); } @override bool shouldRepaint(CustomPainter oldDelegate) { return true; } } class WaveClipper extends CustomClipper{ @override Path getClip(Size size) { Path path =Path(); path.lineTo(0, size.height*0.08); path.quadraticBezierTo(size.width/9*2.5, size.height*0.13, size.width/9*5, size.height*.07); path.quadraticBezierTo(size.width/9*7.5, size.height*.01, size.width/9*7.7, size.height*.2); path.quadraticBezierTo(size.width/9*8, size.height*.45, size.width,size.height*.5); path.quadraticBezierTo(size.width/9*7, size.height*.8, size.width/9*8,size.height); path.quadraticBezierTo(size.width/9*5, size.height*.9, size.width/9*2,size.height*.95); path.quadraticBezierTo(0, size.height, size.width/9*.8,size.height*.85); path.quadraticBezierTo(size.width/9*1.5, size.height*.65, 0,size.height/2); path.lineTo(0, size.height); path.lineTo(size.width, size.height); path.lineTo(size.width, 0); return path; } @override bool shouldReclip(covariant CustomClipper oldClipper) { return true; } }