Created
March 29, 2020 13:41
-
-
Save vijayinyoutube/c76efffee20c14ebb214fda1e337f4f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: MyPage(), | |
); | |
} | |
} | |
class MyPage extends StatefulWidget { | |
@override | |
_MyPageState createState() => _MyPageState(); | |
} | |
class _MyPageState extends State<MyPage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Padding( | |
padding: EdgeInsets.symmetric(horizontal: 20), | |
child: SingleChildScrollView( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
RichText( | |
text: TextSpan( | |
text: "Hello!", | |
style: TextStyle( | |
color: Color(0xFF2508FF), | |
fontWeight: FontWeight.bold, | |
fontSize: 35), | |
children: <TextSpan>[ | |
TextSpan( | |
text: "Login", | |
style: TextStyle( | |
color: Color(0xFF14C115), | |
)) | |
]), | |
), | |
SizedBox(height: 25), | |
TextFormField( | |
decoration: InputDecoration( | |
labelText: "Name", | |
hintStyle: TextStyle(color: Colors.grey, fontSize: 16.0), | |
)), | |
SizedBox(height: 25), | |
TextFormField( | |
decoration: InputDecoration( | |
labelText: "Email", | |
hintStyle: TextStyle(color: Colors.grey, fontSize: 16.0), | |
)), | |
SizedBox(height: 25), | |
buildButtonContainer(), | |
SizedBox(height: 25), | |
Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Text("Don't have an account?", | |
style: TextStyle(color: Color(0xFF2508FF))), | |
FlatButton( | |
child: Text("Signup", | |
style: TextStyle(color: Color(0xFF14C115))), | |
onPressed: () {}, | |
), | |
], | |
) | |
]), | |
))); | |
} | |
Widget buildButtonContainer() { | |
return Container( | |
height: 56.0, | |
width: MediaQuery.of(context).size.width, | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(23.0), | |
gradient: LinearGradient(colors: [ | |
Color(0xFF2508FF), | |
Color(0xFF2585A9), | |
Color(0xFF14C115), | |
Color(0xFF14C115), | |
], begin: Alignment.centerRight, end: Alignment.centerLeft), | |
), | |
child: Center( | |
child: Container( | |
height: 100.0, | |
width: 500, | |
child: FlatButton( | |
shape: new RoundedRectangleBorder( | |
borderRadius: new BorderRadius.circular(23.0)), | |
child: Text( | |
"Sign in", | |
style: TextStyle(color: Colors.white, fontSize: 18.0), | |
), | |
onPressed: () {}, | |
), | |
), | |
), | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment