Skip to content

Commit 73942e4

Browse files
committed
Update homescreen_codelab rebuild script
1 parent 3d2ec6d commit 73942e4

File tree

1 file changed

+27
-34
lines changed

1 file changed

+27
-34
lines changed

homescreen_codelab/codelab_rebuild.yaml

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -841,23 +841,20 @@ steps:
841841
class LineChartPainter extends CustomPainter {
842842
@override
843843
void paint(Canvas canvas, Size size) {
844-
final axisPaint =
845-
Paint()
846-
..color = Colors.black
847-
..strokeWidth = 2
848-
..style = PaintingStyle.stroke;
844+
final axisPaint = Paint()
845+
..color = Colors.black
846+
..strokeWidth = 2
847+
..style = PaintingStyle.stroke;
849848
850-
final dataPaint =
851-
Paint()
852-
..color = Colors.blue
853-
..strokeWidth = 2
854-
..style = PaintingStyle.stroke;
849+
final dataPaint = Paint()
850+
..color = Colors.blue
851+
..strokeWidth = 2
852+
..style = PaintingStyle.stroke;
855853
856-
final markingLinePaint =
857-
Paint()
858-
..color = Colors.red
859-
..strokeWidth = 2
860-
..style = PaintingStyle.stroke;
854+
final markingLinePaint = Paint()
855+
..color = Colors.red
856+
..strokeWidth = 2
857+
..style = PaintingStyle.stroke;
861858
862859
final mockDataPoints = [
863860
const Offset(15, 155),
@@ -872,16 +869,14 @@ steps:
872869
const Offset(200, -10),
873870
];
874871
875-
final axis =
876-
Path()
877-
..moveTo(0, 0)
878-
..lineTo(0, size.height)
879-
..lineTo(size.width, size.height);
872+
final axis = Path()
873+
..moveTo(0, 0)
874+
..lineTo(0, size.height)
875+
..lineTo(size.width, size.height);
880876
881-
final markingLine =
882-
Path()
883-
..moveTo(-10, 50)
884-
..lineTo(size.width + 10, 50);
877+
final markingLine = Path()
878+
..moveTo(-10, 50)
879+
..lineTo(size.width + 10, 50);
885880
886881
final data = Path()..moveTo(1, 180);
887882
@@ -970,10 +965,9 @@ steps:
970965
return MaterialApp(
971966
theme: ThemeData(
972967
appBarTheme: AppBarTheme(
973-
backgroundColor:
974-
ColorScheme.fromSeed(
975-
seedColor: Colors.deepPurple,
976-
).primaryContainer,
968+
backgroundColor: ColorScheme.fromSeed(
969+
seedColor: Colors.deepPurple,
970+
).primaryContainer,
977971
),
978972
textTheme: const TextTheme(
979973
titleMedium: TextStyle(fontFamily: 'Chewy', fontSize: 20),
@@ -1999,7 +1993,7 @@ steps:
19991993
20001994
import 'home_screen.dart';
20011995
import 'news_data.dart';
2002-
@@ -13,23 +15,34 @@ class ArticleScreen extends StatefulWidget {
1996+
@@ -13,23 +15,33 @@ class ArticleScreen extends StatefulWidget {
20031997
}
20041998
20051999
class _ArticleScreenState extends State<ArticleScreen> {
@@ -2034,10 +2028,9 @@ steps:
20342028
+ const LineChart(),
20352029
+ key: 'filename',
20362030
+ logicalSize: _globalKey.currentContext!.size!,
2037-
+ pixelRatio:
2038-
+ MediaQuery.of(
2039-
+ _globalKey.currentContext!,
2040-
+ ).devicePixelRatio,
2031+
+ pixelRatio: MediaQuery.of(
2032+
+ _globalKey.currentContext!,
2033+
+ ).devicePixelRatio,
20412034
+ )
20422035
+ as String;
20432036
+ setState(() {
@@ -2047,7 +2040,7 @@ steps:
20472040
updateHeadline(widget.article);
20482041
},
20492042
label: const Text('Update Homescreen'),
2050-
@@ -44,7 +57,11 @@ class _ArticleScreenState extends State<ArticleScreen> {
2043+
@@ -44,7 +56,11 @@ class _ArticleScreenState extends State<ArticleScreen> {
20512044
const SizedBox(height: 20.0),
20522045
Text(widget.article.articleText!),
20532046
const SizedBox(height: 20.0),

0 commit comments

Comments
 (0)