|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | + |
| 3 | +void main(){ |
| 4 | + runApp(MyApp()); |
| 5 | +} |
| 6 | + |
| 7 | +class MyApp extends StatelessWidget { |
| 8 | + @override |
| 9 | + Widget build(BuildContext context) { |
| 10 | + return MaterialApp( |
| 11 | + title: "Login & Register", |
| 12 | + home: LoginPage(), |
| 13 | + ); |
| 14 | + } |
| 15 | +} |
| 16 | + |
| 17 | +class LoginPage extends StatelessWidget { |
| 18 | + @override |
| 19 | + Widget build(BuildContext context) { |
| 20 | + return Scaffold( |
| 21 | + backgroundColor: Colors.deepPurple, |
| 22 | + appBar: AppBar( |
| 23 | + elevation: 0, |
| 24 | + backgroundColor: Colors.transparent, |
| 25 | + leading: BackButton(), |
| 26 | + ), |
| 27 | + body: Stack( |
| 28 | + children: <Widget>[ |
| 29 | + Positioned( |
| 30 | + bottom: 0, |
| 31 | + left: 0, |
| 32 | + right: 0, |
| 33 | + top: 0, |
| 34 | + child: ClipRRect( |
| 35 | + borderRadius: BorderRadius.only( |
| 36 | + topLeft: Radius.circular(32), |
| 37 | + topRight: Radius.circular(32) |
| 38 | + ), |
| 39 | + child: Container( |
| 40 | + color: Colors.white, |
| 41 | + padding: EdgeInsets.fromLTRB(16, 32, 16, 32), |
| 42 | + child: Column( |
| 43 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 44 | + children: <Widget>[ |
| 45 | + Text("Login Now", style: TextStyle( |
| 46 | + color: Colors.blueGrey, |
| 47 | + fontSize: 32, |
| 48 | + fontWeight: FontWeight.bold |
| 49 | + ), |
| 50 | + ), |
| 51 | + Text("Please login to continue using our app.", |
| 52 | + style: TextStyle( |
| 53 | + color: Colors.blueGrey |
| 54 | + ), |
| 55 | + ), |
| 56 | + SizedBox(height: 90,), |
| 57 | + Text("Email ID"), |
| 58 | + SizedBox(height: 10,), |
| 59 | + Material( |
| 60 | + elevation: 4, |
| 61 | + borderRadius: BorderRadius.all( |
| 62 | + Radius.circular(32), |
| 63 | + ), |
| 64 | + child: TextField( |
| 65 | + decoration: InputDecoration( |
| 66 | + border: InputBorder.none |
| 67 | + ), |
| 68 | + ), |
| 69 | + ), |
| 70 | + |
| 71 | + SizedBox(height: 32,), |
| 72 | + Text("Password"), |
| 73 | + SizedBox(height: 10,), |
| 74 | + Material( |
| 75 | + elevation: 4, |
| 76 | + borderRadius: BorderRadius.circular(32), |
| 77 | + child: TextField( |
| 78 | + decoration: InputDecoration( |
| 79 | + border: InputBorder.none |
| 80 | + ), |
| 81 | + ), |
| 82 | + ), |
| 83 | + Align( |
| 84 | + alignment: Alignment.centerRight, |
| 85 | + child: Padding( |
| 86 | + padding: const EdgeInsets.only(top: 16), |
| 87 | + child: Text("Forgot your password?", |
| 88 | + style: TextStyle( |
| 89 | + color: Colors.deepPurple |
| 90 | + ), |
| 91 | + ), |
| 92 | + ), |
| 93 | + ), |
| 94 | + |
| 95 | + MaterialButton( |
| 96 | + shape: BeveledRectangleBorder( |
| 97 | + side: BorderSide( |
| 98 | + width: 16.0, color: Colors.lightBlue.shade50 |
| 99 | + ), |
| 100 | + borderRadius: BorderRadius.circular(32) |
| 101 | + ), |
| 102 | + minWidth: double.maxFinite, |
| 103 | + color: Colors.deepPurple, |
| 104 | + onPressed: (){}, |
| 105 | + child: Text("Login"), |
| 106 | + ) |
| 107 | + ], |
| 108 | + ), |
| 109 | + ), |
| 110 | + ), |
| 111 | + ), |
| 112 | + ], |
| 113 | + ), |
| 114 | + ); |
| 115 | + } |
| 116 | +} |
0 commit comments