Skip to content

[101] Removed legacy 'new' and 'const' from 101 starter code #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions mdc_100_series/lib/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ 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)
@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>[
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)
// TODO: Wrap Password with PrimaryColorOverride (103)
Expand All @@ -49,4 +49,4 @@ class _LoginPageState extends State<LoginPage> {
}
}

// TODO: Add PrimaryColorOverride (103)
// TODO: Add PrimaryColorOverride (103)
3 changes: 1 addition & 2 deletions mdc_100_series/lib/model/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import 'product.dart';

List<Product> getProducts(Category category) {
const allProducts = <Product>[
allProducts = <Product>[
Product(
category: Category.accessories,
id: 0,
Expand Down Expand Up @@ -291,4 +291,3 @@ List<Product> getProducts(Category category) {
}).toList();
}
}

2 changes: 1 addition & 1 deletion mdc_100_series/lib/model/product.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'package:flutter/foundation.dart';
enum Category { all, accessories, clothing, home, }

class Product {
const Product({
Product({
@required this.category,
@required this.id,
@required this.isFeatured,
Expand Down
4 changes: 2 additions & 2 deletions mdc_100_series/lib/supplemental/asymmetric_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import 'product_columns.dart';
class AsymmetricView extends StatelessWidget {
final List<Product> products;

const AsymmetricView({Key key, this.products});
AsymmetricView({Key key, this.products});

List<Container> _buildColumns(BuildContext context) {
if (products == null || products.isEmpty) {
return const <Container>[];
return <Container>[];
}

/// This will return a list of columns. It will oscillate between the two
Expand Down