import 'package:flutter/material.dart'; class ClipLogin12 extends StatefulWidget { const ClipLogin12({Key? key}) : super(key: key); @override State createState() => _ClipLogin12State(); } class _ClipLogin12State extends State { @override Widget build(BuildContext context) { Size screenSize=MediaQuery.of(context).size; const myColor=Colors.purple; return Scaffold( body: SingleChildScrollView( child: Stack( children: [ // ClipPath( // clipper: MyClipper3(), // child: Container(height: screenSize.height/2,width: screenSize.width,color:myColor.withOpacity(.5) ,), // ), // ClipPath( // clipper: MyClipper2(), // child: Container(height: screenSize.height/2,width: screenSize.width,color:myColor.withOpacity(.5) ,), // ), ClipPath( clipper: MyClipper(), child: Container(height: screenSize.height,width: screenSize.width,color:myColor.shade800 ,), ), ClipPath( clipper: MyClipper4(), child: Container(height: screenSize.height,width: screenSize.width,color:myColor.shade800 ,), ), Container( margin: EdgeInsets.only(top: screenSize.height*.15,), alignment: Alignment.center, child: Text('Welcome',style: TextStyle( color: myColor.shade800,fontSize: 40, shadows: [ Shadow( color: Colors.black.withOpacity(0.5), offset: const Offset(0, 5), blurRadius: 10 ) ] ), ), ), Container( alignment: Alignment.center, margin: EdgeInsets.only(top: screenSize.height*.25), child: Text('Sign In',style: TextStyle( color: myColor,fontSize: 35,fontWeight: FontWeight.bold ),), ), Container( padding: EdgeInsets.only(top: screenSize.height*0.33,left: 30,right: 30,bottom: 20), child: Container( decoration: BoxDecoration(borderRadius: BorderRadius.circular(10)), child: Column( children: [ Padding( padding: EdgeInsets.only(top: 20,left: 10,right: 20), child: Column( children: [ TextFormField( scrollPadding: EdgeInsets.only(bottom:MediaQuery.of(context).viewInsets.bottom), decoration: InputDecoration( labelText: 'Email', labelStyle: const TextStyle(color: myColor), enabledBorder: OutlineInputBorder( borderSide: const BorderSide(color: myColor, width: 2), borderRadius: BorderRadius.circular(10), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: myColor.shade800,width: 2), borderRadius: BorderRadius.circular(10) ) ), ), const SizedBox(height: 15,), TextFormField( scrollPadding: EdgeInsets.only(bottom:MediaQuery.of(context).viewInsets.bottom), obscureText: true, decoration: InputDecoration( labelText: 'Password', labelStyle: const TextStyle(color: myColor), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: myColor, width: 2), borderRadius: BorderRadius.circular(10), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: myColor.shade800,width: 2), borderRadius: BorderRadius.circular(10) ) ), ), const SizedBox(height: 15,), Container( margin: const EdgeInsets.only(right: 20), alignment: Alignment.centerRight, child: Text('Forgot Password?',style: TextStyle(color: myColor.shade800),)), const SizedBox(height: 15,), Container( width: double.infinity, decoration: BoxDecoration(borderRadius: BorderRadius.circular(30)), child: ElevatedButton( onPressed: (){}, child: const Text('Sign In',style: TextStyle(color: myColor,fontSize: 25),), style: ElevatedButton.styleFrom( padding: const EdgeInsets.symmetric(horizontal: 50,vertical: 15), backgroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10), side: BorderSide(color: myColor,width: 2) ) ), ), ), const SizedBox(height: 15), Text("Don't have an account?",style: TextStyle(color: myColor),), SizedBox(width: 8,), Text('Register',style: TextStyle( color: myColor.shade800, decoration: TextDecoration.underline,) ), SizedBox(height: 40,) ] ), ), ], ), ), ) ], ), ), ); } } class MyClipper 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.lineTo(size.width, 0); return path; } @override bool shouldReclip(covariant CustomClipper oldClipper) { return true; } } class MyClipper2 extends CustomClipper{ @override Path getClip(Size size) { Path path =Path(); path.lineTo(0, size.height/2.3); path.quadraticBezierTo(size.width/8, size.height*.3, size.width/8*3, size.height/2.4); //path.quadraticBezierTo(size.width/8*3, size.height/2.5, size.width/8*4, size.height/2.2); path.quadraticBezierTo(size.width/8*6, size.height/1.7, size.width, size.height/3); path.lineTo(size.width, 0); return path; } @override bool shouldReclip(covariant CustomClipper oldClipper) { return true; } } class MyClipper3 extends CustomClipper{ @override Path getClip(Size size) { Path path =Path(); path.lineTo(0, size.height*.2); path.quadraticBezierTo(size.width/8, size.height, size.width/8*3,0); //path.quadraticBezierTo(size.width/8*3, size.height/2.5, size.width/8*4, size.height/2.2); //path.quadraticBezierTo(size.width/8*6, size.height/1.7, size.width, size.height/2.2); //path.lineTo(size.width, 0); return path; } @override bool shouldReclip(covariant CustomClipper oldClipper) { return true; } } class MyClipper4 extends CustomClipper{ @override Path getClip(Size size) { Path path =Path(); path.moveTo(0, size.height); path.lineTo(0, size.height*.5); path.quadraticBezierTo(size.width/7.5, size.height*.95, size.width,size.height); path.lineTo(size.width, size.height); //path.quadraticBezierTo(size.width/8*3, size.height/2.5, size.width/8*4, size.height/2.2); //path.quadraticBezierTo(size.width/8*6, size.height/1.7, size.width, size.height/2.2); //path.lineTo(size.width, 0); return path; } @override bool shouldReclip(covariant CustomClipper oldClipper) { return true; } }