Skip to content

Commit 3e33768

Browse files
committed
[102] Completed code.
[101] Starter code. [103] Supplemental files. [101] Correcting supplemental files. [101] Minor renaming. [101] Missing dependency. [101] Dart 2. [101] Dart 2. [101] Complete code. [102] Starter code. [102] Minor copy correction. [101] Update for Dart 2 [102] Rebase.
1 parent 172d047 commit 3e33768

File tree

3 files changed

+49
-16
lines changed

3 files changed

+49
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Codelabs MDC-101 through MDC-104 will guide you through building and integrating
1111
The starter and completed code is in the various branches of this repo.
1212

1313
## Getting Started
14-
Visit the [Google codelabs site](https://codelabs.developers.google.com/), or [codelabs.developers.google.com/codelabs/mdc-101-flutter](https://codelabs.developers.google.com/codelabs/mdc-101-flutter), to follow along the guided steps.
14+
Visit the [Google codelabs site](https://codelabs.developers.google.com/), or [codelabs.developers.google.com/codelabs/mdc-102-flutter](https://codelabs.developers.google.com/codelabs/mdc-102-flutter), to follow along the guided steps.
1515

1616
## Support
1717

mdc_100_series/lib/login.dart

+47-14
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,62 @@ import 'package:flutter/material.dart';
1616

1717
class LoginPage extends StatefulWidget {
1818
@override
19-
_LoginPageState createState() => new _LoginPageState();
19+
_LoginPageState createState() => _LoginPageState();
2020
}
2121

2222
class _LoginPageState extends State<LoginPage> {
23-
// TODO: Add text editing controllers (101)
23+
final _usernameController = TextEditingController();
24+
final _passwordController = TextEditingController();
25+
2426
@override
2527
Widget build(BuildContext context) {
26-
return new Scaffold(
27-
body: new SafeArea(
28-
child: new ListView(
29-
padding: const EdgeInsets.symmetric(horizontal: 24.0),
28+
return Scaffold(
29+
body: SafeArea(
30+
child: ListView(
31+
padding: EdgeInsets.symmetric(horizontal: 24.0),
3032
children: <Widget>[
31-
const SizedBox(height: 80.0),
32-
new Column(
33+
SizedBox(height: 80.0),
34+
Column(
35+
children: <Widget>[
36+
Image.asset('assets/diamond.png'),
37+
SizedBox(height: 16.0),
38+
Text('SHRINE'),
39+
],
40+
),
41+
SizedBox(height: 120.0),
42+
TextField(
43+
controller: _usernameController,
44+
decoration: InputDecoration(
45+
filled: true,
46+
labelText: 'Username',
47+
),
48+
),
49+
SizedBox(height: 12.0),
50+
TextField(
51+
controller: _passwordController,
52+
decoration: InputDecoration(
53+
filled: true,
54+
labelText: 'Password',
55+
),
56+
obscureText: true,
57+
),
58+
ButtonBar(
3359
children: <Widget>[
34-
new Image.asset('assets/diamond.png'),
35-
const SizedBox(height: 16.0),
36-
const Text('SHRINE'),
60+
FlatButton(
61+
child: Text('CANCEL'),
62+
onPressed: () {
63+
_usernameController.clear();
64+
_passwordController.clear();
65+
},
66+
),
67+
RaisedButton(
68+
child: Text('NEXT'),
69+
onPressed: () {
70+
Navigator.pop(context);
71+
},
72+
),
3773
],
3874
),
39-
const SizedBox(height: 120.0),
40-
// TODO: Add TextField widgets (101)
41-
// TODO: Add button bar (101)
4275
],
4376
),
4477
),

mdc_100_series/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Shrine
2-
description: Learn the basics of using Material Components by building a simple app with core components.
2+
description: Learn how to use Material for structure and layout.
33

44
dependencies:
55
flutter:

0 commit comments

Comments
 (0)