Skip to content

Commit 506a642

Browse files
authored
[101] Removed legacy 'new' and 'const' from 101 starter codelab (#72)
1 parent 6af0234 commit 506a642

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

mdc_100_series/lib/login.dart

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ 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> {
2323
// TODO: Add text editing controllers (101)
2424
@override
2525
Widget build(BuildContext context) {
26-
return new Scaffold(
27-
body: new SafeArea(
28-
child: new ListView(
29-
padding: const EdgeInsets.symmetric(horizontal: 24.0),
26+
return Scaffold(
27+
body: SafeArea(
28+
child: ListView(
29+
padding: EdgeInsets.symmetric(horizontal: 24.0),
3030
children: <Widget>[
31-
const SizedBox(height: 80.0),
32-
new Column(
31+
SizedBox(height: 80.0),
32+
Column(
3333
children: <Widget>[
34-
new Image.asset('assets/diamond.png'),
35-
const SizedBox(height: 16.0),
36-
const Text('SHRINE'),
34+
Image.asset('assets/diamond.png'),
35+
SizedBox(height: 16.0),
36+
Text('SHRINE'),
3737
],
3838
),
39-
const SizedBox(height: 120.0),
39+
SizedBox(height: 120.0),
4040
// TODO: Wrap Username with PrimaryColorOverride (103)
4141
// TODO: Remove filled: true values (103)
4242
// TODO: Wrap Password with PrimaryColorOverride (103)
@@ -49,4 +49,4 @@ class _LoginPageState extends State<LoginPage> {
4949
}
5050
}
5151

52-
// TODO: Add PrimaryColorOverride (103)
52+
// TODO: Add PrimaryColorOverride (103)

mdc_100_series/lib/model/data.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import 'product.dart';
1616

1717
List<Product> getProducts(Category category) {
18-
const allProducts = <Product>[
18+
allProducts = <Product>[
1919
Product(
2020
category: Category.accessories,
2121
id: 0,
@@ -291,4 +291,3 @@ List<Product> getProducts(Category category) {
291291
}).toList();
292292
}
293293
}
294-

mdc_100_series/lib/model/product.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'package:flutter/foundation.dart';
1717
enum Category { all, accessories, clothing, home, }
1818

1919
class Product {
20-
const Product({
20+
Product({
2121
@required this.category,
2222
@required this.id,
2323
@required this.isFeatured,

mdc_100_series/lib/supplemental/asymmetric_view.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import 'product_columns.dart';
2020
class AsymmetricView extends StatelessWidget {
2121
final List<Product> products;
2222

23-
const AsymmetricView({Key key, this.products});
23+
AsymmetricView({Key key, this.products});
2424

2525
List<Container> _buildColumns(BuildContext context) {
2626
if (products == null || products.isEmpty) {
27-
return const <Container>[];
27+
return <Container>[];
2828
}
2929

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

0 commit comments

Comments
 (0)