Last active
June 4, 2021 21:10
-
-
Save derekedelaney/8bcd744ade4d118618de8db3762b376a to your computer and use it in GitHub Desktop.
Sign in form with forgot password on bottom
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(App()); | |
} | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: Home(), | |
); | |
} | |
} | |
class Home extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: SafeArea( | |
child: LayoutBuilder( | |
builder: (BuildContext context, BoxConstraints constraints) => | |
SingleChildScrollView( | |
child: Container( | |
padding: const EdgeInsets.all(20), | |
constraints: BoxConstraints( | |
minHeight: constraints.maxHeight, | |
), | |
child: IntrinsicHeight( | |
child: Column( | |
children: [ | |
Icon(Icons.shield, color: Colors.green, size: 100), | |
TextFormField( | |
decoration: InputDecoration(labelText: 'Email'), | |
), | |
TextFormField( | |
decoration: InputDecoration(labelText: 'Password'), | |
), | |
Padding( | |
padding: const EdgeInsets.all(20), | |
child: Center( | |
child: ElevatedButton( | |
child: Text('Sign In'), | |
onPressed: () {}, | |
), | |
), | |
), | |
Spacer(), | |
Text('forgot password'), | |
], | |
), | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment