Skip to content

Instantly share code, notes, and snippets.

@vijayinyoutube
Created March 29, 2020 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijayinyoutube/c76efffee20c14ebb214fda1e337f4f9 to your computer and use it in GitHub Desktop.
Save vijayinyoutube/c76efffee20c14ebb214fda1e337f4f9 to your computer and use it in GitHub Desktop.
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