Skip to content

Commit

Permalink
feat: Day13 - login image
Browse files Browse the repository at this point in the history
  • Loading branch information
BbsonLin committed Sep 10, 2019
1 parent b2a1166 commit bc0a9f1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 49 deletions.
Binary file added assets/images/gitme-github-auth-trans.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 56 additions & 49 deletions lib/pages/login.dart
Expand Up @@ -20,61 +20,68 @@ class _LoginPageState extends State<LoginPage> {
title: Text("Login"),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
padding:
EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
child: TextFormField(
decoration: const InputDecoration(
prefixIcon: Icon(Icons.person),
labelText: "Name *",
hintText: "Your Github account username",
child: Padding(
padding: const EdgeInsets.only(top: 24.0),
child: Column(
children: <Widget>[
Image.asset(
"assets/images/gitme-github-auth-trans.png",
width: MediaQuery.of(context).size.width / 2,
),
Container(
padding:
EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
child: TextFormField(
decoration: const InputDecoration(
prefixIcon: Icon(Icons.person),
labelText: "Name *",
hintText: "Your Github account username",
),
),
),
),
Container(
padding:
EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
child: TextFormField(
obscureText: _obscureText,
decoration: InputDecoration(
prefixIcon: Icon(Icons.lock),
suffixIcon: IconButton(
icon: _obscureText
? Icon(Icons.visibility_off)
: Icon(Icons.visibility),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
Container(
padding:
EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
child: TextFormField(
obscureText: _obscureText,
decoration: InputDecoration(
prefixIcon: Icon(Icons.lock),
suffixIcon: IconButton(
icon: _obscureText
? Icon(Icons.visibility_off)
: Icon(Icons.visibility),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
),
labelText: "Password *",
hintText: "Your Github account password",
),
labelText: "Password *",
hintText: "Your Github account password",
),
),
),
SizedBox(
height: 52.0,
),
SizedBox(
width: MediaQuery.of(context).size.width - 48.0,
height: 48.0,
child: RaisedButton(
child: Text("Login"),
onPressed: () {
final progress = ProgressHUD.of(context);
progress.showWithText("Loading...");
FocusScope.of(context).requestFocus(new FocusNode());
Future.delayed(Duration(seconds: 1), () {
Navigator.pushReplacementNamed(context, "/home");
progress.dismiss();
});
},
SizedBox(
height: 52.0,
),
SizedBox(
width: MediaQuery.of(context).size.width - 48.0,
height: 48.0,
child: RaisedButton(
child: Text("Login"),
onPressed: () {
final progress = ProgressHUD.of(context);
progress.showWithText("Loading...");
FocusScope.of(context).requestFocus(new FocusNode());
Future.delayed(Duration(seconds: 1), () {
Navigator.pushReplacementNamed(context, "/home");
progress.dismiss();
});
},
),
),
),
],
],
),
),
),
),
Expand Down

0 comments on commit bc0a9f1

Please sign in to comment.