From be4feef0029b75b98cd3a15a2bbcfc0ae31333b1 Mon Sep 17 00:00:00 2001 From: devadarshan23 <112646857+devadarshan23@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:15:29 +0530 Subject: [PATCH 1/4] main.dart --- appdev_devadarshan/main.dart | 249 +++++++++++++++++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 appdev_devadarshan/main.dart diff --git a/appdev_devadarshan/main.dart b/appdev_devadarshan/main.dart new file mode 100644 index 0000000..02ad1f0 --- /dev/null +++ b/appdev_devadarshan/main.dart @@ -0,0 +1,249 @@ +import 'package:flutter/material.dart'; +import 'package:color_grading_sample/Register_screen.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + routes: { + 'Register_Page': (context) => Register_Screen(), + 'Login_Page': (context) => LoginPage(), + }, + home: LoginPage(), + ); + } +} + +class LoginPage extends StatefulWidget { + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + Color loginButtonColor = Color(0xFF7C1176); + Color textcolor=Colors.white; + Color RegisterButtonColor=Color(0xFF7C1176); + Color Registertextcolor=Colors.white; + void changeLoginButtonColor() { + setState(() { + if (loginButtonColor == Color(0xFF7C1176)) { + loginButtonColor = Colors.white; // Change to white on press + textcolor=Color(0xff7c1176); + } else { + loginButtonColor = Color(0xFF7C1176); // Revert to original color + textcolor=Colors.white; + } + + }); + } + void changeRegisterButtonColor() { + setState(() { + if (RegisterButtonColor == Color(0xFF7C1176)) { + RegisterButtonColor = Colors.white; // Change to white on press + Registertextcolor=Color(0xff7c1176); + } else { + RegisterButtonColor = Color(0xFF7C1176); // Revert to original color + Registertextcolor=Colors.white; + } + + }); + } + @override + Widget build(BuildContext context) { + double height=MediaQuery.of(context).size.height; + double width=MediaQuery.of(context).size.width; + return Scaffold( + + body: SingleChildScrollView( + child: Column( + children: [ + Container( + height:height, + width:width, + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Color(0xFF3E2248), // Starting color #3e2248 + Color(0xFF7C1175), // Middle color #7c1175 + Color(0xFF3E2248), // Ending color #3e2248 + ], + stops: [0.0, 0.5, 1.0], // Adjust stops for smooth transition + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.001), + child: Center( + child: Text( + 'C O D E C H E F', + style: TextStyle( + color: Colors.white.withOpacity(0.4), // Slightly transparent white + fontSize: 35, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.1), + child: Center( + child: Container( + //height: MediaQuery.of(context).size.height*0.5, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey.withOpacity(0.3)), // White border + borderRadius: BorderRadius.circular(15.0), + color: Colors.grey.withOpacity(0.3), // Slightly grey and transparent + ), + padding: EdgeInsets.symmetric(horizontal: 20.0), + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width * 0.7, + ), + // Adjust max width as needed + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.all(MediaQuery.of(context).size.height * 0.045), + child: Text( + 'Login', + style: TextStyle(color: Colors.white.withOpacity(0.7), fontSize: 40,fontWeight: FontWeight.bold), + ), + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: height * 0.01,left:15), + child: Text( + 'username', + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ), + Padding( + padding: EdgeInsets.only(top: 5), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30.0), + border: Border.all(color: Colors.white), + ), + child: TextFormField( + decoration: InputDecoration( + border: InputBorder.none, + contentPadding:EdgeInsets.only(left:15,top:5,right:10,bottom:15), + ), + style: TextStyle(color: Colors.white,), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: height * 0.03,left:15), + child: Text( + 'password', + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ), + Padding( + padding: EdgeInsets.only(top: 5,left:5,bottom:5), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30.0), + border: Border.all(color: Colors.white), + ), + child: TextFormField( + decoration: InputDecoration( + border: InputBorder.none, + contentPadding:EdgeInsets.only(left:15,top:5,right:10,bottom:15), + ), + style: TextStyle(color: Colors.white), + obscureText: true, + ), + ), + ), + ], + ), + ), + ], + ), + + Padding( + padding: EdgeInsets.only(top: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(top:8.0,right:8.0,bottom:40.0), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25.0), + color: loginButtonColor, + border: Border.all(color: Colors.white), + ), + child: TextButton( + onPressed: () { + changeLoginButtonColor(); + }, + child: Text( + 'Login', + style: TextStyle(color: textcolor), + ), + ), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(top:8.0,right:8.0,bottom:40.0), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + color: RegisterButtonColor, + borderRadius: BorderRadius.circular(25.0), + border: Border.all(color: Colors.white), + ), + child: TextButton( + onPressed: () { + Navigator.pushNamed(context,'Register_Page'); + changeRegisterButtonColor(); + }, + + child: Text( + 'Register', + style: TextStyle(color: Registertextcolor), + ), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} From ba1d1244d385fe54453450684f7f06ee65f4ea4d Mon Sep 17 00:00:00 2001 From: devadarshan23 <112646857+devadarshan23@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:19:05 +0530 Subject: [PATCH 2/4] Register_Screen --- appdev_devadarshan/Register_Screen | 232 +++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 appdev_devadarshan/Register_Screen diff --git a/appdev_devadarshan/Register_Screen b/appdev_devadarshan/Register_Screen new file mode 100644 index 0000000..f549d91 --- /dev/null +++ b/appdev_devadarshan/Register_Screen @@ -0,0 +1,232 @@ +import 'package:flutter/material.dart'; + +class Register_Screen extends StatefulWidget { + const Register_Screen({Key? key}) : super(key: key); + + @override + State createState() => _Register_ScreenState(); +} + +class _Register_ScreenState extends State { + Color loginButtonColor = Color(0xFF7C1176); + Color textcolor=Colors.white; + Color RegisterButtonColor=Color(0xFF7C1176); + Color Registertextcolor=Colors.white; + void changeLoginButtonColor() { + setState(() { + if (loginButtonColor == Color(0xFF7C1176)) { + loginButtonColor = Colors.white; + textcolor=Color(0xff7c1176); + } else { + loginButtonColor = Color(0xFF7C1176); + textcolor=Colors.white; + } + + }); + } + void changeRegisterButtonColor() { + setState(() { + if (RegisterButtonColor == Color(0xFF7C1176)) { + RegisterButtonColor = Colors.white; + Registertextcolor=Color(0xff7c1176); + } else { + RegisterButtonColor = Color(0xFF7C1176); + Registertextcolor=Colors.white; + } + + }); + } + @override + Widget build(BuildContext context) { + double height=MediaQuery.of(context).size.height; + double width=MediaQuery.of(context).size.width; + return Scaffold( + body: SingleChildScrollView( + child: Column( + children: [ + Container( + height:height, + width:width, + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Color(0xFF3E2248), + Color(0xFF7C1175), + Color(0xFF3E2248), + ], + stops: [0.0, 0.5, 1.0], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.001), + child: Center( + child: Text( + 'C O D E C H E F', + style: TextStyle( + color: Colors.white.withOpacity(0.4), + fontSize: 35, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.1), + child: Center( + child: Container( + //height: MediaQuery.of(context).size.height*0.5, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey.withOpacity(0.3)), + borderRadius: BorderRadius.circular(15.0), + color: Colors.grey.withOpacity(0.3), + ), + padding: EdgeInsets.symmetric(horizontal: 20.0), + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width * 0.7, + ), + + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.all(MediaQuery.of(context).size.height * 0.045), + child: Text( + 'Register', + style: TextStyle(color: Colors.white.withOpacity(0.7), fontSize: 38,fontWeight: FontWeight.bold), + ), + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: height * 0.01,left:15), + child: Text( + 'username', + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ), + Padding( + padding: EdgeInsets.only(top: 5), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30.0), + border: Border.all(color: Colors.white), + ), + child: TextFormField( + decoration: InputDecoration( + border: InputBorder.none, + contentPadding:EdgeInsets.only(left:15,top:5,right:10,bottom:15), + ), + style: TextStyle(color: Colors.white,), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: height * 0.03,left:15), + child: Text( + 'password', + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ), + Padding( + padding: EdgeInsets.only(top: 5,left:5,bottom:5), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30.0), + border: Border.all(color: Colors.white), + ), + child: TextFormField( + decoration: InputDecoration( + border: InputBorder.none, + contentPadding:EdgeInsets.only(left:15,top:5,right:10,bottom:15), + ), + style: TextStyle(color: Colors.white), + obscureText: true, + ), + ), + ), + ], + ), + ), + ], + ), + + Padding( + padding: EdgeInsets.only(top: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(top:8.0,right:8.0,bottom:40.0), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + color: RegisterButtonColor, + borderRadius: BorderRadius.circular(25.0), + border: Border.all(color: Colors.white), + ), + child: TextButton( + onPressed: () { + changeRegisterButtonColor(); + }, + + child: Text( + 'Register', + style: TextStyle(color: Registertextcolor), + ), + ), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(top:8.0,right:8.0,bottom:40.0), + child: Container( + height:height*0.05, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25.0), + color: loginButtonColor, + border: Border.all(color: Colors.white), + ), + child: TextButton( + onPressed: () { + changeLoginButtonColor(); + Navigator.pushNamed(context,'Login_Page'); + }, + child: Text( + 'Login', + style: TextStyle(color: textcolor), + ), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + + ); + } +} From 108d8a978d716d0c66ad7b8b6b0a3baadaa8b569 Mon Sep 17 00:00:00 2001 From: devadarshan23 <112646857+devadarshan23@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:21:07 +0530 Subject: [PATCH 3/4] main.dart --- appdev_devadarshan/main.dart | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/appdev_devadarshan/main.dart b/appdev_devadarshan/main.dart index 02ad1f0..42c5aa4 100644 --- a/appdev_devadarshan/main.dart +++ b/appdev_devadarshan/main.dart @@ -32,10 +32,10 @@ class _LoginPageState extends State { void changeLoginButtonColor() { setState(() { if (loginButtonColor == Color(0xFF7C1176)) { - loginButtonColor = Colors.white; // Change to white on press + loginButtonColor = Colors.white; textcolor=Color(0xff7c1176); } else { - loginButtonColor = Color(0xFF7C1176); // Revert to original color + loginButtonColor = Color(0xFF7C1176); textcolor=Colors.white; } @@ -44,10 +44,10 @@ class _LoginPageState extends State { void changeRegisterButtonColor() { setState(() { if (RegisterButtonColor == Color(0xFF7C1176)) { - RegisterButtonColor = Colors.white; // Change to white on press + RegisterButtonColor = Colors.white; Registertextcolor=Color(0xff7c1176); } else { - RegisterButtonColor = Color(0xFF7C1176); // Revert to original color + RegisterButtonColor = Color(0xFF7C1176); Registertextcolor=Colors.white; } @@ -68,11 +68,11 @@ class _LoginPageState extends State { decoration: BoxDecoration( gradient: LinearGradient( colors: [ - Color(0xFF3E2248), // Starting color #3e2248 - Color(0xFF7C1175), // Middle color #7c1175 - Color(0xFF3E2248), // Ending color #3e2248 + Color(0xFF3E2248), + Color(0xFF7C1175), + Color(0xFF3E2248), ], - stops: [0.0, 0.5, 1.0], // Adjust stops for smooth transition + stops: [0.0, 0.5, 1.0], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), @@ -86,7 +86,7 @@ class _LoginPageState extends State { child: Text( 'C O D E C H E F', style: TextStyle( - color: Colors.white.withOpacity(0.4), // Slightly transparent white + color: Colors.white.withOpacity(0.4), fontSize: 35, fontWeight: FontWeight.bold, ), @@ -97,17 +97,17 @@ class _LoginPageState extends State { padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.1), child: Center( child: Container( - //height: MediaQuery.of(context).size.height*0.5, + decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.3)), // White border + border: Border.all(color: Colors.grey.withOpacity(0.3)), borderRadius: BorderRadius.circular(15.0), - color: Colors.grey.withOpacity(0.3), // Slightly grey and transparent + color: Colors.grey.withOpacity(0.3), ), padding: EdgeInsets.symmetric(horizontal: 20.0), constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width * 0.7, ), - // Adjust max width as needed + child: Column( mainAxisSize: MainAxisSize.min, children: [ From 7f8562a2fe0bf2a0907e9365dfbb827e74f557c4 Mon Sep 17 00:00:00 2001 From: devadarshan23 <112646857+devadarshan23@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:22:23 +0530 Subject: [PATCH 4/4] Register_Screen.dart --- appdev_devadarshan/{Register_Screen => Register_Screen.dart} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename appdev_devadarshan/{Register_Screen => Register_Screen.dart} (100%) diff --git a/appdev_devadarshan/Register_Screen b/appdev_devadarshan/Register_Screen.dart similarity index 100% rename from appdev_devadarshan/Register_Screen rename to appdev_devadarshan/Register_Screen.dart