How to Filter a data from mutablestatelistof to show in lazyColum

51 views Asked by At
[ { "country": "Bangladesh", "countryCode": "BD", "id": 636018, "ip": "103.234.27.153", "port": 1080, "proxyType": "socks" }, { "country": "Hong Kong", "countryCode": "HK", "id": 636023, "ip": "122.10.101.145", "port": 3333, "proxyType": "socks" }, { "country": "United States", "countryCode": "US", "id": 636025, "ip": "74.208.47.100", "port": 58492, "proxyType": "socks" }, ]

This Json Data is Added in DataClass in to this variable

 val proxiesData = mutableStateListOf<ProxiesData>()

 val temp = ArrayList<ProxiesData>()

for (i in 0 until data.length()) {
                val obje = data.getJSONObject(i)

                temp.add(
                    ProxiesData(
                        country = obje.getString("country"),
                        countryCode = obje.getString("countryCode"),
                        id = obje.getInt("id"),
                        ip = obje.getString("ip"),
                        port = obje.getInt("port"),
                        proxytype = obje.getString("proxyType")
                       
                      

                    )
                )
                //    Log.d("Helo",obje.toString())
            }

I Just want to filter the particular country data

the Country will be choose by user

I need to use the filtered data in LazyColums (JetpackCompose)

0

There are 0 answers