Skip to content

Commit

Permalink
[102] Completed code.
Browse files Browse the repository at this point in the history
[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.

[102] starter todos (material-components#54)
  • Loading branch information
willlarche authored and tianlunlee committed Jun 26, 2018
1 parent 172d047 commit 441c235
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Codelabs MDC-101 through MDC-104 will guide you through building and integrating
The starter and completed code is in the various branches of this repo.

## Getting Started
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.
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.

## Support

Expand Down
4 changes: 4 additions & 0 deletions mdc_100_series/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
import 'package:flutter/material.dart';

class HomePage extends StatelessWidget {
// TODO: Insert function to build grid cards (102)
@override
Widget build(BuildContext context) {
return Scaffold(
// TODO: Add app bar (102)
// TODO: Add a grid view (102)
body: Center(
// TODO: Pass context to grid cards (102)
child: Text('You did it!'),
),
);
Expand Down
61 changes: 47 additions & 14 deletions mdc_100_series/lib/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,62 @@ import 'package:flutter/material.dart';

class LoginPage extends StatefulWidget {
@override
_LoginPageState createState() => new _LoginPageState();
_LoginPageState createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
// TODO: Add text editing controllers (101)
final _usernameController = TextEditingController();
final _passwordController = TextEditingController();

@override
Widget build(BuildContext context) {
return new Scaffold(
body: new SafeArea(
child: new ListView(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
return Scaffold(
body: SafeArea(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 24.0),
children: <Widget>[
const SizedBox(height: 80.0),
new Column(
SizedBox(height: 80.0),
Column(
children: <Widget>[
Image.asset('assets/diamond.png'),
SizedBox(height: 16.0),
Text('SHRINE'),
],
),
SizedBox(height: 120.0),
TextField(
controller: _usernameController,
decoration: InputDecoration(
filled: true,
labelText: 'Username',
),
),
SizedBox(height: 12.0),
TextField(
controller: _passwordController,
decoration: InputDecoration(
filled: true,
labelText: 'Password',
),
obscureText: true,
),
ButtonBar(
children: <Widget>[
new Image.asset('assets/diamond.png'),
const SizedBox(height: 16.0),
const Text('SHRINE'),
FlatButton(
child: Text('CANCEL'),
onPressed: () {
_usernameController.clear();
_passwordController.clear();
},
),
RaisedButton(
child: Text('NEXT'),
onPressed: () {
Navigator.pop(context);
},
),
],
),
const SizedBox(height: 120.0),
// TODO: Add TextField widgets (101)
// TODO: Add button bar (101)
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion mdc_100_series/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Shrine
description: Learn the basics of using Material Components by building a simple app with core components.
description: Learn how to use Material for structure and layout.

dependencies:
flutter:
Expand Down

0 comments on commit 441c235

Please sign in to comment.