google-developer-training / basic-android-kotlin-compose-training-tip-calculator

Apache License 2.0
61 stars 93 forks source link

ERROR in code in ->Calculate a custom tip: Android Basics with Compose #169

Open Rahul28Rawat opened 8 months ago

Rahul28Rawat commented 8 months ago

[URL of codelab](https://developer.android.com/codelabs/basic-android-kotlin-compose-calculate-tip?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-calculate-tip#5)

Error in-> In the sixth step in the code where we are Creating a row

Description-> while making the row its modifier is assigned as modifier=modifier, but its parent does not have any Modifier named "modifier" . the corrected code should be modifier=Modifier i.e. capital M, CORRECTION IN LINE 2 OF THIS CODE-> INCORRECT CODE -> Row( modifier = modifier .fillMaxWidth() .size(48.dp), verticalAlignment = Alignment.CenterVertically ) { }

CORRECTED CODE-> Row( modifier = Modifier .fillMaxWidth() .size(48.dp), verticalAlignment = Alignment.CenterVertically ) { }

Steps to reproduce? 1) Go to the provided codelab link to reach the page 2) Go to step 6 ( if not already there ) 3) scroll down exactly 15 lines ( excluding code lines and images ) OR find the above provided incorrect code in the page 4) you will see the error

Versions Android Studio Hedgehog | 2023.1.1

SCREENSHOT OF THE EXACT ERROR CODE WHICH IS MARKED WITH RED MARKER-> Screenshot 2024-01-23 155728