scrollto in ScrollReader

Hi!

I'm trying to implement a scrollto to a particular .id depending on a preferences state, but the following won't return a view.

   ScrollView (.vertical) {

                    if (preferences.scrollPosition = 1) {

                        withAnimation {

                            proxy.scrollTo(2)

                        }

                    }

Isn't there an error with =

if (preferences.scrollPosition = 1) {

instead of ==

if preferences.scrollPosition == 1 {
scrollto in ScrollReader
 
 
Q