@@ -18,9 +18,34 @@ const textColor = Color.white()
1818const secondaryTextColor = new Color ( "#AAAAAA" )
1919const accentColor = new Color ( "#F5F5F5" )
2020
21- // Toyota Car Widget - Part 2: Entry
22- const widget = new ListWidget ( )
23- widget . backgroundColor = backgroundColor
21+ // Toyota Car Widget - Part 3: Large Layout
22+ async function buildLargeWidget ( widget ) {
23+ const imgReq = new Request ( carInfo . imageURL )
24+ const carImage = await imgReq . loadImage ( )
25+
26+ const imgStack = widget . addStack ( )
27+ imgStack . size = new Size ( 0 , 160 )
28+ imgStack . centerAlignContent ( )
29+ const image = imgStack . addImage ( carImage )
30+ image . imageSize = new Size ( 320 , 160 )
31+ image . cornerRadius = 10
32+ image . resizable = true
33+ widget . addSpacer ( 10 )
34+
35+ const brandStack = widget . addStack ( )
36+ brandStack . centerAlignContent ( )
37+ const logo = brandStack . addText ( "🚗 " + carInfo . brand )
38+ logo . font = Font . mediumSystemFont ( 16 )
39+ logo . textColor = textColor
40+ widget . addSpacer ( 2 )
41+
42+ const modelText = widget . addText ( carInfo . model )
43+ modelText . font = Font . semiboldSystemFont ( 20 )
44+ modelText . textColor = accentColor
45+ widget . addSpacer ( 8 )
46+
47+ addDetailsGrid ( widget )
48+ }
2449
2550if ( widgetSize === "large" ) {
2651 await buildLargeWidget ( widget )
0 commit comments