In this article, we will be implementing the mentioned beautiful gradient flutter login UI template. We have made many beautiful flutter templates as well. You should check them out as well and can implement them in your code as they are free to use.
Let’s not waste anymore time and get right into implementing this beautiful gradient Flutter login UI.
Outline
- Flutter Login UI Template Implementation
- Background Color of Flutter Page UI
- Title Text Decoration
- Email and Password Flutter Textfields
- Forgot Password Clickable Text
- Flutter Login Clickable Container Button
- Flutter Signup Clickable Container Button
- Gradient Flutter Login UI Design Source Code
- Conclusion
Flutter Login UI Template Implementation
Let’s start step by step implementation on how to achieve the mentioned flutter login UI template.
Background Color of Flutter Login UI
Container( height: double.infinity, width: double.infinity, alignment: Alignment.center, decoration: BoxDecoration( gradient: LinearGradient( colors: [Colors.green.shade200, Colors.green.shade900])),)
Title Text Decoration
Container( height: 150, width: 230, decoration: BoxDecoration( gradient: LinearGradient(colors: [ Colors.green.shade200, Colors.green.shade900 ]), boxShadow: [ BoxShadow( blurRadius: 4, spreadRadius: 3, color: Colors.black12) ], borderRadius: BorderRadius.circular(200).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0))), child: Container( margin: EdgeInsets.all(20), decoration: BoxDecoration( gradient: LinearGradient(colors: [ Colors.green.shade200, Colors.green.shade900 ]), boxShadow: [ BoxShadow( blurRadius: 4, spreadRadius: 3, color: Colors.black12) ], borderRadius: BorderRadius.circular(200).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0))), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'Let\'s', style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, color: Colors.white, shadows: [ Shadow( color: Colors.black45, offset: Offset(1, 1), blurRadius: 5) ]), ), Text( ' Login', style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, color: Colors.green.shade600, shadows: [ Shadow( color: Colors.black45, offset: Offset(1, 1), blurRadius: 5) ]), ), ], ), ), ),
Email and Password Flutter Textfields
Padding( padding: EdgeInsets.symmetric(horizontal: 30).copyWith(bottom: 10), child: TextField( style: TextStyle(color: Colors.white, fontSize: 14.5), obscureText: isPasswordVisible ? false : true, decoration: InputDecoration( prefixIconConstraints: BoxConstraints(minWidth: 45), prefixIcon: Icon( Icons.lock, color: Colors.white70, size: 22, ), suffixIconConstraints: BoxConstraints(minWidth: 45, maxWidth: 46), suffixIcon: GestureDetector( onTap: () { setState(() { isPasswordVisible = !isPasswordVisible; }); }, child: Icon( isPasswordVisible ? Icons.visibility : Icons.visibility_off, color: Colors.white70, size: 22, ), ), border: InputBorder.none, hintText: 'Enter Password', hintStyle: TextStyle(color: Colors.white60, fontSize: 14.5), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), borderSide: BorderSide(color: Colors.white38)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), borderSide: BorderSide(color: Colors.white70))), ), ),
Forgot Password Clickable Text
Align( alignment: Alignment.centerRight, child: GestureDetector( onTap: () {}, child: Padding( padding: EdgeInsets.only(right: 30), child: Text('Forgot Password?', style: TextStyle(color: Colors.white70, fontSize: 13)), ), ), ),
Flutter Login Clickable Container Button
GestureDetector( onTap: () {}, child: Container( height: 53, width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 30), alignment: Alignment.center, decoration: BoxDecoration( boxShadow: [ BoxShadow( blurRadius: 4, color: Colors.black12.withOpacity(.2), offset: Offset(2, 2)) ], borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), gradient: LinearGradient(colors: [ Colors.green.shade200, Colors.green.shade900 ])), child: Text('Login', style: TextStyle( color: Colors.white.withOpacity(.8), fontSize: 15, fontWeight: FontWeight.bold)), ), ),
Flutter Signup Clickable Container Button
Container( height: 53, width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 30), alignment: Alignment.center, decoration: BoxDecoration( border: Border.all(color: Colors.white60), borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), ), child: Text('Signup', style: TextStyle( color: Colors.white.withOpacity(.8), fontSize: 15, fontWeight: FontWeight.bold)), ),
Gradient Flutter Login UI Design Source Code
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Beautiful Login Template', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.green, accentColor: Colors.green, primaryColor: Colors.green, focusColor: Colors.green, cursorColor: Colors.green), home: Homepage(), ); } } class Homepage extends StatefulWidget { const Homepage({Key? key}) : super(key: key); @override State<Homepage> createState() => _HomepageState(); } class _HomepageState extends State<Homepage> { bool isPasswordVisible = false; @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( body: Container( height: double.infinity, width: double.infinity, alignment: Alignment.center, decoration: BoxDecoration( gradient: LinearGradient( colors: [Colors.green.shade200, Colors.green.shade900])), child: SingleChildScrollView( child: Column( children: [ SizedBox( height: 50, ), Container( height: 150, width: 230, decoration: BoxDecoration( gradient: LinearGradient(colors: [ Colors.green.shade200, Colors.green.shade900 ]), boxShadow: [ BoxShadow( blurRadius: 4, spreadRadius: 3, color: Colors.black12) ], borderRadius: BorderRadius.circular(200).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0))), child: Container( margin: EdgeInsets.all(20), decoration: BoxDecoration( gradient: LinearGradient(colors: [ Colors.green.shade200, Colors.green.shade900 ]), boxShadow: [ BoxShadow( blurRadius: 4, spreadRadius: 3, color: Colors.black12) ], borderRadius: BorderRadius.circular(200).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0))), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'Let\'s', style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, color: Colors.white, shadows: [ Shadow( color: Colors.black45, offset: Offset(1, 1), blurRadius: 5) ]), ), Text( ' Login', style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, color: Colors.green.shade600, shadows: [ Shadow( color: Colors.black45, offset: Offset(1, 1), blurRadius: 5) ]), ), ], ), ), ), SizedBox( height: 40, ), Padding( padding: EdgeInsets.symmetric(horizontal: 30).copyWith(bottom: 10), child: TextField( style: TextStyle(color: Colors.white, fontSize: 14.5), decoration: InputDecoration( prefixIconConstraints: BoxConstraints(minWidth: 45), prefixIcon: Icon( Icons.email, color: Colors.white70, size: 22, ), border: InputBorder.none, hintText: 'Enter Email', hintStyle: TextStyle(color: Colors.white60, fontSize: 14.5), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), borderSide: BorderSide(color: Colors.white38)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), borderSide: BorderSide(color: Colors.white70))), ), ), Padding( padding: EdgeInsets.symmetric(horizontal: 30).copyWith(bottom: 10), child: TextField( style: TextStyle(color: Colors.white, fontSize: 14.5), obscureText: isPasswordVisible ? false : true, decoration: InputDecoration( prefixIconConstraints: BoxConstraints(minWidth: 45), prefixIcon: Icon( Icons.lock, color: Colors.white70, size: 22, ), suffixIconConstraints: BoxConstraints(minWidth: 45, maxWidth: 46), suffixIcon: GestureDetector( onTap: () { setState(() { isPasswordVisible = !isPasswordVisible; }); }, child: Icon( isPasswordVisible ? Icons.visibility : Icons.visibility_off, color: Colors.white70, size: 22, ), ), border: InputBorder.none, hintText: 'Enter Password', hintStyle: TextStyle(color: Colors.white60, fontSize: 14.5), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), borderSide: BorderSide(color: Colors.white38)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), borderSide: BorderSide(color: Colors.white70))), ), ), SizedBox( height: 10, ), Align( alignment: Alignment.centerRight, child: GestureDetector( onTap: () {}, child: Padding( padding: EdgeInsets.only(right: 30), child: Text('Forgot Password?', style: TextStyle(color: Colors.white70, fontSize: 13)), ), ), ), SizedBox( height: 40, ), GestureDetector( onTap: () {}, child: Container( height: 53, width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 30), alignment: Alignment.center, decoration: BoxDecoration( boxShadow: [ BoxShadow( blurRadius: 4, color: Colors.black12.withOpacity(.2), offset: Offset(2, 2)) ], borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), gradient: LinearGradient(colors: [ Colors.green.shade200, Colors.green.shade900 ])), child: Text('Login', style: TextStyle( color: Colors.white.withOpacity(.8), fontSize: 15, fontWeight: FontWeight.bold)), ), ), SizedBox( height: 50, ), Text('Don\'t have an account?', style: TextStyle(color: Colors.white70, fontSize: 13)), SizedBox( height: 20, ), Container( height: 53, width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 30), alignment: Alignment.center, decoration: BoxDecoration( border: Border.all(color: Colors.white60), borderRadius: BorderRadius.circular(30).copyWith( bottomRight: Radius.circular(0), topLeft: Radius.circular(0)), ), child: Text('Signup', style: TextStyle( color: Colors.white.withOpacity(.8), fontSize: 15, fontWeight: FontWeight.bold)), ), SizedBox( height: 20, ) ], ), ), ), ), ); } }
Conclusion
That’s pretty much all for this article, hope you now have a detailed knowledge of how to create this beautiful gradient Flutter login UI template. Use it in your flutter app, and we will look forward to hearing how it functions. Hope to see you in our next articles in which we analyze other beautiful flutter widgets. Some of these articles are listed below. Thanks for reading this post.
We’d be very glad to see you visit our other tutorials on Flutter app development and Python programming. Thank you for reading this article.