From 65a3a04f2cb590807c7c3b93dc73c524247d21ea Mon Sep 17 00:00:00 2001 From: Will Larche Date: Wed, 25 Apr 2018 19:49:51 -0400 Subject: [PATCH] [101] Completed Code. [101] Making AppBar something you add in 102. [Model] Adding model from the start. [103] Adding fonts. [103] Supplemental files. [101] Correcting supplemental files. [101] Copy correction. [101] Minor renaming. [101] Update for Dart 2. [101] Missing dependency. [101] Dart 2. [101] Dart 2. [101] Dart 2. [101] Dart 2. [101] Correcting model. [Meta] README file. [Meta] Clarification. [101] Copy correction. [104] Updating data. [101] Correcting widget class. (#23) Add link to actual codelab in the README [Meta] README correction. [101] README specificity. Add the slanted_menu.png to assets for 101 branch so its ready when needed. (#44) [101] TODOs for starter code (#50) [101] Added future TODOs to 101 starter (#59) [101] Completed code. [101] Making AppBar something you add in 102. [Model] Adding model from the start. [103] Adding fonts. [103] Supplemental files. [101] Correcting supplemental files. [101] Copy correction. [101] Minor renaming. [101] Update for Dart 2. [101] Missing dependency. [101] Dart 2. [101] Dart 2. [101] Dart 2. [101] Dart 2. [101] Correcting model. [Meta] README file. [Meta] Clarification. [101] Copy correction. [104] Updating data. [101] Correcting widget class. (#23) Add link to actual codelab in the README [Meta] README correction. [101] README specificity. Add the slanted_menu.png to assets for 101 branch so its ready when needed. (#44) [101] TODOs for starter code (#50) [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. [102] starter todos (#54) --- README.md | 2 +- mdc_100_series/lib/home.dart | 2 ++ mdc_100_series/lib/login.dart | 61 +++++++++++++++++++++++++++-------- mdc_100_series/pubspec.yaml | 2 +- 4 files changed, 51 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a85425c264..39716002ec 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/mdc_100_series/lib/home.dart b/mdc_100_series/lib/home.dart index e5b3637878..0ddccc2026 100644 --- a/mdc_100_series/lib/home.dart +++ b/mdc_100_series/lib/home.dart @@ -17,6 +17,7 @@ import 'package:flutter/material.dart'; class HomePage extends StatelessWidget { // TODO: Make a collection of cards (102) // TODO: Add a variable for Category (104) + @override Widget build(BuildContext context) { // TODO: Return an AsymmetricView (104) @@ -30,3 +31,4 @@ class HomePage extends StatelessWidget { ); } } + diff --git a/mdc_100_series/lib/login.dart b/mdc_100_series/lib/login.dart index 5816fcbe62..f02aabd980 100644 --- a/mdc_100_series/lib/login.dart +++ b/mdc_100_series/lib/login.dart @@ -16,32 +16,65 @@ import 'package:flutter/material.dart'; class LoginPage extends StatefulWidget { @override - _LoginPageState createState() => new _LoginPageState(); + _LoginPageState createState() => _LoginPageState(); } class _LoginPageState extends State { - // 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: [ - const SizedBox(height: 80.0), - new Column( + SizedBox(height: 80.0), + Column( children: [ - new Image.asset('assets/diamond.png'), - const SizedBox(height: 16.0), - const Text('SHRINE'), + Image.asset('assets/diamond.png'), + SizedBox(height: 16.0), + Text('SHRINE'), ], ), - const SizedBox(height: 120.0), + SizedBox(height: 120.0), // TODO: Wrap Username with PrimaryColorOverride (103) // TODO: Remove filled: true values (103) + TextField( + controller: _usernameController, + decoration: InputDecoration( + filled: true, + labelText: 'Username', + ), + ), + SizedBox(height: 12.0), // TODO: Wrap Password with PrimaryColorOverride (103) - // TODO: Add TextField widgets (101) - // TODO: Add button bar (101) + TextField( + controller: _passwordController, + decoration: InputDecoration( + filled: true, + labelText: 'Password', + ), + obscureText: true, + ), + ButtonBar( + children: [ + FlatButton( + child: Text('CANCEL'), + onPressed: () { + _usernameController.clear(); + _passwordController.clear(); + }, + ), + RaisedButton( + child: Text('NEXT'), + onPressed: () { + Navigator.pop(context); + }, + ), + ], + ), ], ), ), diff --git a/mdc_100_series/pubspec.yaml b/mdc_100_series/pubspec.yaml index 2bbb1312d3..f0dd7a3dd9 100644 --- a/mdc_100_series/pubspec.yaml +++ b/mdc_100_series/pubspec.yaml @@ -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: